From 087d08ae5cc7c246d13da1c6504c07d446bf4278 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Thu, 5 Jul 2007 06:49:48 +0000 Subject: Remove fallback imports for set(), and note minimum requirement of python-2.4 svn path=/main/trunk/; revision=7157 --- RELEASE-NOTES | 2 ++ pym/emerge/__init__.py | 5 ++--- pym/portage/__init__.py | 2 -- pym/portage/cache/metadata_overlay.py | 2 -- pym/portage/cache/util.py | 2 -- pym/portage/cache/volatile.py | 2 -- pym/portage/data.py | 3 --- pym/portage/dbapi/vartree.py | 7 ++++--- pym/portage/getbinpkg.py | 3 --- pym/portage/manifest.py | 6 ++---- pym/portage/util.py | 3 --- 11 files changed, 10 insertions(+), 27 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7d837e0a2..030ebfd1f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,6 +4,8 @@ Features/major bugfixes are listed in NEWS portage-2.2 ================================== +* Portage now requires >=python-2.4, but doesn't need pycrypto anymore if + >=python-2.5 is installed and openssl supports the rmd160 hash. * The python namespace for portage has been sanitized, all portage related code is now contained within the portage namespace. External script should be updated accordingly, though links exist for backward compability. diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index b84edddbc..00ee4c15a 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -51,8 +51,6 @@ from portage.data import secpass from portage.util import normalize_path as normpath from portage.util import writemsg -if not hasattr(__builtins__, "set"): - from sets import Set as set from itertools import chain, izip from UserDict import DictMixin @@ -3353,6 +3351,7 @@ class MergeTask(object): def merge(self, mylist, favorites, mtimedb): from portage.elog import elog_process + from portage.elog.filtering import filter_mergephases failed_fetches = [] fetchonly = "--fetchonly" in self.myopts or \ "--fetch-all-uri" in self.myopts @@ -3585,7 +3584,7 @@ class MergeTask(object): del pkgsettings["PORTAGE_BINPKG_TMPFILE"] if retval != os.EX_OK or \ "--buildpkgonly" in self.myopts: - elog_process(pkg_key, pkgsettings) + elog_process(pkg_key, pkgsettings, phasefilter=filter_mergephases) if retval != os.EX_OK: return retval bintree = self.trees[myroot]["bintree"] diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 4494af05f..4f7f89f51 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -28,8 +28,6 @@ try: from time import sleep from random import shuffle import UserDict - if getattr(__builtins__, "set", None) is None: - from sets import Set as set from itertools import chain, izip except ImportError, e: sys.stderr.write("\n\n") diff --git a/pym/portage/cache/metadata_overlay.py b/pym/portage/cache/metadata_overlay.py index 2aaa7e07c..13d12787e 100644 --- a/pym/portage/cache/metadata_overlay.py +++ b/pym/portage/cache/metadata_overlay.py @@ -3,8 +3,6 @@ # $Header: $ import time -if not hasattr(__builtins__, "set"): - from sets import Set as set from portage.cache import template from portage.cache.cache_errors import CacheCorruption from portage.cache.flat_hash import database as db_rw diff --git a/pym/portage/cache/util.py b/pym/portage/cache/util.py index 3c6bdb70f..870e98873 100644 --- a/pym/portage/cache/util.py +++ b/pym/portage/cache/util.py @@ -3,8 +3,6 @@ # License: GPL2 # $Id$ -if not hasattr(__builtins__, "set"): - from sets import Set as set from itertools import chain from portage.cache import cache_errors diff --git a/pym/portage/cache/volatile.py b/pym/portage/cache/volatile.py index 12c23dd56..eb4f1eb9b 100644 --- a/pym/portage/cache/volatile.py +++ b/pym/portage/cache/volatile.py @@ -3,8 +3,6 @@ # $Header: $ import copy -if not hasattr(__builtins__, "set"): - from sets import Set as set from portage.cache import template class database(template.database): diff --git a/pym/portage/data.py b/pym/portage/data.py index d327af726..958be3ca6 100644 --- a/pym/portage/data.py +++ b/pym/portage/data.py @@ -3,9 +3,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -if not hasattr(__builtins__, "set"): - from sets import Set as set - import os, sys, pwd, grp from portage.util import writemsg from portage.output import green,red diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 910f3d3c5..2df2f841f 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -9,7 +9,6 @@ from portage.data import portage_gid, portage_uid, secpass from portage.dbapi import dbapi from portage.dep import dep_getslot, use_reduce, paren_reduce, isvalidatom, \ isjustname, dep_getkey, match_from_list -from portage.elog import elog_process from portage.exception import InvalidPackageName, InvalidAtom, \ FileNotFound, PermissionDenied, UnsupportedAPIException from portage.locks import lockdir, unlockdir @@ -24,7 +23,9 @@ from portage import listdir, dep_expand, flatten, key_expand, \ doebuild_environment, doebuild, env_update, \ abssymlink, movefile, _movefile, bsd_chflags +from portage.elog import elog_process from portage.elog.messages import ewarn +from portage.elog.filtering import filter_mergephases, filter_unmergephases import os, sys, stat, errno, commands, copy, time from itertools import izip @@ -1104,7 +1105,7 @@ class dblink(object): try: if myebuildpath: # process logs created during pre/postrm - elog_process(self.mycpv, self.settings) + elog_process(self.mycpv, self.settings, phasefilter=filter_unmergephases) if retval == os.EX_OK: doebuild(myebuildpath, "cleanrm", self.myroot, self.settings, tree="vartree", @@ -2106,7 +2107,7 @@ class dblink(object): retval = self.treewalk(mergeroot, myroot, inforoot, myebuild, cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes) # Process ebuild logfiles - elog_process(self.mycpv, self.settings) + elog_process(self.mycpv, self.settings, phasefilter=filter_mergephases) if retval == os.EX_OK and "noclean" not in self.settings.features: if myebuild is None: myebuild = os.path.join(inforoot, self.pkg + ".ebuild") diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py index c16570c46..1adab1b51 100644 --- a/pym/portage/getbinpkg.py +++ b/pym/portage/getbinpkg.py @@ -3,9 +3,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -if not hasattr(__builtins__, "set"): - from sets import Set as set - from portage.output import red, yellow, green import htmllib,HTMLParser,formatter,sys,os,portage.xpak,time,tempfile,base64,urllib2 diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 61af21d94..3116922b7 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -2,9 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -import errno, os, sets -if not hasattr(__builtins__, "set"): - from sets import Set as set +import errno, os import portage.versions, portage.const from portage.checksum import * @@ -113,7 +111,7 @@ class Manifest(object): self.hashes.append("size") if manifest1_compat: self.hashes.extend(portage.const.MANIFEST1_HASH_FUNCTIONS) - self.hashes = sets.Set(self.hashes) + self.hashes = set(self.hashes) for t in portage.const.MANIFEST2_IDENTIFIERS: self.fhashdict[t] = {} self.compat = manifest1_compat diff --git a/pym/portage/util.py b/pym/portage/util.py index c2d109ae6..de0cb80b7 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -13,9 +13,6 @@ try: except ImportError: import pickle as cPickle -if not hasattr(__builtins__, "set"): - from sets import Set as set - noiselimit = 0 def writemsg(mystr,noiselevel=0,fd=None): -- cgit v1.2.3-1-g7c22