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)
import errno
import signal
import sys
-from itertools import izip
try:
import portage
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 = {}
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"):
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))
from portage import os
from portage import _encodings
from portage import _unicode_encode
-from itertools import izip
import fcntl
import codecs
# 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)
# 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
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)
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)
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")
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)
import textwrap
import time
import weakref
-from itertools import izip
import portage
from portage import os
from portage import _encodings
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)
import sys
import textwrap
import time
-from itertools import chain, izip
+from itertools import chain
import portage
from portage import os
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')
import re
import sys
import textwrap
-from itertools import chain, izip
+from itertools import chain
import portage
from portage import os
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,
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
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
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
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
import logging
import sys
import textwrap
-from itertools import izip
import portage
from portage import os
from portage.output import bold, colorize, darkgreen, green
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
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
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:
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()
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):
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)
# 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)
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
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
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)
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) + \
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)
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(
import codecs
import logging
import stat
-from itertools import izip
def _src_uri_validate(cpv, eapi, src_uri):
"""
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
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
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:
import re, shutil, stat, errno, copy, subprocess
import logging
import sys
-from itertools import izip
try:
import cPickle as pickle
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):
from portage.tests import TestCase
from portage.env.config import PortageModulesFile
from tempfile import mkstemp
-from itertools import izip
class PortageModulesFileTestCase(TestCase):
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
import codecs
import errno
-import itertools
import logging
import sys
try:
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")