From: Christopher Covington Date: Thu, 8 Jul 2010 14:46:00 +0000 (-0700) Subject: Patch ebuild.sh to not nuke the WORKDIR if FEATURES="keepwork". X-Git-Tag: v2.2_rc68~530 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=960efaf44e550808815ed4c8f1513df9d5b9eb71;p=portage.git Patch ebuild.sh to not nuke the WORKDIR if FEATURES="keepwork". This allows make to do its thing when using Portage in a development workflow, although the change also exposes how ebuild clean doesn't clear out the WORKDIR. TEST=`rm -rf /build/$board/tmp/portage/chromeos-base/kernel-0.0.1 && [ -e /build/$board/tmp/portage/chromeos-base/kernel-0.0.1/.unpacked ] && rm /build/$board/tmp/portage/chromeos-base/kernel-0.0.1/.unpacked && FEATURES=keepwork ebuild-$board kernel-0.0.1.ebuild install` Then modify some of the source (preferably in the git repository rather than the WORKDIR). `[ -e /build/$board/tmp/portage/chromeos-base/kernel-0.0.1/.unpacked ] && rm /build/$board/tmp/portage/chromeos-base/kernel-0.0.1/.unpacked && FEATURES=keepwork ebuild-$board kernel-0.0.1.ebuild install &&` On the second ebuild operation, make should be able to tell what exactly, or if nothing at all, has changed, and rebuild only the necessary object files. http://codereview.chromium.org/2922001 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 9784298c4..9c599c01b 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -695,9 +695,11 @@ dyn_unpack() { if [ "${newstuff}" == "yes" ]; then # We don't necessarily have privileges to do a full dyn_clean here. rm -rf "${PORTAGE_BUILDDIR}"/{.unpacked,.prepared,.configured,.compiled,.tested,.installed,.packaged,build-info} - rm -rf "${WORKDIR}" + if ! hasq keepwork $FEATURES ; then + rm -rf "${WORKDIR}" + fi if [ -d "${T}" ] && \ - ! hasq keeptemp $FEATURES && ! hasq keepwork $FEATURES ; then + ! hasq keeptemp $FEATURES ; then rm -rf "${T}" && mkdir "${T}" fi fi