summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-15 01:24:24 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-14 16:31:28 -0700
commit249631f872e854a379319e5c6d5f871830c80860 (patch)
tree70c599ab8fc2ef2a00f39831c8ee010f4a3c518e /bin
parent724421343eb64987e054c255527e40be73162a83 (diff)
downloadportage-249631f872e854a379319e5c6d5f871830c80860.tar.gz
portage-249631f872e854a379319e5c6d5f871830c80860.tar.bz2
portage-249631f872e854a379319e5c6d5f871830c80860.zip
portage.dep: Integrate the functionality of flatten into use_reduce
Diffstat (limited to 'bin')
-rwxr-xr-xbin/quickpkg4
-rwxr-xr-xbin/repoman17
2 files changed, 11 insertions, 10 deletions
diff --git a/bin/quickpkg b/bin/quickpkg
index 8734a2bf5..042e98cc2 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -21,7 +21,7 @@ except ImportError:
from portage import os
from portage import xpak
from portage.dbapi.dep_expand import dep_expand
-from portage.dep import flatten, use_reduce
+from portage.dep import use_reduce
from portage.exception import InvalidAtom, InvalidData, InvalidDependString, PackageSetNotFound
from portage.util import ConfigProtect, ensure_dirs, shlex_split
from portage.dbapi.vartree import dblink, tar_contents
@@ -78,7 +78,7 @@ def quickpkg_atom(options, infos, arg, eout):
iuse = [ x.lstrip("+-") for x in iuse.split() ]
use = use.split()
try:
- restrict = flatten(use_reduce(restrict, uselist=use))
+ restrict = use_reduce(restrict, uselist=use, flat=True)
except InvalidDependString as e:
eout.eerror("Invalid RESTRICT metadata " + \
"for '%s': %s; skipping" % (cpv, str(e)))
diff --git a/bin/repoman b/bin/repoman
index 97566d3f1..740b92e78 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -986,7 +986,9 @@ 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(list(repoman_settings.thirdpartymirrors().values()))
+thirdpartymirrors = []
+for v in repoman_settings.thirdpartymirrors().values():
+ thirdpartymirrors.extend(v)
class _MetadataTreeBuilder(xml.etree.ElementTree.TreeBuilder):
"""
@@ -1448,9 +1450,9 @@ 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( \
+ for uri in portage.dep.use_reduce( \
myaux["SRC_URI"], matchall=True, is_src_uri=True, \
- allow_src_uri_file_renames=eapi_has_src_uri_arrows(eapi))):
+ allow_src_uri_file_renames=eapi_has_src_uri_arrows(eapi), flat=True):
contains_mirror = False
for mirror in thirdpartymirrors:
if uri.startswith(mirror):
@@ -1464,7 +1466,7 @@ for x in scanlist:
"%s: '%s' found in thirdpartymirrors" % \
(relative_path, mirror))
- provide = portage.flatten(portage.dep.use_reduce(pkg.metadata['PROVIDE'], matchall=1))
+ provide = portage.dep.use_reduce(pkg.metadata['PROVIDE'], matchall=1, flat=True)
provide_cps = []
# The Package class automatically evaluates USE conditionals.
@@ -1731,8 +1733,7 @@ for x in scanlist:
myuse = myaux["LICENSE"]
# Parse the LICENSE variable, remove USE conditions and
# flatten it.
- myuse=portage.dep.use_reduce(myuse, matchall=1)
- myuse=portage.flatten(myuse)
+ myuse=portage.dep.use_reduce(myuse, matchall=1, flat=True)
# Check each entry to ensure that it exists in PORTDIR's
# license directory.
for mypos in range(0,len(myuse)):
@@ -1761,14 +1762,14 @@ for x in scanlist:
#restrict checks
myrestrict = None
try:
- myrestrict = portage.dep.use_reduce(myaux["RESTRICT"], matchall=1)
+ myrestrict = portage.dep.use_reduce(myaux["RESTRICT"], matchall=1, flat=True)
except portage.exception.InvalidDependString as e:
stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1
fails["RESTRICT.syntax"].append(
"%s: RESTRICT: %s" % (relative_path, e))
del e
if myrestrict:
- myrestrict = set(portage.flatten(myrestrict))
+ myrestrict = set(myrestrict)
mybadrestrict = myrestrict.difference(valid_restrict)
if mybadrestrict:
stats["RESTRICT.invalid"] += len(mybadrestrict)