debuild: pass manifest to digestcheck() v2.2.0_alpha45
authorZac Medico <zmedico@gentoo.org>
Thu, 14 Jul 2011 01:31:28 +0000 (18:31 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Jul 2011 01:31:28 +0000 (18:31 -0700)
This allows us to avoid parsing the Manifest twice.

pym/portage/package/ebuild/digestcheck.py
pym/portage/package/ebuild/doebuild.py

index 21cadc3f52b1ebb4b89c6d951551e964bfc23922..1e34b14966421d29492200d5d637f61b04b856a2 100644 (file)
@@ -12,7 +12,7 @@ from portage.manifest import Manifest
 from portage.output import EOutput
 from portage.util import writemsg
 
-def digestcheck(myfiles, mysettings, strict=False, justmanifest=None):
+def digestcheck(myfiles, mysettings, strict=False, justmanifest=None, mf=None):
        """
        Verifies checksums. Assumes all files have been downloaded.
        @rtype: int
@@ -40,7 +40,8 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None):
                        return 0
                else:
                        return 1
-       mf = Manifest(pkgdir, mysettings["DISTDIR"])
+       if mf is None:
+               mf = Manifest(pkgdir, mysettings["DISTDIR"])
        manifest_empty = True
        for d in mf.fhashdict.values():
                if d:
index e63c0e5a3c6b5a53608c1d32b4a6b319f582649b..fb29b00625f8d689fae31f62410b312c04e2dc95 100644 (file)
@@ -816,7 +816,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
 
                # See above comment about fetching only when needed
                if tree == 'porttree' and \
-                       not digestcheck(checkme, mysettings, "strict" in features):
+                       not digestcheck(checkme, mysettings, "strict" in features, mf=mf):
                        return 1
 
                if mydo == "fetch":