From ae9b6cb513c7b29376caecf3b4e52aac452e2b93 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 28 Aug 2011 16:29:49 -0700 Subject: 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. --- bin/ebuild.sh | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3-1-g7c22