summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2006-03-25 05:44:28 +0000
committerMarius Mauch <genone@gentoo.org>2006-03-25 05:44:28 +0000
commit81c83f4d81716cd7485a9ea393a344e5df50a521 (patch)
tree21b37003f16f32076c962a8462563013667e97f3
parentLoad virtuals on demand in order to avoid needless vdb scanning during a simp... (diff)
downloadportage-multirepo-81c83f4d81716cd7485a9ea393a344e5df50a521.tar.gz
portage-multirepo-81c83f4d81716cd7485a9ea393a344e5df50a521.tar.bz2
portage-multirepo-81c83f4d81716cd7485a9ea393a344e5df50a521.zip
Add files/ prefix for AUX files in manifest1 entries; fix digest.unused check partially by checking all DIST entries against all SRC_URI entries of a package (instead of per ebuild checks)v2.1_pre7
svn path=/main/trunk/; revision=3002
-rwxr-xr-xbin/repoman23
-rw-r--r--man/repoman.12
-rw-r--r--pym/portage_manifest.py11
3 files changed, 26 insertions, 10 deletions
diff --git a/bin/repoman b/bin/repoman
index 9ef848b1..4c6439e1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -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
diff --git a/man/repoman.1 b/man/repoman.1
index 66994edf..7a70245f 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -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)
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index 962dbb44..a9f521ef 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -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")