public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10977 - main/trunk/bin
@ 2008-07-08  0:25 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-07-08  0:25 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-07-08 00:25:56 +0000 (Tue, 08 Jul 2008)
New Revision: 10977

Modified:
   main/trunk/bin/repoman
Log:
Use plain sequential search for the SRC_URI.mirror check since the regex
approach is actually much slower.


Modified: main/trunk/bin/repoman
===================================================================
--- main/trunk/bin/repoman	2008-07-07 23:32:11 UTC (rev 10976)
+++ main/trunk/bin/repoman	2008-07-08 00:25:56 UTC (rev 10977)
@@ -780,8 +780,6 @@
 
 # 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.
@@ -1109,13 +1107,18 @@
 			# 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:
+				contains_mirror = False
+				for mirror in thirdpartymirrors:
+					if uri.startswith(mirror):
+						contains_mirror = True
+						break
+				if not contains_mirror:
 					continue
+
 				stats["SRC_URI.mirror"] += 1
 				fails["SRC_URI.mirror"].append(
 					"%s: '%s' found in thirdpartymirrors" % \
-					(relative_path, m.group(0)))
+					(relative_path, mirror))
 
 		# Test for negative logic and bad words in the RESTRICT var.
 		#for x in myaux[allvars.index("RESTRICT")].split():

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-08  0:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08  0:25 [gentoo-commits] portage r10977 - main/trunk/bin Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox