From: Fabian Groffen Date: Sun, 24 Dec 2006 10:04:14 +0000 (-0000) Subject: Merged from trunk 5366:5372 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=02f4d768a75af0502c538c4b46502a65aa56d349;p=portage.git Merged from trunk 5366:5372 For bug #158931, add some release notes to explain performance penalties for dependency calculations. For forward compatibility, make metadata_overlay pass any additional positional and keyword parameters into the super constructor. Manpage fix for bug # 158983, thanks to Fabio Correa for the patch (WarnerBro) More code cleanup, packagetree appears to be completely unused, so lets remove it in favor of inheriting from object (WarnerBro) Docstrings for doebuild (WarnerBro) cptot appears to be unused, punting it along with this commented out function, it appears to be unused as well. (WarnerBro) svn path=/main/branches/prefix/; revision=5375 --- diff --git a/NEWS b/NEWS index 9e466b550..6d369961e 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ portage-2.1.2 * Dependencies can be satisfied by installed packages that do not have matching ebuilds in the portage tree or overlay. * Emerge automatically ignores blockers that are made irrelevant by an upgrade. +* Emerge supports "reverse blocker detection" which means that the blockers of + installed packages will always be respected. * Emerge builds a complete dependency graph in order to ensure correct merge order and detection of circular dependencies. * The world and system sets allow automatic update of all installed slots. diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c15f922ba..26d95a9cd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -4,6 +4,12 @@ Features/major bugfixes are listed in NEWS portage-2.1.2 ================================== +* Depending on the number of packages installed, users may notice a difference + in the time taken for dependency calculations. This performance penalty is + due to the addition of important new features which include the ability to + detect reverse blockers, the building of a complete dependency graph, and the + ability to use installed packages to satisify dependencies even after their + ebuilds have been removed from the portage tree. * emerge does not necessarily update build time dependencies that are not strictly required. See the --with-bdeps option in the emerge(1) man page. diff --git a/man/emerge.1 b/man/emerge.1 index f2bb05cc4..61a3bfeea 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -81,7 +81,7 @@ later updating. Cleans the system by removing packages that will not affect the functionality of the system. The arguments can be \fIebuilds\fR, \fIsets\fR, or \fIdependencies\fR. For example, \fBemerge -clean binutils\fR cleans out old versions of binutils; +--clean binutils\fR cleans out old versions of binutils; \fBemerge \-\-clean net\-www/mozilla\-0.9.9\-r2\fR cleans out that specific version of Mozilla. This is generally safe to use. \fBNote that\fR \-\-clean \fBdoes not remove unslotted packages.\fR diff --git a/pym/cache/metadata_overlay.py b/pym/cache/metadata_overlay.py index 91066fb9c..33d39d2ae 100644 --- a/pym/cache/metadata_overlay.py +++ b/pym/cache/metadata_overlay.py @@ -14,8 +14,12 @@ class database(template.database): serialize_eclasses = False - def __init__(self, location, label, auxdbkeys, **config): - super(database, self).__init__(location, label, auxdbkeys) + def __init__(self, location, label, auxdbkeys, db_rw=db_rw, db_ro=db_ro, + *args, **config): + super_config = config.copy() + super_config.pop("gid", None) + super(database, self).__init__(location, label, auxdbkeys, + *args, **super_config) self.db_rw = db_rw(location, label, auxdbkeys, **config) self.commit = self.db_rw.commit self.autocommits = self.db_rw.autocommits diff --git a/pym/portage.py b/pym/portage.py index 9d729fce1..17df76f59 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3123,6 +3123,54 @@ _doebuild_manifest_checked = None def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, fetchonly=0, cleanup=0, dbkey=None, use_cache=1, fetchall=0, tree=None, mydbapi=None, vartree=None, prev_mtimes=None): + + """ + Wrapper function that invokes specific ebuild phases through the spawning + of ebuild.sh + + @param myebuild: name of the ebuild to invoke the phase on (CPV) + @type myebuild: String + @param mydo: Phase to run + @type mydo: String + @param myroot: $ROOT (usually '/', see man make.conf) + @type myroot: String + @param mysettings: Portage Configuration + @type mysettings: instance of portage.config + @param debug: Turns on various debug information (eg, debug for spawn) + @type debug: Boolean + @param listonly: Used to wrap fetch(); passed such that fetch only lists files required. + @type listonly: Boolean + @param fetchonly: Used to wrap fetch(); passed such that files are only fetched (no other actions) + @type fetchonly: Boolean + @param cleanup: Passed to prepare_build_dirs (TODO: what does it do?) + @type cleanup: Boolean + @param dbkey: A dict (usually keys and values from the depend phase, such as KEYWORDS, USE, etc..) + @type dbkey: Dict or String + @param use_cache: Enables the cache + @type use_cache: Boolean + @param fetchall: Used to wrap fetch(), fetches all URI's (even ones invalid due to USE conditionals) + @type fetchall: Boolean + @param tree: Which tree to use ('vartree','porttree','bintree', etc..), defaults to 'porttree' + @type tree: String + @param mydbapi: a dbapi instance to pass to various functions; this should be a portdbapi instance. + @type mydbapi: portdbapi instance + @param vartree: A instance of vartree; used for aux_get calls, defaults to db[myroot]['vartree'] + @type vartree: vartree instance + @param prev_mtimes: A dict of { filename:mtime } keys used by merge() to do config_protection + @type prev_mtimes: dictionary + @rtype: Boolean + @returns: + 1. 0 for success + 2. 1 for error + + Most errors have an accompanying error message. + + listonly and fetchonly are only really necessary for operations involving 'fetch' + prev_mtimes are only necessary for merge operations. + Other variables may not be strictly required, many have defaults that are set inside of doebuild. + + """ + if not tree: writemsg("Warning: tree not specified to doebuild\n") tree = "porttree" @@ -4357,41 +4405,6 @@ def getmaskingstatus(mycpv, settings=None, portdb=None): rValue.append(kmask+" keyword") return rValue -class packagetree: - def __init__(self,virtual,clone=None): - if clone: - self.tree=clone.tree.copy() - self.populated=clone.populated - self.virtual=clone.virtual - self.dbapi=None - else: - self.tree={} - self.populated=0 - self.virtual=virtual - self.dbapi=None - - def resolve_key(self,mykey): - return key_expand(mykey, mydb=self.dbapi, settings=self.settings) - - def dep_nomatch(self,mypkgdep): - mykey=dep_getkey(mypkgdep) - nolist=self.dbapi.cp_list(mykey) - mymatch=self.dbapi.match(mypkgdep) - if not mymatch: - return nolist - for x in mymatch: - if x in nolist: - nolist.remove(x) - return nolist - - def depcheck(self,mycheck,use="yes",myusesplit=None): - return dep_check(mycheck,self.dbapi,use=use,myuse=myusesplit) - - def populate(self): - "populates the tree with values" - populated=1 - pass - class portagetree: def __init__(self, root="/", virtual=None, clone=None, settings=None): @@ -4579,16 +4592,6 @@ class fakedbapi(dbapi): if not mycpv in self.cpdict[mycp]: self.cpdict[mycp].append(mycpv) - #def cpv_virtual(self,oldcpv,newcpv): - # """Maps a cpv to the list of available packages.""" - # mycp=cpv_getkey(newcpv) - # self.cpvdict[newcpv]=1 - # if not self.virtdict.has_key(mycp): - # self.virtdict[mycp]=[] - # if not mycpv in self.virtdict[mycp]: - # self.virtdict[mycp].append(oldcpv) - # cpv_remove(oldcpv) - def cpv_remove(self,mycpv): """Removes a cpv from the list of available packages.""" self._clear_cache() @@ -4676,7 +4679,6 @@ class bindbapi(fakedbapi): self.bintree.populate() return fakedbapi.cpv_all(self) -cptot=0 class vardbapi(dbapi): def __init__(self, root, categories=None, settings=None, vartree=None): self.root = root[:] @@ -5063,7 +5065,7 @@ class vardbapi(dbapi): write_atomic(cpath, str(counter)) return counter -class vartree(packagetree): +class vartree(object): "this tree will scan a var/db/pkg database located at root (passed to init)" def __init__(self, root="/", virtual=None, clone=None, categories=None, settings=None): @@ -5861,7 +5863,7 @@ class portdbapi(dbapi): newlist.append(mycpv) return newlist -class binarytree(packagetree): +class binarytree(object): "this tree scans for a list of all packages available in PKGDIR" def __init__(self, root, pkgdir, virtual=None, settings=None, clone=None): if clone: