Add files/ prefix for AUX files in manifest1 entries; fix digest.unused check partial... v2.1_pre7
authorMarius Mauch <genone@gentoo.org>
Sat, 25 Mar 2006 05:44:28 +0000 (05:44 -0000)
committerMarius Mauch <genone@gentoo.org>
Sat, 25 Mar 2006 05:44:28 +0000 (05:44 -0000)
svn path=/main/trunk/; revision=3002

bin/repoman
man/repoman.1
pym/portage_manifest.py

index 9ef848b1b2b9f1d3bfe9c8d0a656b7aea6773817..4c6439e1d193e3aeacbbfaf7f91f9e8df6797a95 100755 (executable)
@@ -31,6 +31,8 @@ import cvstree
 import time
 import codecs
 
+from portage_manifest import Manifest
+
 from output import *
 #bold, darkgreen, darkred, green, red, turquoise, yellow
 
@@ -102,7 +104,7 @@ qahelp={
        "CVS/Entries.IO_error":"Attempting to commit, and an IO error was encountered access the Entries file",
        "digest.partial":"Digest files do not contain all corresponding URI elements",
        "digest.assumed":"Existing digest must be assumed correct (Package level only)",
-       "digest.unused":"Digest entry has no matching SRC_URI entry",
+       "digestentry.unused":"Digest/Manifest entry has no matching SRC_URI entry",
        "digest.fail":"Digest does not match the specified local file",
        "digest.stray":"Digest files that do not have a corresponding ebuild",
        "digest.missing":"Digest files that are missing (ebuild exists, digest doesn't)",
@@ -177,7 +179,7 @@ qawarnings=[
 "digest.notadded",
 "digest.disjointed",
 "digest.missing",
-"digest.unused",
+"digestentry.unused",
 "DEPEND.badmasked","RDEPEND.badmasked","PDEPEND.badmasked",
 "DEPEND.badindev","RDEPEND.badindev","PDEPEND.badindev",
 "DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev",
@@ -818,6 +820,10 @@ for x in scanlist:
                                fails["CVS/Entries.IO_error"].append(checkdir+"/files/CVS/Entries")
                        continue
 
+       mf=Manifest(checkdir, db=portage.db["/"]["porttree"].dbapi, mysettings=repoman_settings)
+       mydigests=mf.getTypeDigests("DIST")
+       myfiles_all = []
+
        if os.path.exists(checkdir+"/files"):
                filesdirlist=os.listdir(checkdir+"/files")
                for y in filesdirlist:
@@ -834,8 +840,6 @@ for x in scanlist:
                                        stats["file.executable"] += 1
                                        fails["file.executable"].append(x+"/files/"+y)
                                
-                               mydigests=portage.digestParseFile(checkdir+"/files/"+y)
-                               
                                mykey = catdir + "/" + y[7:]
                                if y[7:] not in ebuildlist:
                                        #stray digest
@@ -850,10 +854,8 @@ for x in scanlist:
                                else:
                                        # We have an ebuild
                                        myuris,myfiles = portage.db["/"]["porttree"].dbapi.getfetchlist(mykey,all=True)
-                                       for entry in mydigests.keys():
-                                               if entry not in myfiles:
-                                                       stats["digest.unused"] += 1
-                                                       fails["digest.unused"].append(y+"::"+entry)
+                                       myfiles_all.extend(myfiles)
+
                                        uri_dict = {}
                                        for myu in myuris:
                                                myubn = os.path.basename(myu)
@@ -913,6 +915,11 @@ for x in scanlist:
                                        fails["file.name"].append("%s/files/%s: char '%s'" % (checkdir, y, c))
                                        break
 
+       for entry in mydigests.keys():
+               if entry not in myfiles_all:
+                       stats["digestentry.unused"] += 1
+                       fails["digestentry.unused"].append(checkdir+"::"+entry)
+
 
        if "ChangeLog" not in checkdirlist:
                stats["changelog.missing"]+=1
index 66994edf9187571927118e62422e317bda1db496..7a70245f8c8e813fe6dc9070de86b7ce6b1e7ca2 100644 (file)
@@ -178,7 +178,7 @@ Digest files that do not have a corresponding ebuild
 Digests which are incomplete (please check if your USE/ARCH includes all files)
 .TP
 .B digest.unused
-Digest entry has no matching SRC_URI entry
+Digest/Manifest entry has no matching SRC_URI entry
 .TP
 .B ebuild.allmasked
 All ebuilds are masked for this package (Package level only)
index 962dbb4474c3c77ae073e550157f546ee2a281a3..a9f521ef070541552ee885ee6b545400eb813deb 100644 (file)
@@ -63,6 +63,10 @@ class Manifest(object):
                        rval.update(self.fhashdict[t])
                return rval
        
+       def getTypeDigests(self, ftype):
+               """ Similar to getDigests(), but restricted to files of the given type. """
+               return self.fhashdict[ftype]
+
        def _readDigests(self):
                """ Parse old style digest files for this Manifest instance """
                mycontent = ""
@@ -140,6 +144,11 @@ class Manifest(object):
                mylines = []
                for t in self.fhashdict.keys():
                        for f in self.fhashdict[t].keys():
+                               # compat hack for v1 manifests
+                               if t == "AUX":
+                                       f2 = os.path.join("files", f)
+                               else:
+                                       f2 = f
                                myline = " ".join([t, f, str(self.fhashdict[t][f]["size"])])
                                myhashes = self.fhashdict[t][f]
                                for h in myhashes.keys():
@@ -151,7 +160,7 @@ class Manifest(object):
                                        for h in myhashes.keys():
                                                if h not in portage_const.MANIFEST1_HASH_FUNCTIONS:
                                                        continue
-                                               mylines.append((" ".join([h, str(myhashes[h]), f, str(myhashes["size"])])))
+                                               mylines.append((" ".join([h, str(myhashes[h]), f2, str(myhashes["size"])])))
                fd.write("\n".join(mylines))
                fd.write("\n")