Allow a digest to be created before any distfiles have been fetched for bug #141843.
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Jul 2006 06:32:37 +0000 (06:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Jul 2006 06:32:37 +0000 (06:32 -0000)
svn path=/main/trunk/; revision=4043

bin/ebuild
pym/portage_manifest.py

index 64375298ad74b6c23a87bf46f9a8baef994c3e0b..22a65482a60d40225b8af3639f10f0cf5932269e 100755 (executable)
@@ -90,7 +90,8 @@ def discard_digests(myebuild, mysettings, mydbapi):
        from portage_manifest import Manifest
        mf = Manifest(pkgdir, mysettings["DISTDIR"],
                fetchlist_dict=portage.FetchlistDict(pkgdir, mysettings, mydbapi))
-       mf.create([], assumeDistHashesSometimes=True, assumeDistHashesAlways=True)
+       mf.create(requiredDistfiles=None,
+               assumeDistHashesSometimes=True, assumeDistHashesAlways=True)
        distfiles = mydbapi.getfetchlist(cpv, mysettings=mysettings, all=True)[1]
        for myfile in distfiles:
                try:
index 8fbe6bc62d3d078e6dbc3f60c02c889a08b57969..687d7ca103966db5351a1cc0c8d19dd69a078124 100644 (file)
@@ -403,7 +403,7 @@ class Manifest(object):
                return None
        
        def create(self, checkExisting=False, assumeDistHashesSometimes=False,
-               assumeDistHashesAlways=False, requiredDistfiles=None):
+               assumeDistHashesAlways=False, requiredDistfiles=[]):
                """ Recreate this Manifest from scratch.  This will not use any
                existing checksums unless assumeDistHashesSometimes or
                assumeDistHashesAlways is true (assumeDistHashesSometimes will only
@@ -445,7 +445,11 @@ class Manifest(object):
                distlist = set()
                for cpv in cpvlist:
                        distlist.update(self._getCpvDistfiles(cpv))
-               if requiredDistfiles is None or len(requiredDistfiles) == 0:
+               if requiredDistfiles is None:
+                       # This allows us to force removal of stale digests for the
+                       # ebuild --force digest option (no distfiles are required).
+                       requiredDistfiles = set()
+               elif len(requiredDistfiles) == 0:
                        # repoman passes in an empty list, which implies that all distfiles
                        # are required.
                        requiredDistfiles = distlist.copy()