summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-02 06:18:17 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-02 06:18:17 +0000
commitbb6b52b7d0dff0103cedbf3c13e81e3382cea86b (patch)
treea0de4bacedbe9e2ed099fa4d20998b1a56c5ac0c /pym
parent276e79a999323c8ce776c0498f4eea1c39acc445 (diff)
downloadportage-bb6b52b7d0dff0103cedbf3c13e81e3382cea86b.tar.gz
portage-bb6b52b7d0dff0103cedbf3c13e81e3382cea86b.tar.bz2
portage-bb6b52b7d0dff0103cedbf3c13e81e3382cea86b.zip
Avoid checking the same Manifest several times in a row during a regen with an empty cache.
svn path=/main/trunk/; revision=5153
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py42
1 files changed, 24 insertions, 18 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 1bad4ebd6..8d5e6ff5a 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2972,6 +2972,7 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
del logid_path, logid_time
_doebuild_manifest_exempt_depend = False
+_doebuild_manifest_checked = None
def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
fetchonly=0, cleanup=0, dbkey=None, use_cache=1, fetchall=0, tree=None,
@@ -3021,24 +3022,29 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
# Always verify the ebuild checksums before executing it.
pkgdir = os.path.dirname(myebuild)
manifest_path = os.path.join(pkgdir, "Manifest")
- if not os.path.exists(manifest_path):
- writemsg("!!! Manifest file not found: '%s'\n" % manifest_path,
- noiselevel=-1)
- return 1
- mf = Manifest(pkgdir, mysettings["DISTDIR"])
- try:
- mf.checkTypeHashes("EBUILD")
- except portage_exception.FileNotFound, e:
- writemsg("!!! A file listed in the Manifest " + \
- "could not be found: %s\n" % str(e), noiselevel=-1)
- return 1
- except portage_exception.DigestException, e:
- writemsg("!!! Digest verification failed:\n", noiselevel=-1)
- writemsg("!!! %s\n" % e.value[0], noiselevel=-1)
- writemsg("!!! Reason: %s\n" % e.value[1], noiselevel=-1)
- writemsg("!!! Got: %s\n" % e.value[2], noiselevel=-1)
- writemsg("!!! Expected: %s\n" % e.value[3], noiselevel=-1)
- return 1
+ global _doebuild_manifest_checked
+ # Avoid checking the same Manifest several times in a row during a
+ # regen with an empty cache.
+ if _doebuild_manifest_checked != manifest_path:
+ if not os.path.exists(manifest_path):
+ writemsg("!!! Manifest file not found: '%s'\n" % manifest_path,
+ noiselevel=-1)
+ return 1
+ mf = Manifest(pkgdir, mysettings["DISTDIR"])
+ try:
+ mf.checkTypeHashes("EBUILD")
+ except portage_exception.FileNotFound, e:
+ writemsg("!!! A file listed in the Manifest " + \
+ "could not be found: %s\n" % str(e), noiselevel=-1)
+ return 1
+ except portage_exception.DigestException, e:
+ writemsg("!!! Digest verification failed:\n", noiselevel=-1)
+ writemsg("!!! %s\n" % e.value[0], noiselevel=-1)
+ writemsg("!!! Reason: %s\n" % e.value[1], noiselevel=-1)
+ writemsg("!!! Got: %s\n" % e.value[2], noiselevel=-1)
+ writemsg("!!! Expected: %s\n" % e.value[3], noiselevel=-1)
+ return 1
+ _doebuild_manifest_checked = manifest_path
doebuild_environment(myebuild, mydo, myroot, mysettings, debug,
use_cache, mydbapi)