summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-02-07 23:05:10 +0000
committerZac Medico <zmedico@gentoo.org>2007-02-07 23:05:10 +0000
commit62ec0d0477709f4ec7b5e7c1681436d55c2bd2f1 (patch)
tree9eecdc35dc45692342ff8a94391b53a0275d00d0
parentFor bug #165783, handle a potential InvalidDependString exception inside doeb... (diff)
downloadportage-62ec0d0477709f4ec7b5e7c1681436d55c2bd2f1.tar.gz
portage-62ec0d0477709f4ec7b5e7c1681436d55c2bd2f1.tar.bz2
portage-62ec0d0477709f4ec7b5e7c1681436d55c2bd2f1.zip
For bug #165783, handle a potential InvalidDependString exception in repoman and report a SRC_URI.syntax failure. (trunk r5922)
svn path=/main/branches/2.1.2/; revision=5923
-rwxr-xr-xbin/repoman36
1 files changed, 23 insertions, 13 deletions
diff --git a/bin/repoman b/bin/repoman
index f74e8905d..0341c825e 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -160,6 +160,7 @@ qahelp={
"PDEPEND.syntax":"Syntax error in PDEPEND (usually an extra/missing space/parenthesis)",
"LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)",
"PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)",
+ "SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)",
"ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error",
"ebuild.output":"A simple sourcing of the ebuild produces output; this breaks ebuild policy.",
"ebuild.nesteddie":"Placing 'die' inside ( ) prints an error, but doesn't stop the ebuild.",
@@ -806,6 +807,22 @@ for x in scanlist:
mf = Manifest(checkdir, repoman_settings["DISTDIR"])
mydigests=mf.getTypeDigests("DIST")
+ fetchlist_dict = portage.FetchlistDict(checkdir, repoman_settings, portdb)
+ myfiles_all = []
+ for mykey in fetchlist_dict:
+ try:
+ myfiles_all.extend(fetchlist_dict[mykey])
+ except portage_exception.InvalidDependString, e:
+ stats["SRC_URI.syntax"] = stats["SRC_URI.syntax"] + 1
+ fails["SRC_URI.syntax"].append(mykey+".ebuild SRC_URI: "+str(e))
+ 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 myfiles_all
+
if os.path.exists(checkdir+"/files"):
filesdirlist=os.listdir(checkdir+"/files")
for y in filesdirlist:
@@ -835,7 +852,11 @@ for x in scanlist:
fails["digest.stray"].append(x+"/files/"+y)
else:
# We have an ebuild
- myuris, myfiles = portdb.getfetchlist(mykey, all=True)
+ try:
+ myuris, myfiles = portdb.getfetchlist(mykey, all=True)
+ except portage_exception.InvalidDependString, e:
+ # Already handled above.
+ continue
uri_dict = {}
for myu in myuris:
@@ -900,18 +921,7 @@ for x in scanlist:
fails["file.name"].append("%s/files/%s: char '%s'" % (checkdir, y, c))
break
- 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
+ del mydigests
if "ChangeLog" not in checkdirlist:
stats["changelog.missing"]+=1