diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-08-28 16:29:49 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-08-28 16:29:49 -0700 |
commit | ae9b6cb513c7b29376caecf3b4e52aac452e2b93 (patch) | |
tree | e15b8ac1534dadf44eb8a0739abba6f40ddaca44 /bin | |
parent | 566a9776d3ca10ccf1b646fba154fa71ccaf4ff6 (diff) | |
download | portage-ae9b6cb513c7b29376caecf3b4e52aac452e2b93.tar.gz portage-ae9b6cb513c7b29376caecf3b4e52aac452e2b93.tar.bz2 portage-ae9b6cb513c7b29376caecf3b4e52aac452e2b93.zip |
doebuild: avoid redundant distfiles checks
When the unpack phase is already marked as complete, it's wasteful to
check distfiles digests. In order to avoid this, we have to migrate the
distfiles/workdir timestamp comparisons from ebuild.sh to doebuild.py,
so that doebuild always knows when unpack will be triggered. This also
allows us to eliminate code in dyn_unpack that duplicated dyn_clean,
actually call dyn_clean instead.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild.sh | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index d68e54b7b..23a12401d 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -726,41 +726,10 @@ dyn_setup() { } dyn_unpack() { - local newstuff="no" - if [ -e "${WORKDIR}" ]; then - local x - local checkme - for x in $A ; do - vecho ">>> Checking ${x}'s mtime..." - if [ "${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/${x}" -nt "${WORKDIR}" ]; then - vecho ">>> ${x} has been updated; recreating WORKDIR..." - newstuff="yes" - break - fi - done - if [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ] ; then - vecho ">>> Not marked as unpacked; recreating WORKDIR..." - newstuff="yes" - fi - fi - if [ "${newstuff}" == "yes" ]; then - # We don't necessarily have privileges to do a full dyn_clean here. - rm -rf "${PORTAGE_BUILDDIR}"/{.setuped,.unpacked,.prepared,.configured,.compiled,.tested,.installed,.packaged,build-info} - if ! has keepwork $FEATURES ; then - rm -rf "${WORKDIR}" - fi - if [ -d "${T}" ] && \ - ! has keeptemp $FEATURES ; then - rm -rf "${T}" && mkdir "${T}" - fi - fi - if [ -e "${WORKDIR}" ]; then - if [ "$newstuff" == "no" ]; then - vecho ">>> WORKDIR is up-to-date, keeping..." - return 0 - fi + if [[ -f ${PORTAGE_BUILDDIR}/.unpacked ]] ; then + vecho ">>> WORKDIR is up-to-date, keeping..." + return 0 fi - if [ ! -d "${WORKDIR}" ]; then install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'" fi |