* [gentoo-commits] portage r14345 - in main/branches/prefix: bin pym/_emerge pym/portage pym/portage/dbapi pym/portage/tests/env/config pym/repoman
@ 2009-09-21 17:45 Fabian Groffen (grobian)
0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2009-09-21 17:45 UTC (permalink / raw
To: gentoo-commits
Author: grobian
Date: 2009-09-21 17:45:06 +0000 (Mon, 21 Sep 2009)
New Revision: 14345
Modified:
main/branches/prefix/bin/emaint
main/branches/prefix/bin/quickpkg
main/branches/prefix/bin/repoman
main/branches/prefix/pym/_emerge/EbuildMetadataPhase.py
main/branches/prefix/pym/_emerge/FakeVartree.py
main/branches/prefix/pym/_emerge/Scheduler.py
main/branches/prefix/pym/_emerge/actions.py
main/branches/prefix/pym/_emerge/depgraph.py
main/branches/prefix/pym/_emerge/search.py
main/branches/prefix/pym/_emerge/unmerge.py
main/branches/prefix/pym/portage/__init__.py
main/branches/prefix/pym/portage/dbapi/__init__.py
main/branches/prefix/pym/portage/dbapi/bintree.py
main/branches/prefix/pym/portage/dbapi/porttree.py
main/branches/prefix/pym/portage/dbapi/vartree.py
main/branches/prefix/pym/portage/tests/env/config/test_PortageModulesFile.py
main/branches/prefix/pym/repoman/utilities.py
Log:
Merged from trunk -r14313:14314
| 14314 | Use filter() and zip() instead of itertools.ifilter() and |
| arfrever | itertools.izip() for compatibility with Python 3. (2to3-3.1 |
| | -f itertools -f itertools_imports -nw ${FILES}) |
Modified: main/branches/prefix/bin/emaint
===================================================================
--- main/branches/prefix/bin/emaint 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/bin/emaint 2009-09-21 17:45:06 UTC (rev 14345)
@@ -279,12 +279,11 @@
maxval = len(cpv_all)
aux_update = self._tree.dbapi.aux_update
update_keys = self._update_keys
- from itertools import izip
from portage.update import update_dbentries
if onProgress:
onProgress(maxval, 0)
for i, cpv in enumerate(cpv_all):
- metadata = dict(izip(update_keys, aux_get(cpv, update_keys)))
+ metadata = dict(zip(update_keys, aux_get(cpv, update_keys)))
metadata_updates = update_dbentries(updates, metadata)
if metadata_updates:
errors.append("'%s' has outdated metadata" % cpv)
Modified: main/branches/prefix/bin/quickpkg
===================================================================
--- main/branches/prefix/bin/quickpkg 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/bin/quickpkg 2009-09-21 17:45:06 UTC (rev 14345)
@@ -8,7 +8,6 @@
import errno
import signal
import sys
-from itertools import izip
from os import environ as ose
from os import path as osp
@@ -119,7 +118,7 @@
return False
excluded_config_files.append(filename)
return True
- existing_metadata = dict(izip(fix_metadata_keys,
+ existing_metadata = dict(zip(fix_metadata_keys,
vardb.aux_get(cpv, fix_metadata_keys)))
category, pf = portage.catsplit(cpv)
required_metadata = {}
Modified: main/branches/prefix/bin/repoman
===================================================================
--- main/branches/prefix/bin/repoman 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/bin/repoman 2009-09-21 17:45:06 UTC (rev 14345)
@@ -27,7 +27,7 @@
import platform
from io import StringIO
-from itertools import chain, izip
+from itertools import chain
from stat import S_ISDIR, ST_CTIME
if not hasattr(__builtins__, "set"):
@@ -947,7 +947,7 @@
ebuildlist.append(pf)
cpv = "%s/%s" % (catdir, pf)
try:
- myaux = dict(izip(allvars, portdb.aux_get(cpv, allvars)))
+ myaux = dict(zip(allvars, portdb.aux_get(cpv, allvars)))
except KeyError:
stats["ebuild.syntax"] += 1
fails["ebuild.syntax"].append(os.path.join(x, y))
Modified: main/branches/prefix/pym/_emerge/EbuildMetadataPhase.py
===================================================================
--- main/branches/prefix/pym/_emerge/EbuildMetadataPhase.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/EbuildMetadataPhase.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -10,7 +10,6 @@
from portage import os
from portage import _encodings
from portage import _unicode_encode
-from itertools import izip
import fcntl
import codecs
@@ -131,7 +130,7 @@
# number of lines is incorrect.
self.returncode = 1
else:
- metadata = izip(portage.auxdbkeys, metadata_lines)
+ metadata = zip(portage.auxdbkeys, metadata_lines)
self.metadata = self.metadata_callback(self.cpv,
self.ebuild_path, self.repo_path, metadata,
self.ebuild_mtime)
Modified: main/branches/prefix/pym/_emerge/FakeVartree.py
===================================================================
--- main/branches/prefix/pym/_emerge/FakeVartree.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/FakeVartree.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-from itertools import izip
import portage
from portage import os
from _emerge.Package import Package
@@ -50,7 +49,7 @@
if pkg is not None:
metadata = pkg.metadata
else:
- metadata = dict(izip(mykeys, real_dbapi.aux_get(cpv, mykeys)))
+ metadata = dict(zip(mykeys, real_dbapi.aux_get(cpv, mykeys)))
myslot = metadata["SLOT"]
mycp = portage.cpv_getkey(cpv)
myslot_atom = "%s:%s" % (mycp, myslot)
@@ -110,7 +109,7 @@
self._aux_get_history.add(pkg)
try:
# Use the live ebuild metadata if possible.
- live_metadata = dict(izip(self._portdb_keys,
+ live_metadata = dict(zip(self._portdb_keys,
self._portdb.aux_get(pkg, self._portdb_keys)))
if not portage.eapi_is_supported(live_metadata["EAPI"]):
raise KeyError(pkg)
@@ -195,7 +194,7 @@
root_config = self._root_config
real_vardb = root_config.trees["vartree"].dbapi
pkg = Package(cpv=cpv, installed=True,
- metadata=izip(self._db_keys,
+ metadata=zip(self._db_keys,
real_vardb.aux_get(cpv, self._db_keys)),
root_config=root_config,
type_name="installed")
@@ -224,7 +223,7 @@
def perform_global_updates(mycpv, mydb, mycommands):
from portage.update import update_dbentries
aux_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
- aux_dict = dict(izip(aux_keys, mydb.aux_get(mycpv, aux_keys)))
+ aux_dict = dict(zip(aux_keys, mydb.aux_get(mycpv, aux_keys)))
updates = update_dbentries(mycommands, aux_dict)
if updates:
mydb.aux_update(mycpv, updates)
Modified: main/branches/prefix/pym/_emerge/Scheduler.py
===================================================================
--- main/branches/prefix/pym/_emerge/Scheduler.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/Scheduler.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -10,7 +10,6 @@
import textwrap
import time
import weakref
-from itertools import izip
import portage
from portage import os
from portage import _encodings
@@ -1670,7 +1669,7 @@
db = root_config.trees[tree_type].dbapi
db_keys = list(self.trees[root_config.root][
tree_type].dbapi._aux_cache_keys)
- metadata = izip(db_keys, db.aux_get(cpv, db_keys))
+ metadata = zip(db_keys, db.aux_get(cpv, db_keys))
return Package(built=(type_name != 'ebuild'),
cpv=cpv, metadata=metadata,
root_config=root_config, installed=installed)
Modified: main/branches/prefix/pym/_emerge/actions.py
===================================================================
--- main/branches/prefix/pym/_emerge/actions.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/actions.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -19,7 +19,7 @@
import sys
import textwrap
import time
-from itertools import chain, izip
+from itertools import chain
import portage
from portage import os
@@ -1364,9 +1364,9 @@
out = EOutput()
for cpv in mypkgs:
# Get all package specific variables
- metadata = dict(izip(auxkeys, vardb.aux_get(cpv, auxkeys)))
+ metadata = dict(zip(auxkeys, vardb.aux_get(cpv, auxkeys)))
pkg = Package(built=True, cpv=cpv,
- installed=True, metadata=izip(Package.metadata_keys,
+ installed=True, metadata=zip(Package.metadata_keys,
(metadata.get(x, '') for x in Package.metadata_keys)),
root_config=root_config, type_name='installed')
Modified: main/branches/prefix/pym/_emerge/depgraph.py
===================================================================
--- main/branches/prefix/pym/_emerge/depgraph.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/depgraph.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -9,7 +9,7 @@
import re
import sys
import textwrap
-from itertools import chain, izip
+from itertools import chain
import portage
from portage import os
@@ -2538,7 +2538,7 @@
db_keys = list(self._frozen_config._trees_orig[root_config.root][
tree_type].dbapi._aux_cache_keys)
try:
- metadata = izip(db_keys, db.aux_get(cpv, db_keys))
+ metadata = zip(db_keys, db.aux_get(cpv, db_keys))
except KeyError:
raise portage.exception.PackageNotFound(cpv)
pkg = Package(built=(type_name != "ebuild"), cpv=cpv,
@@ -5140,7 +5140,7 @@
db, pkg_type, built, installed, db_keys):
eapi_masked = False
try:
- metadata = dict(izip(db_keys,
+ metadata = dict(zip(db_keys,
db.aux_get(cpv, db_keys)))
except KeyError:
metadata = None
Modified: main/branches/prefix/pym/_emerge/search.py
===================================================================
--- main/branches/prefix/pym/_emerge/search.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/search.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -5,7 +5,6 @@
from __future__ import print_function
import re
-from itertools import izip
import portage
from portage import os
from portage.output import bold, bold as white, darkgreen, green, red
@@ -142,7 +141,7 @@
else:
db_keys = list(db._aux_cache_keys)
for cpv in db.match(atom):
- metadata = izip(db_keys,
+ metadata = zip(db_keys,
db.aux_get(cpv, db_keys))
if not self._visible(db, cpv, metadata):
continue
@@ -165,7 +164,7 @@
for cpv in reversed(db.match(atom)):
if portage.cpv_getkey(cpv) != cp:
continue
- metadata = izip(db_keys,
+ metadata = zip(db_keys,
db.aux_get(cpv, db_keys))
if not self._visible(db, cpv, metadata):
continue
Modified: main/branches/prefix/pym/_emerge/unmerge.py
===================================================================
--- main/branches/prefix/pym/_emerge/unmerge.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/_emerge/unmerge.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -7,7 +7,6 @@
import logging
import sys
import textwrap
-from itertools import izip
import portage
from portage import os
from portage.output import bold, colorize, darkgreen, green
@@ -42,7 +41,7 @@
pkg = pkg_cache.get(cpv)
if pkg is None:
pkg = Package(cpv=cpv, installed=True,
- metadata=izip(db_keys, vartree.dbapi.aux_get(cpv, db_keys)),
+ metadata=zip(db_keys, vartree.dbapi.aux_get(cpv, db_keys)),
root_config=root_config,
type_name="installed")
pkg_cache[cpv] = pkg
Modified: main/branches/prefix/pym/portage/__init__.py
===================================================================
--- main/branches/prefix/pym/portage/__init__.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/portage/__init__.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -35,7 +35,7 @@
from commands import getstatusoutput as subprocess_getstatusoutput
from time import sleep
from random import shuffle
- from itertools import chain, izip
+ from itertools import chain
import platform
import warnings
@@ -2601,7 +2601,7 @@
pkg_configdict.addLazySingleton(k,
mydb.__getitem__, k)
else:
- for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
+ for k, v in zip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
pkg_configdict[k] = v
repository = pkg_configdict.pop("repository", None)
if repository is not None:
@@ -6678,7 +6678,7 @@
fd_pipes=fd_pipes, returnpid=True, droppriv=droppriv)
os.close(pw) # belongs exclusively to the child process now
f = os.fdopen(pr, 'rb')
- for k, v in izip(auxdbkeys,
+ for k, v in zip(auxdbkeys,
(_unicode_decode(line).rstrip('\n') for line in f)):
dbkey[k] = v
f.close()
@@ -7161,7 +7161,7 @@
misc_keys = ["LICENSE", "PROPERTIES", "PROVIDE", "RESTRICT", "SRC_URI"]
other_keys = ["SLOT"]
all_keys = dep_keys + misc_keys + other_keys
- metadata = dict(izip(all_keys,
+ metadata = dict(zip(all_keys,
mydbapi.aux_get(mysettings.mycpv, all_keys)))
class FakeTree(object):
@@ -7715,7 +7715,7 @@
if unreduced[0] != "||":
unresolved = []
- for x, satisfied in izip(unreduced, reduced):
+ for x, satisfied in zip(unreduced, reduced):
if isinstance(x, list):
unresolved += dep_zapdeps(x, satisfied, myroot,
use_binaries=use_binaries, trees=trees)
@@ -7757,7 +7757,7 @@
# Sort the deps into installed, not installed but already
# in the graph and other, not installed and not in the graph
# and other, with values of [[required_atom], availablility]
- for x, satisfied in izip(deps, satisfieds):
+ for x, satisfied in zip(deps, satisfieds):
if isinstance(x, list):
atoms = dep_zapdeps(x, satisfied, myroot,
use_binaries=use_binaries, trees=trees)
@@ -8199,7 +8199,7 @@
if metadata is None:
db_keys = list(portdb._aux_cache_keys)
try:
- metadata = dict(izip(db_keys, portdb.aux_get(mycpv, db_keys)))
+ metadata = dict(zip(db_keys, portdb.aux_get(mycpv, db_keys)))
except KeyError:
if not portdb.cpv_exists(mycpv):
raise
@@ -8275,7 +8275,7 @@
if metadata is None:
db_keys = list(portdb._aux_cache_keys)
try:
- metadata = dict(izip(db_keys, portdb.aux_get(mycpv, db_keys)))
+ metadata = dict(zip(db_keys, portdb.aux_get(mycpv, db_keys)))
except KeyError:
if not portdb.cpv_exists(mycpv):
raise
Modified: main/branches/prefix/pym/portage/dbapi/__init__.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/__init__.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/portage/dbapi/__init__.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -221,14 +221,13 @@
aux_get = self.aux_get
aux_update = self.aux_update
update_keys = ["DEPEND", "RDEPEND", "PDEPEND", "PROVIDE"]
- from itertools import izip
from portage.update import update_dbentries
if onUpdate:
onUpdate(maxval, 0)
if onProgress:
onProgress(maxval, 0)
for i, cpv in enumerate(cpv_all):
- metadata = dict(izip(update_keys, aux_get(cpv, update_keys)))
+ metadata = dict(zip(update_keys, aux_get(cpv, update_keys)))
metadata_updates = update_dbentries(updates, metadata)
if metadata_updates:
aux_update(cpv, metadata_updates)
Modified: main/branches/prefix/pym/portage/dbapi/bintree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/bintree.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/portage/dbapi/bintree.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -30,7 +30,7 @@
import errno
import re
import stat
-from itertools import chain, izip
+from itertools import chain
class bindbapi(fakedbapi):
_known_keys = frozenset(list(fakedbapi._known_keys) + \
@@ -613,7 +613,7 @@
d["MTIME"] = str(long(s.st_mtime))
d["SIZE"] = str(s.st_size)
- d.update(izip(self._pkgindex_aux_keys,
+ d.update(zip(self._pkgindex_aux_keys,
self.dbapi.aux_get(mycpv, self._pkgindex_aux_keys)))
try:
self._eval_use_flags(mycpv, d)
@@ -936,7 +936,7 @@
pkg_path = self.getname(cpv)
from portage.checksum import perform_multiple_checksums
- d = dict(izip(self._pkgindex_aux_keys,
+ d = dict(zip(self._pkgindex_aux_keys,
self.dbapi.aux_get(cpv, self._pkgindex_aux_keys)))
d.update(perform_multiple_checksums(
Modified: main/branches/prefix/pym/portage/dbapi/porttree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/porttree.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/portage/dbapi/porttree.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -35,7 +35,6 @@
import codecs
import logging
import stat
-from itertools import izip
def _src_uri_validate(cpv, eapi, src_uri):
"""
@@ -988,7 +987,7 @@
iterfunc = reversed
for cpv in iterfunc(mylist):
try:
- metadata = dict(izip(aux_keys,
+ metadata = dict(zip(aux_keys,
self.aux_get(cpv, aux_keys)))
except KeyError:
# ebuild masked by corruption
@@ -1070,7 +1069,7 @@
getProfileMaskAtom = self.mysettings._getProfileMaskAtom
for cpv in mylist:
try:
- metadata = dict(izip(db_keys, self.aux_get(cpv, db_keys)))
+ metadata = dict(zip(db_keys, self.aux_get(cpv, db_keys)))
except KeyError:
# masked by corruption
continue
@@ -1097,7 +1096,7 @@
for mycpv in mylist:
metadata.clear()
try:
- metadata.update(izip(aux_keys, self.aux_get(mycpv, aux_keys)))
+ metadata.update(zip(aux_keys, self.aux_get(mycpv, aux_keys)))
except KeyError:
continue
except PortageException as e:
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -52,7 +52,6 @@
import re, shutil, stat, errno, copy, subprocess
import logging
import sys
-from itertools import izip
try:
import cPickle as pickle
@@ -1947,7 +1946,7 @@
if pull_me:
# pull any needed data and cache it
aux_keys = list(pull_me)
- for k, v in izip(aux_keys,
+ for k, v in zip(aux_keys,
self._aux_get(mycpv, aux_keys, st=mydir_stat)):
mydata[k] = v
if not cache_valid or cache_these.difference(metadata):
Modified: main/branches/prefix/pym/portage/tests/env/config/test_PortageModulesFile.py
===================================================================
--- main/branches/prefix/pym/portage/tests/env/config/test_PortageModulesFile.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/portage/tests/env/config/test_PortageModulesFile.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -6,7 +6,6 @@
from portage.tests import TestCase
from portage.env.config import PortageModulesFile
from tempfile import mkstemp
-from itertools import izip
class PortageModulesFileTestCase(TestCase):
@@ -16,7 +15,7 @@
def setUp(self):
self.items = {}
- for k, v in izip(self.keys + self.invalid_keys,
+ for k, v in zip(self.keys + self.invalid_keys,
self.modules):
self.items[k] = v
Modified: main/branches/prefix/pym/repoman/utilities.py
===================================================================
--- main/branches/prefix/pym/repoman/utilities.py 2009-09-21 17:43:04 UTC (rev 14344)
+++ main/branches/prefix/pym/repoman/utilities.py 2009-09-21 17:45:06 UTC (rev 14345)
@@ -20,7 +20,6 @@
import codecs
import errno
-import itertools
import logging
import sys
try:
@@ -221,7 +220,7 @@
full = options.mode == 'full'
# we only want key value pairs where value > 0
for category, number in \
- itertools.ifilter(lambda myitem: myitem[1] > 0, stats.iteritems()):
+ filter(lambda myitem: myitem[1] > 0, stats.iteritems()):
formatter.add_literal_data(_unicode_decode(" " + category.ljust(30)))
if category in qawarnings:
formatter.push_style("WARN")
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-21 17:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21 17:45 [gentoo-commits] portage r14345 - in main/branches/prefix: bin pym/_emerge pym/portage pym/portage/dbapi pym/portage/tests/env/config pym/repoman Fabian Groffen (grobian)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox