Merged from trunk 5476:5478
authorFabian Groffen <grobian@gentoo.org>
Sun, 7 Jan 2007 10:49:57 +0000 (10:49 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 7 Jan 2007 10:49:57 +0000 (10:49 -0000)
Fix the digestentry.unused check so that it works properly when
old-style files/digest-* don't exist.

Don't swallow an IOError if it is thrown from the aux_get call in
portdbapi.getfetchlist().

svn path=/main/branches/prefix/; revision=5479

bin/repoman
pym/portage.py

index d28fd2849df0716d25693f2d7ec9282a27b8b232..a8cf1d78b9bfe9f181fdad826f5dcb7f9a8c096f 100755 (executable)
@@ -937,7 +937,6 @@ for x in scanlist:
 
        mf = Manifest(checkdir, repoman_settings["DISTDIR"])
        mydigests=mf.getTypeDigests("DIST")
-       myfiles_all = []
 
        if os.path.exists(checkdir+"/files"):
                filesdirlist=os.listdir(checkdir+"/files")
@@ -973,7 +972,6 @@ for x in scanlist:
                                else:
                                        # We have an ebuild
                                        myuris, myfiles = portdb.getfetchlist(mykey, all=True)
-                                       myfiles_all.extend(myfiles)
 
                                        uri_dict = {}
                                        for myu in myuris:
@@ -1038,11 +1036,18 @@ for x in scanlist:
                                        fails["file.name"].append("%s/files/%s: char '%s'" % (checkdir, y, c))
                                        break
 
-       for entry in mydigests.keys():
+       fetchlist_dict = portage.FetchlistDict(checkdir, repoman_settings, portdb)
+       myfiles_all = []
+       for myfiles in fetchlist_dict.itervalues():
+               myfiles_all.extend(myfiles)
+               del myfiles
+       del fetchlist_dict
+       myfiles_all = set(myfiles_all)
+       for entry in mydigests:
                if entry not in myfiles_all:
                        stats["digestentry.unused"] += 1
                        fails["digestentry.unused"].append(checkdir+"::"+entry)
-
+       del mydigests, myfiles_all
 
        if "ChangeLog" not in checkdirlist:
                stats["changelog.missing"]+=1
index cdac6bda05b2c481730ac06e8ce845197dd09305..3cff4dc9f831bbf593e64d703f991ade098fc2ee 100644 (file)
@@ -5729,7 +5729,7 @@ class portdbapi(dbapi):
                        mysettings = self.mysettings
                try:
                        myuris = self.aux_get(mypkg, ["SRC_URI"], mytree=mytree)[0]
-               except (IOError,KeyError):
+               except KeyError:
                        print red("getfetchlist():")+" aux_get() error reading "+mypkg+"; aborting."
                        sys.exit(1)