diff options
author | 2006-03-24 18:14:00 +0000 | |
---|---|---|
committer | 2006-03-24 18:14:00 +0000 | |
commit | 47be081dc18f47e8b4955721c3db3812adf475d9 (patch) | |
tree | 1a610ba08c828f1c95938afdd4d4a47d2262428b /make.conf-repatch.sh | |
parent | Create tbz2 package directly in ${PKGDIR}/All to avoid need for temp file (in... (diff) | |
download | portage-idfetch-47be081dc18f47e8b4955721c3db3812adf475d9.tar.gz portage-idfetch-47be081dc18f47e8b4955721c3db3812adf475d9.tar.bz2 portage-idfetch-47be081dc18f47e8b4955721c3db3812adf475d9.zip |
Replacing arch specific make.conf files with patches for the fallback make.conf which should be applied in the ebuild.
Add a helper script to update patches if the main make.conf is changed.
svn path=/main/trunk/; revision=2987
Diffstat (limited to 'make.conf-repatch.sh')
-rw-r--r-- | make.conf-repatch.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/make.conf-repatch.sh b/make.conf-repatch.sh new file mode 100644 index 00000000..6589e6b6 --- /dev/null +++ b/make.conf-repatch.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +die() { + echo "ERROR: $*" > /dev/stderr + patch -p0 make.conf < make.conf.diff + exit 1 +} + +if [ ! -f "make.conf" -o ! -f "make.conf.x86.diff" -o ! -d ".svn" ]; then + echo "ERROR: current directory is invalid" > /dev/stderr + exit 1 +fi + +svn diff make.conf > make.conf.diff +svn revert make.conf + +for x in make.conf.*.diff; do + archs="$archs $(basename ${x:10} .diff)" +done + + +for arch in $archs; do + echo "* Patching $arch" + cp make.conf make.conf.$arch || die "copy failed" + patch -p0 make.conf.$arch < make.conf.${arch}.diff > /dev/null || die "arch-patch failed" + patch -p0 make.conf.$arch < make.conf.diff > /dev/null || die "patch failed" +done + +echo "* Re-patching make.conf" +patch -p0 make.conf < make.conf.diff > /dev/null || die "repatch failed" + +for arch in $archs; do + echo "* Creating diff for $arch" + diff -u make.conf make.conf.$arch > make.conf.${arch}.diff + [ -z "${KEEP_ARCH_MAKE_CONF}" ] && rm -f make.conf.$arch make.conf.${arch}.orig +done + +rm make.conf.diff + +echo "Done"
\ No newline at end of file |