aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-24 03:21:20 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-24 03:21:20 -0700
commitf57036e346400a0a760668b9bc0e6c84b5d61304 (patch)
treee1ffd5cbd6abcc7e1c438fc5299e9d825bc3c2a3
parentImprove indentation for readability. (diff)
downloadportage-f57036e346400a0a760668b9bc0e6c84b5d61304.tar.gz
portage-f57036e346400a0a760668b9bc0e6c84b5d61304.tar.bz2
portage-f57036e346400a0a760668b9bc0e6c84b5d61304.zip
repoman: add new "dependency.unknown" warning
This checks for a dependency that refers to an unknown package (which may be provided by an overlay), as requested in bug #372789.
-rwxr-xr-xbin/repoman25
-rw-r--r--man/repoman.14
2 files changed, 29 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index 487cc67a4..6145c8995 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -286,6 +286,7 @@ qahelp={
"ebuild.notadded":"Ebuilds that exist but have not been added to cvs",
"ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety",
"changelog.notadded":"ChangeLogs that exist but have not been added to cvs",
+ "dependency.unknown" : "Ebuild has a dependency that refers to an unknown package (which may be provided by an overlay)",
"file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do note need the executable bit",
"file.size":"Files in the files directory must be under 20 KiB",
"file.size.fatal":"Files in the files directory must be under 60 KiB",
@@ -377,6 +378,7 @@ qacats.sort()
qawarnings = set((
"changelog.missing",
"changelog.notadded",
+"dependency.unknown",
"digest.assumed",
"digest.unused",
"ebuild.notadded",
@@ -1634,6 +1636,7 @@ for x in scanlist:
# packages that have empty KEYWORDS.
arches.append(['**', '**', ['**']])
+ unknown_pkgs = {}
baddepsyntax = False
badlicsyntax = False
badprovsyntax = False
@@ -1670,6 +1673,12 @@ for x in scanlist:
if atom == "||":
continue
+ if not atom.blocker and \
+ not portdb.cp_list(atom.cp) and \
+ not atom.cp.startswith("virtual/"):
+ unknown_pkgs.setdefault(atom.cp, set()).add(
+ (mytype, atom.unevaluated_atom))
+
is_blocker = atom.blocker
if mytype == "DEPEND" and \
@@ -1913,6 +1922,12 @@ for x in scanlist:
if success:
if atoms:
+ for atom in atoms:
+ if not atom.blocker:
+ # Don't bother with dependency.unknown
+ # for cases in which *DEPEND.bad is
+ # triggered.
+ unknown_pkgs.pop(atom.cp, None)
if not prof.sub_path:
# old-style virtuals currently aren't
@@ -1942,6 +1957,16 @@ for x in scanlist:
(relative_path, keyword,
prof, repr(atoms)))
+ if not baddepsyntax and unknown_pkgs:
+ all_unknown = set(*unknown_pkgs.values())
+ type_map = {}
+ for mytype, atom in all_unknown:
+ type_map.setdefault(mytype, set()).add(atom)
+ for mytype, atoms in type_map.items():
+ stats["dependency.unknown"] += 1
+ fails["dependency.unknown"].append("%s: %s: %s" %
+ (relative_path, mytype, ", ".join(sorted(atoms))))
+
# Check for 'all unstable' or 'all masked' -- ACCEPT_KEYWORDS is stripped
# XXX -- Needs to be implemented in dep code. Can't determine ~arch nicely.
#if not portage.portdb.xmatch("bestmatch-visible",x):
diff --git a/man/repoman.1 b/man/repoman.1
index 3d4cc5304..9aa71805d 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -247,6 +247,10 @@ Missing ChangeLog files
.B changelog.notadded
ChangeLogs that exist but have not been added to cvs
.TP
+.B dependency.unknown
+Ebuild has a dependency that refers to an unknown package (which may be
+provided by an overlay)
+.TP
.B digest.assumed
Existing digest must be assumed correct (Package level only)
.TP