From 948d655ba985247099b31c1fedc0a265fe6991dc Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 3 Nov 2007 13:12:49 +0000 Subject: [PATCH] Merged from trunk 8356:8387 | 8357 | In the 'there are no ebuilds to satisfy "foo"' message, | | zmedico | discard null/ from failed cpv_expand category expansion. | | 8358 | Optimize merge order to try and select nodes that only have | | zmedico | unsatisfied PDEPEND slightly earlier. This solves a problem | | | with xorg-server being merged too early during an all binary | | | install (since DEPEND is ignored for binaries), triggering | | | built_with_use() calls to fail as reported in bug #189966. | | | Since DEPEND is discarded in cases like this, it is | | | important to exploit the difference between PDEPEND and | | | RDEPEND in order to optimize merge order. Without this | | | optimization, the merge order is technically correct, but | | | not as optimal as it should be and has lots of potential to | | | trigger issues with built_with_use() or similar things that | | | require better optimization of merge order. | | 8359 | Collapse 2 identical code hunks into 1. | | zmedico | | | 8360 | Fix ignore_priority logic in depgraph.altlist() in order to | | zmedico | handle some cases where it was possible for nodes to be | | | selected without their PDEPENDs being propperly added to the | | | asap_nodes list. | | 8366 | Make sure vardbapi.cp_list() always sorts the results. | | zmedico | | | 8373 | Bug #197594 - Document FEATURES="lmirror". | | zmedico | | | 8379 | Return early from config.getMaskAtom() as soon as a matching | | zmedico | unmask atom is found. | | 8381 | Make portdbapi.gvisible() use portdbapi._aux_cache_keys for | | zmedico | metadata pulls. | | 8383 | Sort scanlist and ebuildlist to ensure that repoman always | | zmedico | processes packages in a predictable order. | | 8385 | In portage.fetch(), condense digest check output to a single | | zmedico | line for all digests. | | 8387 | TODO: Make update_config_files() handle slotmove commands | | zmedico | for SLOT atoms. | svn path=/main/branches/prefix/; revision=8388 --- bin/repoman | 2 ++ man/make.conf.5 | 4 +++ pym/_emerge/__init__.py | 50 +++++++++++++++++++++-------------- pym/portage/__init__.py | 12 ++++----- pym/portage/dbapi/porttree.py | 2 +- pym/portage/dbapi/vartree.py | 2 +- pym/portage/update.py | 1 + 7 files changed, 44 insertions(+), 29 deletions(-) diff --git a/bin/repoman b/bin/repoman index a596f2314..97a8d3b5c 100755 --- a/bin/repoman +++ b/bin/repoman @@ -642,6 +642,7 @@ elif repolevel==3: if catdir not in repoman_settings.categories: caterror(catdir) scanlist.append(catdir+"/"+reposplit[-1]) +scanlist.sort() profiles={} descfile=portdir+"/profiles/profiles.desc" @@ -873,6 +874,7 @@ for x in scanlist: fails["EAPI.unsupported"].append(os.path.join(x, y)) continue ebuild_metadata[pf] = myaux + ebuildlist.sort() if len(ebuild_metadata) != len(ebuildlist): # If we can't access all the metadata then it's totally unsafe to diff --git a/man/make.conf.5 b/man/make.conf.5 index c612b89fd..b628a741b 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -207,6 +207,10 @@ prior to each build. Due to lack of proper cleanup, this feature can interfere with normal emerge operation and therefore it should not be left enabled for more than a short period of time. .TP +.B lmirror +When \fImirror\fR is enabled in \fBFEATURES\fR, fetch files even +when \fImirror\fR is also in the \fBebuild\fR(5) \fBRESTRICT\fR variable. +.TP .B metadata\-transfer Automatically perform a metadata transfer when `emerge \-\-sync` is run. .TP diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 6c8d0b48d..28750a2e7 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2033,6 +2033,8 @@ class depgraph(object): xinfo = '"%s"' % atom if arg: xinfo='"%s"' % arg + # Discard null/ from failed cpv_expand category expansion. + xinfo = xinfo.replace("null/", "") if myparent: xfrom = '(dependency required by '+ \ green('"%s"' % myparent[2]) + \ @@ -2710,7 +2712,7 @@ class depgraph(object): break ignore_priority_soft_range = [None] ignore_priority_soft_range.extend( - xrange(DepPriority.MIN, DepPriority.SOFT + 1)) + xrange(DepPriority.MIN, DepPriority.MEDIUM_SOFT + 1)) tree_mode = "--tree" in self.myopts # Tracks whether or not the current iteration should prefer asap_nodes # if available. This is set to False when the previous iteration @@ -2739,6 +2741,7 @@ class depgraph(object): while not mygraph.empty(): selected_nodes = None + ignore_priority = None if prefer_asap and asap_nodes: """ASAP nodes are merged before their soft deps.""" asap_nodes = [node for node in asap_nodes \ @@ -2775,6 +2778,7 @@ class depgraph(object): (accept_root_node or ignore_priority is None): # settle for a root node selected_nodes = [nodes[0]] + if not selected_nodes: nodes = get_nodes(ignore_priority=DepPriority.MEDIUM) if nodes: @@ -2818,6 +2822,14 @@ class depgraph(object): if selected_nodes: break + # If any nodes have been selected here, it's always + # possible that anything up to a MEDIUM_SOFT priority + # relationship has been ignored. This state is recorded + # in ignore_priority so that relevant nodes will be + # added to asap_nodes when appropriate. + if selected_nodes: + ignore_priority = DepPriority.MEDIUM_SOFT + if prefer_asap and asap_nodes and not selected_nodes: # We failed to find any asap nodes to merge, so ignore # them for the next iteration. @@ -2830,25 +2842,23 @@ class depgraph(object): accept_root_node = True continue - if selected_nodes and ignore_priority > DepPriority.SOFT: - # Try to merge ignored medium deps as soon as possible. - for node in selected_nodes: - children = set(mygraph.child_nodes(node)) - soft = children.difference( - mygraph.child_nodes(node, - ignore_priority=DepPriority.SOFT)) - medium_soft = children.difference( - mygraph.child_nodes(node, - ignore_priority=DepPriority.MEDIUM_SOFT)) - medium_soft.difference_update(soft) - for child in medium_soft: - if child in selected_nodes: - continue - if child in asap_nodes: - continue - # TODO: Try harder to make these nodes get - # merged absolutely as soon as possible. - asap_nodes.append(child) + if selected_nodes and ignore_priority > DepPriority.SOFT: + # Try to merge ignored medium deps as soon as possible. + for node in selected_nodes: + children = set(mygraph.child_nodes(node)) + soft = children.difference( + mygraph.child_nodes(node, + ignore_priority=DepPriority.SOFT)) + medium_soft = children.difference( + mygraph.child_nodes(node, + ignore_priority=DepPriority.MEDIUM_SOFT)) + medium_soft.difference_update(soft) + for child in medium_soft: + if child in selected_nodes: + continue + if child in asap_nodes: + continue + asap_nodes.append(child) if not selected_nodes: if not myblockers.is_empty(): diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 0f5443298..5ba87e64e 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1887,14 +1887,10 @@ class config(object): for x in mask_atoms: if not match_from_list(x, pkg_list): continue - masked = True if unmask_atoms: for y in unmask_atoms: if match_from_list(y, pkg_list): - masked = False - break - if not masked: - continue + return None return x return None @@ -3188,8 +3184,10 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", else: eout = portage.output.EOutput() eout.quiet = mysettings.get("PORTAGE_QUIET", None) == "1" - for x_key in mydigests[myfile]: - eout.ebegin("%s %s ;-)" % (myfile, x_key)) + digests = mydigests.get(myfile) + if digests: + eout.ebegin("%s %s ;-)" % \ + (myfile, " ".join(sorted(digests)))) eout.eend(0) fetched=2 break diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 230c96cb6..e6238700d 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -709,7 +709,7 @@ class portdbapi(dbapi): if mylist is None: return [] newlist=[] - aux_keys = ["IUSE", "KEYWORDS", "LICENSE", "EAPI", "SLOT"] + aux_keys = self._aux_cache_keys metadata = {} local_config = self.mysettings.local_config for mycpv in mylist: diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 05c562635..393896982 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -368,8 +368,8 @@ class vardbapi(dbapi): if len(mysplit) > 1: if ps[0] == mysplit[1]: returnme.append(mysplit[0]+"/"+x) + self._cpv_sort_ascending(returnme) if use_cache: - self._cpv_sort_ascending(returnme) self.cpcache[mycp] = [mystat, returnme[:]] elif self.cpcache.has_key(mycp): del self.cpcache[mycp] diff --git a/pym/portage/update.py b/pym/portage/update.py index 9a5b78ba3..ec99ea03e 100644 --- a/pym/portage/update.py +++ b/pym/portage/update.py @@ -183,6 +183,7 @@ def update_config_files(config_root, protect, protect_mask, update_iter): continue worldlist = grabfile(os.path.join(config_root, WORLD_FILE)) + # TODO: handle slotmove commands for SLOT stoms for update_cmd in update_iter: if update_cmd[0] == "move": old_value, new_value = update_cmd[1], update_cmd[2] -- 2.26.2