summaryrefslogtreecommitdiffstats
path: root/bin/repoman
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-10 21:09:09 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-10 22:28:57 -0700
commit047f52b5d439573cc673a189096ba33c1817b882 (patch)
tree799ffd1c26b3e4e4b15a7a668f81ec479af5f0e7 /bin/repoman
parent2fe8c1c1aecc38079321cbe8bcdc75da31dbacc8 (diff)
downloadportage-047f52b5d439573cc673a189096ba33c1817b882.tar.gz
portage-047f52b5d439573cc673a189096ba33c1817b882.tar.bz2
portage-047f52b5d439573cc673a189096ba33c1817b882.zip
portage.dep.use_reduce: Work on depstrings instead of paren_reduce'd dep arrays
This change makes paren_reduce and paren_normalize calls for use_reduce redundant, resp. wrong. All consumers inside portage are adopted.
Diffstat (limited to 'bin/repoman')
-rwxr-xr-xbin/repoman29
1 files changed, 6 insertions, 23 deletions
diff --git a/bin/repoman b/bin/repoman
index e57976323..fdfd822d7 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
#!/usr/bin/python -O
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Next to do: dep syntax checking in mask files
@@ -1447,8 +1447,7 @@ for x in scanlist:
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)):
+ for uri in portage.flatten(portage.dep.use_reduce(myaux["SRC_URI"], matchall=True)):
contains_mirror = False
for mirror in thirdpartymirrors:
if uri.startswith(mirror):
@@ -1462,8 +1461,7 @@ for x in scanlist:
"%s: '%s' found in thirdpartymirrors" % \
(relative_path, mirror))
- provide = portage.flatten(portage.dep.use_reduce(
- portage.dep.paren_reduce(pkg.metadata['PROVIDE']), matchall=1))
+ provide = portage.flatten(portage.dep.use_reduce(pkg.metadata['PROVIDE'], matchall=1))
provide_cps = []
# The Package class automatically evaluates USE conditionals.
@@ -1609,21 +1607,7 @@ for x in scanlist:
badsyntax.append("'?' preceded by space")
try:
- # Missing closing parenthesis will result in a ValueError
- mydeplist = portage.dep.paren_reduce(mydepstr)
- # Missing opening parenthesis will result in a final "" element
- if "" in mydeplist or "(" in mydeplist:
- raise ValueError
- except ValueError:
- badsyntax.append("parenthesis mismatch")
- mydeplist = []
- except portage.exception.InvalidDependString as e:
- badsyntax.append(str(e))
- del e
- mydeplist = []
-
- try:
- portage.dep.use_reduce(mydeplist, matchall=1)
+ portage.dep.use_reduce(mydepstr, matchall=1)
except portage.exception.InvalidDependString as e:
badsyntax.append(str(e))
@@ -1742,7 +1726,7 @@ for x in scanlist:
myuse = myaux["LICENSE"]
# Parse the LICENSE variable, remove USE conditions and
# flatten it.
- myuse=portage.dep.use_reduce(portage.dep.paren_reduce(myuse), matchall=1)
+ myuse=portage.dep.use_reduce(myuse, matchall=1)
myuse=portage.flatten(myuse)
# Check each entry to ensure that it exists in PORTDIR's
# license directory.
@@ -1772,8 +1756,7 @@ for x in scanlist:
#restrict checks
myrestrict = None
try:
- myrestrict = portage.dep.use_reduce(
- portage.dep.paren_reduce(myaux["RESTRICT"]), matchall=1)
+ myrestrict = portage.dep.use_reduce(myaux["RESTRICT"], matchall=1)
except portage.exception.InvalidDependString as e:
stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1
fails["RESTRICT.syntax"].append(