summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-07 22:07:03 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-07 22:07:03 +0000
commitc931f1fff92186cbbe78613845270245eba64a37 (patch)
treebde626c152f085a2642813e29fd412552bc0bbdf
parentfe8c3393434c6cae74e8bc842ece886c9839b42f (diff)
downloadportage-c931f1fff92186cbbe78613845270245eba64a37.tar.gz
portage-c931f1fff92186cbbe78613845270245eba64a37.tar.bz2
portage-c931f1fff92186cbbe78613845270245eba64a37.zip
Add a new "SRC_URI.mirror" check which checks to if a uri listed in
profiles/thirdpartymirrors is found in SRC_URI. Thanks to Betelgeuse for the initial patch which has now been optimized with a regex. svn path=/main/trunk/; revision=10973
-rwxr-xr-xbin/repoman19
-rw-r--r--man/repoman.13
2 files changed, 22 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index 3f185f5af..508b91b2b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -293,6 +293,7 @@ qahelp={
"PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)",
"RESTRICT.syntax":"Syntax error in RESTRICT (usually an extra/missing space/parenthesis)",
"SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)",
+ "SRC_URI.mirror":"A uri listed in profiles/thirdpartymirrors is found in SRC_URI",
"ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error or digest verification failure",
"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.",
@@ -340,6 +341,7 @@ qawarnings=[
"IUSE.undefined",
"RDEPEND.suspect",
"RESTRICT.invalid",
+"SRC_URI.mirror",
"ebuild.minorsyn",
"ebuild.badheader",
"ebuild.patches",
@@ -776,6 +778,11 @@ shared_xmatch_caches = {"cp-list":{}}
check_ebuild_notadded = not \
(vcs == "svn" and repolevel < 3 and options.mode != "commit")
+# Build a regex from thirdpartymirrors for the SRC_URI.mirror check.
+thirdpartymirrors = portage.flatten(repoman_settings.thirdpartymirrors().values())
+thirdpartymirrors = re.compile(r'^(%s)' % \
+ "|".join(re.escape(x) for x in thirdpartymirrors))
+
for x in scanlist:
#ebuilds and digests added to cvs respectively.
logging.info("checking package %s" % x)
@@ -1098,6 +1105,18 @@ for x in scanlist:
eapi = myaux["EAPI"]
inherited = pkg.inherited
+ if not src_uri_error:
+ # Check that URIs don't reference a server from thirdpartymirrors.
+ for uri in portage.flatten(portage.dep.use_reduce(
+ portage.dep.paren_reduce(myaux["SRC_URI"]), matchall=True)):
+ m = thirdpartymirrors.match(uri)
+ if m is None:
+ continue
+ stats["SRC_URI.mirror"] += 1
+ fails["SRC_URI.mirror"].append(
+ "%s: '%s' found in thirdpartymirrors" % \
+ (relative_path, m.group(0)))
+
# Test for negative logic and bad words in the RESTRICT var.
#for x in myaux[allvars.index("RESTRICT")].split():
# if x.startswith("no"):
diff --git a/man/repoman.1 b/man/repoman.1
index 1d4c24a2f..42e653080 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -180,6 +180,9 @@ Syntax error in RDEPEND (usually an extra/missing space/parenthesis)
.B SLOT.missing
Ebuilds that have a missing or empty SLOT variable
.TP
+.B SRC_URI.mirror
+A uri listed in profiles/thirdpartymirrors is found in SRC_URI
+.TP
.B changelog.missing
Missing ChangeLog files
.TP