debuild: pass dist digests to fetch()
authorZac Medico <zmedico@gentoo.org>
Thu, 14 Jul 2011 00:56:57 +0000 (17:56 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Jul 2011 00:56:57 +0000 (17:56 -0700)
This allows us to avoid parsing the Manifest twice.

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

index 1849af94f264d22de86feaf126e48d302f579d3f..8e7515c9857338a92cb7fd17f7c8e836a67a981c 100644 (file)
@@ -478,6 +478,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        noiselevel=-1)
                return 1
 
+       mf = None
        if "strict" in features and \
                "digest" not in features and \
                tree == "porttree" and \
@@ -765,8 +766,12 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        else:
                                fetchme = alist
 
+                       dist_digests = None
+                       if mf is not None:
+                               dist_digests = mf.getTypeDigests("DIST")
                        if not fetch(fetchme, mysettings, listonly=listonly,
-                               fetchonly=fetchonly, allow_missing_digests=True):
+                               fetchonly=fetchonly, allow_missing_digests=True,
+                               digests=dist_digests):
                                spawn_nofetch(mydbapi, myebuild, settings=mysettings)
                                if listonly:
                                        # The convention for listonly mode is to report
index 46d77cf74b185830bcdbc6a9c2adf3be425579f8..2ae1fe85b0b89f1a369aea5bf4ee63dde491cbd5 100644 (file)
@@ -358,7 +358,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
        if digests is None and not (pkgdir is None or skip_manifest):
                mydigests = Manifest(
                        pkgdir, mysettings["DISTDIR"]).getTypeDigests("DIST")
-       elif digests is None:
+       elif digests is None or skip_manifest:
                # no digests because fetch was not called for a specific package
                mydigests = {}
        else: