summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/dispatch-conf2
-rwxr-xr-xbin/emaint6
-rwxr-xr-xbin/regenworld14
-rw-r--r--pym/portage/dbapi/porttree.py2
-rw-r--r--pym/portage/dbapi/vartree.py2
-rw-r--r--pym/portage/tests/__init__.py3
-rw-r--r--pym/portage/util.py2
-rw-r--r--pym/repoman/utilities.py4
8 files changed, 17 insertions, 18 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 5247cdb60..bf4cac611 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -205,7 +205,7 @@ class dispatch:
else:
return True
- confs = filter (f, confs)
+ confs = [x for x in confs if f(x)]
#
# Interactively process remaining
diff --git a/bin/emaint b/bin/emaint
index 7aac5d49a..2626036e9 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -80,9 +80,9 @@ class WorldHandler(object):
self._check_world(onProgress)
errors = []
if self.found:
- errors += map(lambda x: "'%s' is not a valid atom" % x, self.invalid)
- errors += map(lambda x: "'%s' is not installed" % x, self.not_installed)
- errors += map(lambda x: "'%s' has a category that is not listed in /etc/portage/categories" % x, self.invalid_category)
+ errors += ["'%s' is not a valid atom" % x for x in self.invalid]
+ errors += ["'%s' is not installed" % x for x in self.not_installed]
+ errors += ["'%s' has a category that is not listed in /etc/portage/categories" % x for x in self.invalid_category]
else:
errors.append(self.world_file + " could not be opened for reading")
return errors
diff --git a/bin/regenworld b/bin/regenworld
index de082db41..f5b30bd49 100755
--- a/bin/regenworld
+++ b/bin/regenworld
@@ -58,18 +58,16 @@ if len(sys.argv) >= 2 and sys.argv[1] in ["-h", "--help"]:
sys.exit(0)
worldlist = portage.grabfile(os.path.join("/", portage.WORLD_FILE))
-syslist = portage.settings.packages
-syslist = filter(issyspkg, syslist)
+syslist = [x for x in portage.settings.packages if issyspkg(x)]
logfile = portage.grabfile("/var/log/emerge.log")
-biglist = filter(iscandidate, logfile)
-biglist = map(getpkginfo, biglist)
+biglist = [getpkginfo(x) for x in logfile if iscandidate(x)]
tmplist = []
for l in biglist:
tmplist += l.split()
-biglist = filter(isunwanted, tmplist)
+biglist = [x for x in tmplist if isunwanted(x)]
#for p in biglist:
-# print p
+# print(p)
#sys.exit(0)
# resolving virtuals
@@ -77,7 +75,7 @@ realsyslist = []
for mykey in syslist:
# drop the asterix
mykey = mykey[1:]
- #print "candidate:",mykey
+ #print("candidate:",mykey)
mylist=portage.db["/"]["vartree"].dbapi.match(mykey)
if mylist:
mykey=portage.cpv_getkey(mylist[0])
@@ -85,7 +83,7 @@ for mykey in syslist:
realsyslist.append(mykey)
for mykey in biglist:
- #print "checking:",mykey
+ #print("checking:",mykey)
try:
mylist=portage.db["/"]["vartree"].dbapi.match(mykey)
except (portage.exception.InvalidAtom, KeyError):
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index f68d92fd2..eb68ae2b5 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -342,7 +342,7 @@ class portdbapi(dbapi):
# XXX: REMOVE THIS ONCE UNUSED_0 IS YANKED FROM auxdbkeys
# ~harring
- filtered_auxdbkeys = list(filter(lambda x: not x.startswith("UNUSED_0"), auxdbkeys))
+ filtered_auxdbkeys = [x for x in auxdbkeys if not x.startswith("UNUSED_0")]
filtered_auxdbkeys.sort()
from portage.cache import metadata_overlay, volatile
if not depcachedir_w_ok:
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 90d27dee3..9d1755e9f 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -387,7 +387,7 @@ class LinkageMap(object):
for x in filter(None, fields[3].replace(
"${ORIGIN}", os.path.dirname(obj)).replace(
"$ORIGIN", os.path.dirname(obj)).split(":"))])
- needed = filter(None, fields[4].split(","))
+ needed = [x for x in fields[4].split(",") if x]
obj_key = self._obj_key(obj)
indexed = True
diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py
index 6e7380409..9a81d22ff 100644
--- a/pym/portage/tests/__init__.py
+++ b/pym/portage/tests/__init__.py
@@ -176,7 +176,8 @@ class TextTestRunner(unittest.TextTestRunner):
self.stream.writeln()
if not result.wasSuccessful():
self.stream.write("FAILED (")
- failed, errored = map(len, (result.failures, result.errors))
+ failed = len(result.failures)
+ errored = len(result.errors)
if failed:
self.stream.write("failures=%d" % failed)
if errored:
diff --git a/pym/portage/util.py b/pym/portage/util.py
index df1c1a1e4..3efc2156a 100644
--- a/pym/portage/util.py
+++ b/pym/portage/util.py
@@ -150,7 +150,7 @@ def map_dictlist_vals(func,myDict):
new_dl = {}
for key in myDict:
new_dl[key] = []
- new_dl[key] = map(func,myDict[key])
+ new_dl[key] = [func(x) for x in myDict[key]]
return new_dl
def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0):
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 45160cfc8..5ce386737 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -346,7 +346,7 @@ def FindPortdir(settings):
Args:
settings - portage.config instance, preferably repoman_settings
Returns:
- tuple(portdir, portdir_overlay, location)
+ list(portdir, portdir_overlay, location)
"""
portdir = None
@@ -430,4 +430,4 @@ def FindPortdir(settings):
if not portdir.endswith('/'):
portdir += '/'
- return map(normalize_path, (portdir, portdir_overlay, location))
+ return [normalize_path(x) for x in (portdir, portdir_overlay, location)]