import time
import codecs
+from portage_manifest import Manifest
+
from output import *
#bold, darkgreen, darkred, green, red, turquoise, yellow
"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)",
"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",
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:
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
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)
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
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 = ""
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():
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")