* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-04 15:57 zmedico
0 siblings, 0 replies; 136+ messages in thread
From: zmedico @ 2011-02-04 15:57 UTC (permalink / raw
To: gentoo-commits
commit: d7d6c75fdcdc3222ea89da4db16a636c8c493ea3
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 15:41:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 15:54:55 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7d6c75fdcdc3222ea89da4db16a636c8c493ea3
depgraph: don't drop deps in _add_dep
This will fix bug #353613. We remove a hunk of code that was meant
to limit recursion, but is obsolete an buggy. The recursion limiting
is now handled by _add_pkg and the _ignored_deps stack.
---
pym/_emerge/depgraph.py | 29 -----------------------------
1 files changed, 0 insertions(+), 29 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8b801f5..5380de1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -703,8 +703,6 @@ class depgraph(object):
dep_pkg = dep.child
existing_node = self._dynamic_config._slot_pkg_map[
dep.root].get(dep_pkg.slot_atom)
- if existing_node is not dep_pkg:
- existing_node = None
if not dep_pkg:
if dep.priority.optional:
@@ -753,33 +751,6 @@ class depgraph(object):
noiselevel=-1, level=logging.DEBUG)
return 0
- # In some cases, dep_check will return deps that shouldn't
- # be proccessed any further, so they are identified and
- # discarded here. Try to discard as few as possible since
- # discarded dependencies reduce the amount of information
- # available for optimization of merge order.
- if dep.priority.satisfied and \
- dep.priority.satisfied.visible and \
- not dep_pkg.installed and \
- not (existing_node or recurse):
- myarg = None
- if dep.root == self._frozen_config.target_root:
- try:
- myarg = next(self._iter_atoms_for_pkg(dep_pkg))
- except StopIteration:
- pass
- except portage.exception.InvalidDependString:
- if not dep_pkg.installed:
- # This shouldn't happen since the package
- # should have been masked.
- raise
- if not myarg:
- # Existing child selection may not be valid unless
- # it's added to the graph immediately, since "complete"
- # mode may select a different child later.
- dep.child = None
- self._dynamic_config._ignored_deps.append(dep)
- return 1
if not self._add_pkg(dep_pkg, dep):
return 0
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-04 17:47 zmedico
0 siblings, 0 replies; 136+ messages in thread
From: zmedico @ 2011-02-04 17:47 UTC (permalink / raw
To: gentoo-commits
commit: 320df213972f7ce50e7f2379a3a0d7d0bbbef051
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 17:41:30 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 17:46:24 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=320df213972f7ce50e7f2379a3a0d7d0bbbef051
depgraph: make downgrades trigger complete graph
It's common for downgrades to break dependencies, as in bug #353613, so
automatically trigger complete graph mode when a downgrade is found.
---
pym/_emerge/depgraph.py | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5380de1..7b74a26 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3408,8 +3408,27 @@ class depgraph(object):
return 1
if "complete" not in self._dynamic_config.myparams:
- # Skip this to avoid consuming enough time to disturb users.
- return 1
+ # Automatically enable complete mode if there are any
+ # downgrades, since they often break dependencies
+ # (like in bug #353613).
+ have_downgrade = False
+ for node in self._dynamic_config.digraph:
+ if not isinstance(node, Package) or \
+ node.operation != "merge":
+ continue
+ vardb = self._frozen_config.roots[
+ node.root].trees["vartree"].dbapi
+ inst_pkg = vardb.match_pkgs(node.slot_atom)
+ if inst_pkg and inst_pkg[0] > node:
+ have_downgrade = True
+ break
+
+ if have_downgrade:
+ self._dynamic_config.myparams["complete"] = True
+ else:
+ # Skip complete graph mode, in order to avoid consuming
+ # enough time to disturb users.
+ return 1
self._load_vdb()
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-05 3:37 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-05 3:37 UTC (permalink / raw
To: gentoo-commits
commit: bcbf792209142e84e164991dc13843a3cb471e9f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 5 03:20:37 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 5 03:37:29 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcbf7922
get_dep_chain: add "set" node type
---
pym/_emerge/depgraph.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7b74a26..d41ab82 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2213,7 +2213,11 @@ class depgraph(object):
traversed_nodes.add(node)
if isinstance(node, DependencyArg):
- dep_chain.append((_unicode_decode("%s") % (node,), "argument"))
+ if self._dynamic_config.digraph.parent_nodes(node):
+ node_type = "set"
+ else:
+ node_type = "argument"
+ dep_chain.append((_unicode_decode("%s") % (node,), node_type))
elif node is not start_node:
for ppkg, patom in all_parents[child]:
@@ -2655,7 +2659,6 @@ class depgraph(object):
# It's redundant to show parent for AtomArg since
# it's the same as 'xinfo' displayed above.
dep_chain = self._get_dep_chain(myparent, atom)
-
for node, node_type in dep_chain:
msg.append('(dependency required by "%s" [%s])' % \
(colorize('INFORM', _unicode_decode("%s") % \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-08 20:48 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-08 20:48 UTC (permalink / raw
To: gentoo-commits
commit: cd02898367a30fd51e013993785b24e2885b6b0d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 8 19:39:41 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 20:46:13 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cd028983
emerge: support ../ path arguments
This will fix bug #354141.
---
pym/_emerge/depgraph.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d41ab82..fe706af 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1638,7 +1638,8 @@ class depgraph(object):
# Queue these up since it's most efficient to handle
# multiple files in a single iter_owners() call.
lookup_owners.append(x)
- elif x.startswith("." + os.path.sep):
+ elif x.startswith("." + os.sep) or \
+ x.startswith(".." + os.sep):
f = os.path.abspath(x)
if not f.startswith(myroot):
portage.writemsg(("\n\n!!! '%s' (resolved from '%s') does not start with" + \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 4:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 4:31 UTC (permalink / raw
To: gentoo-commits
commit: fe1da139518296dbd31c8d55c6baca065ace0017
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 11 08:57:11 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 04:25:00 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe1da139
depgraph: avoid reinstall of identical binpkg
This will fix bug #354441.
---
pym/_emerge/depgraph.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fe706af..004103c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2977,6 +2977,7 @@ class depgraph(object):
existing_node = None
myeb = None
rebuilt_binaries = 'rebuilt_binaries' in self._dynamic_config.myparams
+ usepkg = "--usepkg" in self._frozen_config.myopts
usepkgonly = "--usepkgonly" in self._frozen_config.myopts
empty = "empty" in self._dynamic_config.myparams
selective = "selective" in self._dynamic_config.myparams
@@ -3078,6 +3079,20 @@ class depgraph(object):
# to a KEYWORDS mask. See bug #252167.
if pkg.type_name != "ebuild" and matched_packages:
+ # Don't re-install a binary package that is
+ # identical to the currently installed package
+ # (see bug #354441).
+ identical_binary = False
+ if usepkg and pkg.installed:
+ for selected_pkg in matched_packages:
+ if selected_pkg.type_name == "binary" and \
+ selected_pkg.cpv == pkg.cpv and \
+ selected_pkg.metadata.get('BUILD_TIME') == \
+ pkg.metadata.get('BUILD_TIME'):
+ identical_binary = True
+ break
+
+ if not identical_binary:
# If the ebuild no longer exists or it's
# keywords have been dropped, reject built
# instances (installed or binary).
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 4:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 4:31 UTC (permalink / raw
To: gentoo-commits
commit: 315a6d6872d0f4b6a36844de97fd172bbec3a90d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 12 06:09:30 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 04:25:15 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=315a6d68
depgraph: don't distort edges for virtuals
In _add_pkg_dep_string(), _add_pkg() was called with generated
Dependency instances that created fake/distorted edges in the
graph for new-style virtuals (similar to those that were fixed
in commit 5b16e0d800f34dc90cdd8c505172ad16b97f0af4). Now there
won't be any such distorted edges.
---
pym/_emerge/depgraph.py | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fc84be6..22d9314 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1296,21 +1296,31 @@ class depgraph(object):
# by dep_zapdeps. We preserve actual parent/child relationships
# here in order to avoid distorting the dependency graph like
# <=portage-2.1.6.x did.
- for virt_pkg, atoms in selected_atoms.items():
+ while selected_atoms:
+
+ # Since _select_atoms currently doesn't return parent
+ # info for recursively traversed virtuals, the parent
+ # is not known here. However, this package may have
+ # already been added to graph above, so we add packages
+ # with parents first. This way, parents are already
+ # recorded before a given package is added, which allows
+ # us to avoid triggering a slot conflict before the
+ # parent is known.
+ for virt_pkg, atoms in selected_atoms.items():
+ try:
+ if self._dynamic_config.digraph.parent_nodes(virt_pkg):
+ break
+ except KeyError:
+ pass
+
+ selected_atoms.pop(virt_pkg)
if debug:
writemsg_level("Candidates: %s: %s\n" % \
(virt_pkg.cpv, [str(x) for x in atoms]),
noiselevel=-1, level=logging.DEBUG)
- # Just assume depth + 1 here for now, though it's not entirely
- # accurate since multilple levels of indirect virtual deps may
- # have been traversed. The _add_pkg call will reset the depth to
- # 0 if this package happens to match an argument.
- if not self._add_pkg(virt_pkg,
- Dependency(atom=Atom('=' + virt_pkg.cpv),
- depth=(depth + 1), parent=pkg, priority=dep_priority.copy(),
- root=dep_root)):
+ if not self._add_pkg(virt_pkg, None):
return 0
for atom, child in self._minimize_children(
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 4:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 4:31 UTC (permalink / raw
To: gentoo-commits
commit: 04fcd55e912d8278c55ab64312867ae993bcef16
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 09:06:39 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 04:27:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04fcd55e
depgraph: make empty param imply deep = True
This won't change the existing depgraph behavior, but it will allow
logic to be simplified in some cases such that solely the deep param
needs to be consulted (rather than needing to consult both empty and
deep params).
---
pym/_emerge/create_depgraph_params.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 375332e..454363e 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -29,15 +29,16 @@ def create_depgraph_params(myopts, myaction):
"--noreplace" in myopts or \
myopts.get("--selective", "n") != "n":
myparams["selective"] = True
- if "--emptytree" in myopts:
- myparams["empty"] = True
- myparams.pop("selective", None)
if "--nodeps" in myopts:
myparams.pop("recurse", None)
if "--deep" in myopts:
myparams["deep"] = myopts["--deep"]
if "--complete-graph" in myopts:
myparams["complete"] = True
+ if "--emptytree" in myopts:
+ myparams["empty"] = True
+ myparams["deep"] = True
+ myparams.pop("selective", None)
rebuilt_binaries = myopts.get('--rebuilt-binaries')
if rebuilt_binaries is True or \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 4:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 4:31 UTC (permalink / raw
To: gentoo-commits
commit: 9792af073756c3d6586d673b173aac16990744c5
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 11:13:34 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 04:28:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9792af07
depgraph: tweak depth calculation for virtuals
Recursively traversed virtual dependencies, and their direct
dependencies, are considered to have the same depth as direct
dependencies.
---
pym/_emerge/depgraph.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d817b1d..975ae0c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1369,8 +1369,10 @@ class depgraph(object):
# none visible, so use highest
mypriority.satisfied = inst_pkgs[0]
+ # Dependencies of virtuals are considered to have the
+ # same depth as the virtual itself.
if not self._add_dep(Dependency(atom=atom,
- blocker=atom.blocker, child=child, depth=virt_pkg.depth,
+ blocker=atom.blocker, child=child, depth=virt_dep.depth,
parent=virt_pkg, priority=mypriority, root=dep_root),
allow_unsatisfied=allow_unsatisfied):
return 0
@@ -2198,6 +2200,13 @@ class depgraph(object):
if parent is None:
selected_atoms = mycheck[1]
else:
+ # Recursively traversed virtual dependencies, and their
+ # direct dependencies, are considered to have the same
+ # depth as direct dependencies.
+ if parent.depth is None:
+ virt_depth = None
+ else:
+ virt_depth = parent.depth + 1
chosen_atom_ids = frozenset(id(atom) for atom in mycheck[1])
selected_atoms = OrderedDict()
node_stack = [(parent, None, None)]
@@ -2216,9 +2225,10 @@ class depgraph(object):
else:
# virtuals only have runtime deps
node_priority = self._priority(runtime=True)
+
k = Dependency(atom=parent_atom,
blocker=parent_atom.blocker, child=node,
- depth=node.depth, parent=node_parent,
+ depth=virt_depth, parent=node_parent,
priority=node_priority, root=node.root)
child_atoms = []
@@ -2239,7 +2249,6 @@ class depgraph(object):
# record this as an unsatisfied dependency
# when necessary.
continue
- child_node.depth = node.depth + 1
node_stack.append((child_node, node, child_atom))
return selected_atoms
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 4:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 4:31 UTC (permalink / raw
To: gentoo-commits
commit: eca171c182113f6b45e0ef7efccbf70e193c1882
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 03:28:07 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 04:30:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eca171c1
get_dep_chain: prefer parents in merge list
This will fix bug #354747.
---
pym/_emerge/depgraph.py | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2257318..1b76f53 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2373,20 +2373,20 @@ class depgraph(object):
# When traversing to parents, prefer arguments over packages
# since arguments are root nodes. Never traverse the same
# package twice, in order to prevent an infinite loop.
+ child = node
selected_parent = None
+ parent_arg = None
+ parent_merge = None
+
for parent in self._dynamic_config.digraph.parent_nodes(node):
if parent in traversed_nodes:
continue
if isinstance(parent, DependencyArg):
- if self._dynamic_config.digraph.parent_nodes(parent):
- selected_parent = parent
- child = node
- else:
- dep_chain.append(
- (_unicode_decode("%s") % (parent,), "argument"))
- selected_parent = None
- break
+ parent_arg = parent
else:
+ if isinstance(parent, Package) and \
+ parent.operation == "merge":
+ parent_merge = parent
if unsatisfied_dependency and node is start_node:
# Make sure that pkg doesn't satisfy parent's dependency.
# This ensures that we select the correct parent for use
@@ -2396,11 +2396,21 @@ class depgraph(object):
atom_set = InternalPackageSet(initial_atoms=(atom,))
if not atom_set.findAtomForPackage(start_node):
selected_parent = parent
- child = node
break
else:
selected_parent = parent
- child = node
+
+ if parent_merge is not None:
+ # Prefer parent in the merge list (bug #354747).
+ selected_parent = parent_merge
+ elif parent_arg is not None:
+ if self._dynamic_config.digraph.parent_nodes(parent_arg):
+ selected_parent = parent_arg
+ else:
+ dep_chain.append(
+ (_unicode_decode("%s") % (parent,), "argument"))
+ selected_parent = None
+
node = selected_parent
return dep_chain
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 5:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 5:04 UTC (permalink / raw
To: gentoo-commits
commit: 6a4e3f8f2b773c69173a4c9b62f03bb8609a49e5
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 04:57:57 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 05:04:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6a4e3f8f
get_dep_chain: fix unsatisfied_dependency logic
Always prefer parents for which the parent atom is unsatisfied by the
child node. This seems to be the intention of the code, though it may
not have behaved correctly due to continuation of the parent loop.
---
pym/_emerge/depgraph.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 1b76f53..160299b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2377,6 +2377,7 @@ class depgraph(object):
selected_parent = None
parent_arg = None
parent_merge = None
+ parent_unsatisfied = None
for parent in self._dynamic_config.digraph.parent_nodes(node):
if parent in traversed_nodes:
@@ -2395,12 +2396,14 @@ class depgraph(object):
if parent is ppkg:
atom_set = InternalPackageSet(initial_atoms=(atom,))
if not atom_set.findAtomForPackage(start_node):
- selected_parent = parent
+ parent_unsatisfied = parent
break
else:
selected_parent = parent
- if parent_merge is not None:
+ if parent_unsatisfied is not None:
+ selected_parent = parent_unsatisfied
+ elif parent_merge is not None:
# Prefer parent in the merge list (bug #354747).
selected_parent = parent_merge
elif parent_arg is not None:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 7:49 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 7:49 UTC (permalink / raw
To: gentoo-commits
commit: e2a03fa52fde97fa2c843982923dac205823ea06
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 06:40:57 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 07:48:24 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2a03fa5
depgraph: ignore fewer deps
This restores some desired logic that was left out of commit
5655b4dcfe5e9dae5e9d6352d791c3d04953baf7.
---
pym/_emerge/depgraph.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 23f45e2..0bb9667 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1299,7 +1299,9 @@ class depgraph(object):
mypriority.satisfied and \
mypriority.satisfied.visible and \
dep.child is not None and \
- not dep.child.installed:
+ not dep.child.installed and \
+ self._dynamic_config._slot_pkg_map[dep.child.root].get(
+ dep.child.slot_atom) is None:
myarg = None
if dep.root == self._frozen_config.target_root:
try:
@@ -1384,7 +1386,9 @@ class depgraph(object):
mypriority.satisfied and \
mypriority.satisfied.visible and \
dep.child is not None and \
- not dep.child.installed:
+ not dep.child.installed and \
+ self._dynamic_config._slot_pkg_map[dep.child.root].get(
+ dep.child.slot_atom) is None:
myarg = None
if dep.root == self._frozen_config.target_root:
try:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 7:49 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 7:49 UTC (permalink / raw
To: gentoo-commits
commit: aec8506a120c4350e20fe015b242f781f80870c2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 05:50:29 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 07:48:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aec8506a
depgraph: --nodeps overrides --deep
---
pym/_emerge/create_depgraph_params.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 454363e..b0b49b3 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -29,8 +29,7 @@ def create_depgraph_params(myopts, myaction):
"--noreplace" in myopts or \
myopts.get("--selective", "n") != "n":
myparams["selective"] = True
- if "--nodeps" in myopts:
- myparams.pop("recurse", None)
+
if "--deep" in myopts:
myparams["deep"] = myopts["--deep"]
if "--complete-graph" in myopts:
@@ -40,6 +39,10 @@ def create_depgraph_params(myopts, myaction):
myparams["deep"] = True
myparams.pop("selective", None)
+ if "--nodeps" in myopts:
+ myparams.pop("recurse", None)
+ myparams.pop("deep", None)
+
rebuilt_binaries = myopts.get('--rebuilt-binaries')
if rebuilt_binaries is True or \
rebuilt_binaries != 'n' and \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 7:49 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 7:49 UTC (permalink / raw
To: gentoo-commits
commit: 5c72bae0306384a0f4e6f3fb67b5d59dba0f6b46
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 06:05:52 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 07:48:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5c72bae0
depgraph: remove redundant "empty" param checks
Since commit 878f166c5a06b0ab6c5a34dd658c878cc7605fe7, empty implies
deep = True, so these checks are redundant.
---
pym/_emerge/depgraph.py | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 160299b..23f45e2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -675,9 +675,8 @@ class depgraph(object):
debug = "--debug" in self._frozen_config.myopts
buildpkgonly = "--buildpkgonly" in self._frozen_config.myopts
nodeps = "--nodeps" in self._frozen_config.myopts
- empty = "empty" in self._dynamic_config.myparams
deep = self._dynamic_config.myparams.get("deep", 0)
- recurse = empty or deep is True or dep.depth <= deep
+ recurse = deep is True or dep.depth <= deep
if dep.blocker:
if not buildpkgonly and \
not nodeps and \
@@ -1056,8 +1055,7 @@ class depgraph(object):
depth = 0
pkg.depth = depth
deep = self._dynamic_config.myparams.get("deep", 0)
- empty = "empty" in self._dynamic_config.myparams
- recurse = empty or deep is True or depth + 1 <= deep
+ recurse = deep is True or depth + 1 <= deep
dep_stack = self._dynamic_config._dep_stack
if "recurse" not in self._dynamic_config.myparams:
return 1
@@ -1116,8 +1114,7 @@ class depgraph(object):
if not pkg.built and \
"--buildpkgonly" in self._frozen_config.myopts and \
- "deep" not in self._dynamic_config.myparams and \
- "empty" not in self._dynamic_config.myparams:
+ "deep" not in self._dynamic_config.myparams:
edepend["RDEPEND"] = ""
edepend["PDEPEND"] = ""
@@ -3615,7 +3612,7 @@ class depgraph(object):
depgraph_sets.sets.update(required_sets[root])
if "remove" not in self._dynamic_config.myparams and \
root == self._frozen_config.target_root and \
- (already_deep or "empty" in self._dynamic_config.myparams):
+ already_deep:
remaining_args.difference_update(depgraph_sets.sets)
if not remaining_args and \
not self._dynamic_config._ignored_deps and \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 7:49 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 7:49 UTC (permalink / raw
To: gentoo-commits
commit: af62f234174741c03eb74d062be4735a8a589a1c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 07:20:48 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 07:48:41 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af62f234
get_dep_chain: fix broken parent_arg reference
Broken since commit b4f98ec5a1eb2e010a455b19db5bef8d61def241.
---
pym/_emerge/depgraph.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9dff678..17405b0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2411,7 +2411,7 @@ class depgraph(object):
selected_parent = parent_arg
else:
dep_chain.append(
- (_unicode_decode("%s") % (parent,), "argument"))
+ (_unicode_decode("%s") % (parent_arg,), "argument"))
selected_parent = None
node = selected_parent
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 7:49 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 7:49 UTC (permalink / raw
To: gentoo-commits
commit: b6109ecda3fc3785f68931493b0fa3cde68c1f4c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 07:17:04 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 07:48:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b6109ecd
depgraph: normalize indentation
---
pym/_emerge/depgraph.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 0bb9667..9dff678 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1305,9 +1305,9 @@ class depgraph(object):
myarg = None
if dep.root == self._frozen_config.target_root:
try:
- myarg = next(self._iter_atoms_for_pkg(dep.child))
+ myarg = next(self._iter_atoms_for_pkg(dep.child))
except StopIteration:
- pass
+ pass
except InvalidDependString:
if not dep.child.installed:
# This shouldn't happen since the package
@@ -1392,10 +1392,9 @@ class depgraph(object):
myarg = None
if dep.root == self._frozen_config.target_root:
try:
- myarg = next(
- self._iter_atoms_for_pkg(dep.child))
+ myarg = next(self._iter_atoms_for_pkg(dep.child))
except StopIteration:
- pass
+ pass
except InvalidDependString:
if not dep.child.installed:
raise
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 16:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 16:04 UTC (permalink / raw
To: gentoo-commits
commit: b040c7ed4a06632d12f20d2ad88f88f7c3d76461
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 15:29:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 15:59:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b040c7ed
depgraph: fix KeyError in select_atoms
This happens if depstring evaluates to nothing.
---
pym/_emerge/depgraph.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 17405b0..f569b18 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2233,6 +2233,8 @@ class depgraph(object):
raise portage.exception.InvalidDependString(mycheck[1])
if parent is None:
selected_atoms = mycheck[1]
+ elif parent not in atom_graph:
+ selected_atoms = {parent : mycheck[1]}
else:
# Recursively traversed virtual dependencies, and their
# direct dependencies, are considered to have the same
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 16:35 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 16:35 UTC (permalink / raw
To: gentoo-commits
commit: e5b7f24595370642f4e8b9cef38b45e7055745b2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 16:32:32 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 16:34:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e5b7f245
depgraph: --nodeps overrides --complete-graph
---
pym/_emerge/create_depgraph_params.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index b0b49b3..6b97ab7 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -42,6 +42,7 @@ def create_depgraph_params(myopts, myaction):
if "--nodeps" in myopts:
myparams.pop("recurse", None)
myparams.pop("deep", None)
+ myparams.pop("complete", None)
rebuilt_binaries = myopts.get('--rebuilt-binaries')
if rebuilt_binaries is True or \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 16:45 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 16:45 UTC (permalink / raw
To: gentoo-commits
commit: 9a8cf1722153806a758b6c8be33e6e8f01de36c1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 16:43:37 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 16:45:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9a8cf172
depgraph: --deep=0 is equivalent to no deep param
---
pym/_emerge/create_depgraph_params.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 6b97ab7..735f12c 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -30,8 +30,9 @@ def create_depgraph_params(myopts, myaction):
myopts.get("--selective", "n") != "n":
myparams["selective"] = True
- if "--deep" in myopts:
- myparams["deep"] = myopts["--deep"]
+ deep = myopts.get("--deep")
+ if deep is not None and deep != 0:
+ myparams["deep"] = deep
if "--complete-graph" in myopts:
myparams["complete"] = True
if "--emptytree" in myopts:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-14 17:02 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-14 17:02 UTC (permalink / raw
To: gentoo-commits
commit: 89607e7f6ebea3d3ef73471f68d78730402c0c2b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 14 17:00:42 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 14 17:02:18 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=89607e7f
depgraph: fix virtual code to handle unsatisfied
---
pym/_emerge/depgraph.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 271d4bf..7f47117 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1326,7 +1326,7 @@ class depgraph(object):
if not self._add_dep(dep,
allow_unsatisfied=allow_unsatisfied):
return 0
- if is_virt:
+ if is_virt and dep.child is not None:
traversed_virt_pkgs.add(dep.child)
selected_atoms.pop(pkg)
@@ -1408,7 +1408,7 @@ class depgraph(object):
if not self._add_dep(dep,
allow_unsatisfied=allow_unsatisfied):
return 0
- if is_virt:
+ if is_virt and dep.child is not None:
traversed_virt_pkgs.add(dep.child)
if debug:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 0b014fc87708821aa223b29b6ed082cd5d127c85
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 17 10:32:20 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:01:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b014fc8
emerge --sync: display message when cvs fails
---
pym/_emerge/actions.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 505410c..7562430 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2379,6 +2379,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
retval = portage.process.spawn_bash(
"cd %s; exec cvs -z0 -q update -dP" % \
(portage._shell_quote(myportdir),), **spawn_kwargs)
+ writemsg_level("!!! cvs update error; exiting.\n",
+ noiselevel=-1, level=logging.ERROR)
if retval != os.EX_OK:
sys.exit(retval)
dosyncuri = syncuri
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 2c874eab886e1ca462ef79141496bf451ffd2614
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 18 12:05:16 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:01:55 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2c874eab
BinpkgVerifier: disable color in background mode
---
pym/_emerge/BinpkgVerifier.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/BinpkgVerifier.py b/pym/_emerge/BinpkgVerifier.py
index 6c71977..379c862 100644
--- a/pym/_emerge/BinpkgVerifier.py
+++ b/pym/_emerge/BinpkgVerifier.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AsynchronousTask import AsynchronousTask
@@ -26,11 +26,14 @@ class BinpkgVerifier(AsynchronousTask):
rval = os.EX_OK
stdout_orig = sys.stdout
stderr_orig = sys.stderr
+ global_havecolor = portage.output.havecolor
out = portage.StringIO()
file_exists = True
try:
sys.stdout = out
sys.stderr = out
+ if portage.output.havecolor:
+ portage.output.havecolor = not self.background
try:
bintree.digestCheck(pkg)
except portage.exception.FileNotFound:
@@ -61,6 +64,7 @@ class BinpkgVerifier(AsynchronousTask):
finally:
sys.stdout = stdout_orig
sys.stderr = stderr_orig
+ portage.output.havecolor = global_havecolor
msg = _unicode_decode(out.getvalue(),
encoding=_encodings['content'], errors='replace')
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 1afe920761e010d9bb4fc028895a8868de007775
Author: Gokdeniz Karadag <gokdenizk <AT> gmail <DOT> com>
AuthorDate: Fri Feb 18 15:57:25 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:02:47 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1afe9207
emerge: support post_emerge hook like post_sync
This will fix bug #355447.
---
pym/_emerge/main.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 4026694..0267f11 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -367,6 +367,14 @@ def post_emerge(root_config, myopts, mtimedb, retval):
if retval in (None, os.EX_OK) or (not "--pretend" in myopts):
display_preserved_libs(vardbapi, myopts)
+ from portage.output import red, bold
+ postemerge = os.path.join(settings["PORTAGE_CONFIGROOT"],
+ portage.USER_CONFIG_PATH, "bin", "post_emerge")
+ if os.access(postemerge, os.X_OK):
+ retval = portage.process.spawn(
+ [postemerge], env=settings.environ())
+ if retval != os.EX_OK:
+ print(red(" * ") + bold("spawn failed of " + postemerge))
sys.exit(retval)
def multiple_actions(action1, action2):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 4f6f5579be8e647702163e9fcc9f146b2ed4a444
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 18 15:15:15 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:02:11 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4f6f5579
unmerge: don't show null/ cat in unmatched atoms
This will fix bug #269534.
---
pym/_emerge/unmerge.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index e1d400f..df95f69 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -186,7 +186,7 @@ def unmerge(root_config, myopts, unmerge_action,
mymatch = localtree.dep_match(x)
if not mymatch:
portage.writemsg("\n--- Couldn't find '%s' to %s.\n" % \
- (x, unmerge_action), noiselevel=-1)
+ (x.replace("null/", ""), unmerge_action), noiselevel=-1)
continue
pkgmap.append(
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: d1e1f74aa4bdc0f01e065bcdb99fe27cd8d92ada
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 18 16:16:31 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:02:55 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d1e1f74a
emerge: warn to stderr if post_* hooks fail
---
pym/_emerge/actions.py | 4 +++-
pym/_emerge/main.py | 11 ++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 7562430..e8a38ad 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2432,7 +2432,9 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
retval = portage.process.spawn(
[postsync, dosyncuri], env=settings.environ())
if retval != os.EX_OK:
- print(red(" * ") + bold("spawn failed of " + postsync))
+ writemsg_level(
+ " %s spawn failed of %s\n" % (bad("*"), postsync,),
+ level=logging.ERROR, noiselevel=-1)
if(mybestpv != mypvs) and not "--quiet" in myopts:
print()
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 0267f11..f0f44b5 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -367,14 +367,15 @@ def post_emerge(root_config, myopts, mtimedb, retval):
if retval in (None, os.EX_OK) or (not "--pretend" in myopts):
display_preserved_libs(vardbapi, myopts)
- from portage.output import red, bold
postemerge = os.path.join(settings["PORTAGE_CONFIGROOT"],
- portage.USER_CONFIG_PATH, "bin", "post_emerge")
+ portage.USER_CONFIG_PATH, "bin", "post_emerge")
if os.access(postemerge, os.X_OK):
- retval = portage.process.spawn(
+ hook_retval = portage.process.spawn(
[postemerge], env=settings.environ())
- if retval != os.EX_OK:
- print(red(" * ") + bold("spawn failed of " + postemerge))
+ if hook_retval != os.EX_OK:
+ writemsg_level(
+ " %s spawn failed of %s\n" % (bad("*"), postemerge,),
+ level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
def multiple_actions(action1, action2):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 9fc5c27af699de5d5f5ded2b51a5e73c99e983ac
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 18 16:44:31 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:03:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9fc5c27a
emerge: fix --sync cvs error message
---
pym/_emerge/actions.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e8a38ad..eece671 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2379,9 +2379,9 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
retval = portage.process.spawn_bash(
"cd %s; exec cvs -z0 -q update -dP" % \
(portage._shell_quote(myportdir),), **spawn_kwargs)
- writemsg_level("!!! cvs update error; exiting.\n",
- noiselevel=-1, level=logging.ERROR)
if retval != os.EX_OK:
+ writemsg_level("!!! cvs update error; exiting.\n",
+ noiselevel=-1, level=logging.ERROR)
sys.exit(retval)
dosyncuri = syncuri
else:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:14 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:14 UTC (permalink / raw
To: gentoo-commits
commit: 21c8111c6a85910bda692b3bc96f9a9e48f3554b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 20 09:42:14 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:12:24 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=21c8111c
SubProcess: notify exit listeners in _poll
---
pym/_emerge/SubProcess.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index b2b19d5..ef1346a 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -38,6 +38,7 @@ class SubProcess(AbstractPollTask):
if retval[0] == 0:
return None
self._set_returncode(retval)
+ self.wait()
return self.returncode
def cancel(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:14 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:14 UTC (permalink / raw
To: gentoo-commits
commit: 797b029439aac9291896af629a97cd1ca64e2317
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 20 09:40:37 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:11:59 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=797b0294
Scheduler: ensure _prefetchers is cleared
---
pym/_emerge/Scheduler.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 34e5e6f..e9c1b6a 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1538,6 +1538,7 @@ class Scheduler(PollScheduler):
self._status_display.reset()
self._digraph = None
self._task_queues.fetch.clear()
+ self._prefetchers.clear()
def _choose_pkg(self):
"""
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:14 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:14 UTC (permalink / raw
To: gentoo-commits
commit: 5280f456a8b999655a4e94c22da9589931703a67
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 00:35:14 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:12:45 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5280f456
post_emerge: pass in more info
This makes it possible to do things like give special suggestions after
world updates.
---
pym/_emerge/main.py | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index f0f44b5..267254c 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -292,7 +292,8 @@ def display_preserved_libs(vardbapi, myopts):
print(colorize("WARN", " * ") + " used by %d other files" % (len(consumers) - MAX_DISPLAY))
print("Use " + colorize("GOOD", "emerge @preserved-rebuild") + " to rebuild packages using these libraries")
-def post_emerge(root_config, myopts, mtimedb, retval):
+def post_emerge(myaction, myopts, myfiles,
+ target_root, trees, mtimedb, retval):
"""
Misc. things to run at the end of a merge session.
@@ -303,6 +304,14 @@ def post_emerge(root_config, myopts, mtimedb, retval):
Display preserved libs warnings
Exit Emerge
+ @param myaction: The action returned from parse_opts()
+ @type myaction: String
+ @param myopts: emerge options
+ @type myopts: dict
+ @param myfiles: emerge arguments
+ @type myfiles: list
+ @param target_root: The target ROOT for myaction
+ @type target_root: String
@param trees: A dictionary mapping each ROOT to it's package databases
@type trees: dict
@param mtimedb: The mtimeDB to store data needed across merge invocations
@@ -314,8 +323,7 @@ def post_emerge(root_config, myopts, mtimedb, retval):
1. Calls sys.exit(retval)
"""
- target_root = root_config.root
- trees = { target_root : root_config.trees }
+ root_config = trees[target_root]["root_config"]
vardbapi = trees[target_root]["vartree"].dbapi
settings = vardbapi.settings
info_mtimes = mtimedb["info"]
@@ -1637,7 +1645,8 @@ def emerge_main():
rval = action_uninstall(settings, trees, mtimedb["ldpath"],
myopts, myaction, myfiles, spinner)
if not (myaction == 'deselect' or buildpkgonly or fetchonly or pretend):
- post_emerge(root_config, myopts, mtimedb, rval)
+ post_emerge(myaction, myopts, myfiles, settings["ROOT"],
+ trees, mtimedb, rval)
return rval
elif myaction == 'info':
@@ -1708,7 +1717,7 @@ def emerge_main():
display_news_notification(root_config, myopts)
retval = action_build(settings, trees, mtimedb,
myopts, myaction, myfiles, spinner)
- root_config = trees[settings["ROOT"]]["root_config"]
- post_emerge(root_config, myopts, mtimedb, retval)
+ post_emerge(myaction, myopts, myfiles, settings["ROOT"],
+ trees, mtimedb, retval)
return retval
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:14 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:14 UTC (permalink / raw
To: gentoo-commits
commit: ac386e0247873bd40f2c79b94e5f41003b729e36
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 02:07:07 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:12:54 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ac386e02
post_emerge: suggest depclean after world update
This is part of bug #354787.
---
pym/_emerge/main.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 267254c..b69a004 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -384,8 +384,21 @@ def post_emerge(myaction, myopts, myfiles,
writemsg_level(
" %s spawn failed of %s\n" % (bad("*"), postemerge,),
level=logging.ERROR, noiselevel=-1)
+
+ if "--quiet" not in myopts and \
+ myaction is None and "@world" in myfiles:
+ show_depclean_suggestion()
+
sys.exit(retval)
+def show_depclean_suggestion():
+ out = portage.output.EOutput()
+ msg = "After world updates, it is important to remove " + \
+ "obsolete packages with emerge --depclean. Refer " + \
+ "to `man emerge` for more information."
+ for line in textwrap.wrap(msg, 72):
+ out.einfo(line)
+
def multiple_actions(action1, action2):
sys.stderr.write("\n!!! Multiple actions requested... Please choose one only.\n")
sys.stderr.write("!!! '%s' or '%s'\n\n" % (action1, action2))
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:14 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:14 UTC (permalink / raw
To: gentoo-commits
commit: 6c9b5bd5ab98d9302b6cbf146f54b45e6e4a0d83
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 02:38:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:13:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6c9b5bd5
chk_updated_cfg_files: fix plurality of message
This will fix bug #355803.
---
pym/_emerge/actions.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index eece671..6169950 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2923,9 +2923,15 @@ def chk_updated_cfg_files(eroot, config_protect):
for x in result:
print("\n"+colorize("WARN", " * IMPORTANT:"), end=' ')
if not x[1]: # it's a protected file
- print("config file '%s' needs updating." % x[0])
+ writemsg_level("config file '%s' needs updating.\n" % x[0],
+ level=logging.INFO, noiselevel=-1)
else: # it's a protected dir
- print("%d config files in '%s' need updating." % (len(x[1]), x[0]))
+ if len(x[1]) == 1:
+ writemsg_level("config file '%s' needs updating.\n" % x[1][0],
+ level=logging.INFO, noiselevel=-1)
+ else:
+ writemsg_level("%d config files in '%s' need updating.\n" % \
+ (len(x[1]), x[0]), level=logging.INFO, noiselevel=-1)
if result:
print(" "+yellow("*")+" See the "+colorize("INFORM","CONFIGURATION FILES")\
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:14 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:14 UTC (permalink / raw
To: gentoo-commits
commit: a3739e2ec16a29b7ffc17f76cbec00b40dd6ab46
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 02:59:24 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:13:51 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3739e2e
chk_updated_cfg_files: don't display ._cfg0000_
---
pym/_emerge/actions.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6169950..82cacdb 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2927,7 +2927,10 @@ def chk_updated_cfg_files(eroot, config_protect):
level=logging.INFO, noiselevel=-1)
else: # it's a protected dir
if len(x[1]) == 1:
- writemsg_level("config file '%s' needs updating.\n" % x[1][0],
+ head, tail = os.path.split(x[1][0])
+ tail = tail[len("._cfg0000_"):]
+ fpath = os.path.join(head, tail)
+ writemsg_level("config file '%s' needs updating.\n" % fpath,
level=logging.INFO, noiselevel=-1)
else:
writemsg_level("%d config files in '%s' need updating.\n" % \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 3:16 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 3:16 UTC (permalink / raw
To: gentoo-commits
commit: fccee1c77d21a89d5c602f5371486408cd51546b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 03:04:10 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 03:16:16 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fccee1c7
show_depclean_suggestion: use ewarn, not einfo
---
pym/_emerge/main.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index b69a004..ce643cd 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -397,7 +397,7 @@ def show_depclean_suggestion():
"obsolete packages with emerge --depclean. Refer " + \
"to `man emerge` for more information."
for line in textwrap.wrap(msg, 72):
- out.einfo(line)
+ out.ewarn(line)
def multiple_actions(action1, action2):
sys.stderr.write("\n!!! Multiple actions requested... Please choose one only.\n")
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-02-22 17:41 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-02-22 17:41 UTC (permalink / raw
To: gentoo-commits
commit: fefdf8621f1d10e8af9c6b98f40b90f1b19b07ab
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 17:31:50 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 17:38:35 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fefdf862
emerge: mention revdep-rebuild in depclean help
---
pym/_emerge/help.py | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index bd6c0f2..2f8b342 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -94,11 +94,16 @@ def help(myopts, havecolor=1):
"listed in package.provided (see portage(5)) may be removed by " + \
"depclean, even if they are part of the world set."
- if not _ENABLE_DYN_LINK_MAP:
- paragraph += " Also note that " + \
- "depclean may break link level dependencies. Thus, it is " + \
- "recommended to use a tool such as revdep-rebuild(1) " + \
- "in order to detect such breakage."
+ paragraph += " Also note that " + \
+ "depclean may break link level dependencies"
+
+ if _ENABLE_DYN_LINK_MAP:
+ paragraph += ", especially when the " + \
+ "--depclean-lib-check option is disabled"
+
+ paragraph += ". Thus, it is " + \
+ "recommended to use a tool such as revdep-rebuild(1) " + \
+ "in order to detect such breakage."
for line in wrap(paragraph, desc_width):
print(desc_indent + line)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-01 20:55 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-01 20:55 UTC (permalink / raw
To: gentoo-commits
commit: 52c71cc0e82e3849e85594378bc321c36713521c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 25 05:58:44 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 1 20:51:02 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=52c71cc0
action_sync: handle IPv6 [ip] in SYNC
This will fix bug #356375.
---
pym/_emerge/actions.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 82cacdb..471adb3 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2068,7 +2068,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
retries=0
proto, user_name, hostname, port = re.split(
- "(rsync|ssh)://([^:/]+@)?([^:/]*)(:[0-9]+)?", syncuri, maxsplit=4)[1:5]
+ r"(rsync|ssh)://([^:/]+@)?(\[[:\da-fA-F]*\]|[^:/]*)(:[0-9]+)?",
+ syncuri, maxsplit=4)[1:5]
if port is None:
port=""
if user_name is None:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-01 20:55 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-01 20:55 UTC (permalink / raw
To: gentoo-commits
commit: fe71c29eb3c0bd67886482c3cd394945e0b373e9
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 25 06:29:31 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 1 20:51:16 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe71c29e
action_sync: handle IPv6 [ip] in SYNC some more
This will fix bug #356375 some more.
---
pym/_emerge/actions.py | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 471adb3..ea8fc42 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2067,13 +2067,23 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
maxretries = -1 #default number of retries
retries=0
- proto, user_name, hostname, port = re.split(
- r"(rsync|ssh)://([^:/]+@)?(\[[:\da-fA-F]*\]|[^:/]*)(:[0-9]+)?",
- syncuri, maxsplit=4)[1:5]
+ try:
+ proto, user_name, hostname, port = re.split(
+ r"(rsync|ssh)://([^:/]+@)?(\[[:\da-fA-F]*\]|[^:/]*)(:[0-9]+)?",
+ syncuri, maxsplit=4)[1:5]
+ except ValueError:
+ writemsg_level("!!! SYNC is invalid: %s\n" % syncuri,
+ noiselevel=-1, level=logging.ERROR)
+ return 1
if port is None:
port=""
if user_name is None:
user_name=""
+ if re.match(r"^\[[:\da-fA-F]*\]$", hostname) is None:
+ getaddrinfo_host = hostname
+ else:
+ # getaddrinfo needs the brackets stripped
+ getaddrinfo_host = hostname[1:-1]
updatecache_flg=True
all_rsync_opts = set(rsync_opts)
extra_rsync_opts = portage.util.shlex_split(
@@ -2092,7 +2102,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
try:
addrinfos = getaddrinfo_validate(
- socket.getaddrinfo(hostname, None,
+ socket.getaddrinfo(getaddrinfo_host, None,
family, socket.SOCK_STREAM))
except socket.error as e:
writemsg_level(
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-01 20:55 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-01 20:55 UTC (permalink / raw
To: gentoo-commits
commit: 9cbd711221d14f6eb195564e406842b023c44b34
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 17:58:27 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 1 20:53:18 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9cbd7112
depgraph: case insensitive search for unsatisfied
This will fix bug #356555.
---
pym/_emerge/depgraph.py | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7f47117..a755116 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2743,7 +2743,7 @@ class depgraph(object):
else:
writemsg_stdout("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
if isinstance(myparent, AtomArg):
- cp = myparent.atom.cp
+ cp = myparent.atom.cp.lower()
cat, pkg = portage.catsplit(cp)
if cat == "null":
cat = None
@@ -2757,6 +2757,12 @@ class depgraph(object):
if "--usepkg" in self._frozen_config.myopts:
all_cp.update(bindb.cp_all())
+ orig_cp_map = {}
+ for cp in all_cp:
+ cp_lower = cp.lower()
+ orig_cp_map.setdefault(cp_lower, []).append(cp)
+ all_cp = set(orig_cp_map)
+
if cat:
matches = difflib.get_close_matches(cp, all_cp)
else:
@@ -2769,6 +2775,11 @@ class depgraph(object):
for pkg_match in pkg_matches:
matches.extend(pkg_to_cp[pkg_match])
+ matches_orig_case = []
+ for cp in matches:
+ matches_orig_case.extend(orig_cp_map[cp])
+ matches = matches_orig_case
+
if len(matches) == 1:
writemsg_stdout("\nemerge: Maybe you meant " + matches[0] + "?\n"
, noiselevel=-1)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-01 21:54 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-01 21:54 UTC (permalink / raw
To: gentoo-commits
commit: f64dd53bad86a2f91f1b152cfcfa9c4f6eb0b13f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 1 21:52:04 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 1 21:54:13 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f64dd53b
action_deselect: expand cat against world atoms
---
pym/_emerge/actions.py | 36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ea8fc42..b683a37 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1218,25 +1218,37 @@ def action_deselect(settings, trees, opts, atoms):
level=logging.ERROR, noiselevel=-1)
return 1
- vardb = root_config.trees['vartree'].dbapi
- expanded_atoms = set(atoms)
- from portage.dep import Atom
- for atom in atoms:
- if not atom.startswith(SETPREFIX):
- for cpv in vardb.match(atom):
- slot, = vardb.aux_get(cpv, ['SLOT'])
- if not slot:
- slot = '0'
- expanded_atoms.add(Atom('%s:%s' % (portage.cpv_getkey(cpv), slot)))
-
pretend = '--pretend' in opts
locked = False
if not pretend and hasattr(world_set, 'lock'):
world_set.lock()
locked = True
try:
- discard_atoms = set()
world_set.load()
+ world_atoms = world_set.getAtoms()
+ vardb = root_config.trees["vartree"].dbapi
+ expanded_atoms = set(atoms)
+
+ for atom in atoms:
+ if not atom.startswith(SETPREFIX):
+ if atom.cp.startswith("null/"):
+ # try to expand category from world set
+ null_cat, pn = portage.catsplit(atom.cp)
+ for world_atom in world_atoms:
+ cat, world_pn = portage.catsplit(world_atom.cp)
+ if pn == world_pn:
+ expanded_atoms.add(
+ Atom(atom.replace("null", cat, 1),
+ allow_repo=True, allow_wildcard=True))
+
+ for cpv in vardb.match(atom):
+ slot, = vardb.aux_get(cpv, ["SLOT"])
+ if not slot:
+ slot = "0"
+ expanded_atoms.add(Atom("%s:%s" % \
+ (portage.cpv_getkey(cpv), slot)))
+
+ discard_atoms = set()
for atom in world_set:
for arg_atom in expanded_atoms:
if arg_atom.startswith(SETPREFIX):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 7cedfe64542cb8ead75c003a916cb88ac4bb523b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 2 16:39:14 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:03:03 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7cedfe64
depgraph: don't output \b to non-tty
This will fix bug #357093.
---
pym/_emerge/depgraph.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a755116..f17a93c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5772,10 +5772,15 @@ def _spinner_start(spinner, myopts):
def _spinner_stop(spinner):
if spinner is None or \
- spinner.update is spinner.update_quiet:
+ spinner.update == spinner.update_quiet:
return
- portage.writemsg_stdout("\b\b... done!\n")
+ if spinner.update != spinner.update_basic:
+ # update_basic is used for non-tty output,
+ # so don't output backspaces in that case.
+ portage.writemsg_stdout("\b\b")
+
+ portage.writemsg_stdout("... done!\n")
def backtrack_depgraph(settings, trees, myopts, myparams,
myaction, myfiles, spinner):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 157382fae7b4b4c74a6f7ce319c602c269cc7e96
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 10 05:46:17 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:23:10 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=157382fa
AbstractPollTask: log exceptional events
Previously, when AbstractPollTask receives a POLLERR or POLLNVAL event,
it would silently cancel the task. Now it will generate a message like
this:
!!! SpawnProcess received strange poll event: 8
The message is displayed via a new _log_poll_exception method, which
is overridden by AbstractEbuildProcess to log the message via elog.
This might help diagnose reported cases of SIGTERM signals killing
ebuild processes for no apparent reason:
http://code.google.com/p/chromium-os/issues/detail?id=12968
---
pym/_emerge/AbstractEbuildProcess.py | 5 +++++
pym/_emerge/AbstractPollTask.py | 11 ++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 601aafe..d7f31be 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -228,6 +228,11 @@ class AbstractEbuildProcess(SpawnProcess):
self.scheduler.output(msg,
log_path=self.settings.get("PORTAGE_LOG_FILE"))
+ def _log_poll_exception(self, event):
+ self._elog("eerror",
+ ["%s received strange poll event: %s\n" % \
+ (self.__class__.__name__, event,)])
+
def _set_returncode(self, wait_retval):
SpawnProcess._set_returncode(self, wait_retval)
diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 833ee3b..6cbf984 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -1,8 +1,10 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import array
+import logging
+from portage.util import writemsg_level
from _emerge.AsynchronousTask import AsynchronousTask
from _emerge.PollConstants import PollConstants
class AbstractPollTask(AsynchronousTask):
@@ -39,9 +41,16 @@ class AbstractPollTask(AsynchronousTask):
def _unregister(self):
raise NotImplementedError(self)
+ def _log_poll_exception(self, event):
+ writemsg_level(
+ "!!! %s received strange poll event: %s\n" % \
+ (self.__class__.__name__, event,),
+ level=logging.ERROR, noiselevel=-1)
+
def _unregister_if_appropriate(self, event):
if self._registered:
if event & self._exceptional_events:
+ self._log_poll_exception(event)
self._unregister()
self.cancel()
elif event & PollConstants.POLLHUP:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: c1fba51ccab868d05f48fcc40bc2c959c9385e76
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 9 03:28:21 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:22:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c1fba51c
unmerge: use vardbapi._dblink() to simplify
The dblink constructor is complex and best avoided.
---
pym/_emerge/unmerge.py | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index a6a330c..68b61ed 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -7,7 +7,6 @@ import logging
import sys
import textwrap
import portage
-import portage.dbapi.vartree
from portage import os
from portage.output import bold, colorize, darkgreen, green
from portage._sets import SETPREFIX
@@ -321,9 +320,7 @@ def unmerge(root_config, myopts, unmerge_action,
msg = ("Not unmerging package %s since there is no valid reason "
"for Portage to unmerge itself.") % (pkg.cpv,)
skip_pkg = True
- elif portage.dbapi.vartree.dblink(pkg.category, pkg.pf,
- settings=settings, treetype="vartree", vartree=vartree,
- scheduler=scheduler).isowner(portage._python_interpreter):
+ elif vartree.dbapi._dblink(cpv).isowner(portage._python_interpreter):
msg = ("Not unmerging package %s since there is no valid reason "
"for Portage to unmerge currently used Python interpreter.") % (pkg.cpv,)
skip_pkg = True
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 161714aa02d9deefefc2e1cf2e6ddd2e9e45f3fa
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Mar 9 02:57:23 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:22:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=161714aa
Bug #357009: Disallow uninstallation of currently used Python interpreter.
---
pym/_emerge/unmerge.py | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index df95f69..a6a330c 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -7,6 +7,7 @@ import logging
import sys
import textwrap
import portage
+import portage.dbapi.vartree
from portage import os
from portage.output import bold, colorize, darkgreen, green
from portage._sets import SETPREFIX
@@ -314,19 +315,26 @@ def unmerge(root_config, myopts, unmerge_action,
# by a concurrent process.
continue
- if unmerge_action != "clean" and \
- root_config.root == "/" and \
- portage.match_from_list(
- portage.const.PORTAGE_PACKAGE_ATOM, [pkg]):
- msg = ("Not unmerging package %s since there is no valid " + \
- "reason for portage to unmerge itself.") % (pkg.cpv,)
- for line in textwrap.wrap(msg, 75):
- out.eerror(line)
- # adjust pkgmap so the display output is correct
- pkgmap[cp]["selected"].remove(cpv)
- all_selected.remove(cpv)
- pkgmap[cp]["protected"].add(cpv)
- continue
+ if unmerge_action != "clean" and root_config.root == "/":
+ skip_pkg = False
+ if portage.match_from_list(portage.const.PORTAGE_PACKAGE_ATOM, [pkg]):
+ msg = ("Not unmerging package %s since there is no valid reason "
+ "for Portage to unmerge itself.") % (pkg.cpv,)
+ skip_pkg = True
+ elif portage.dbapi.vartree.dblink(pkg.category, pkg.pf,
+ settings=settings, treetype="vartree", vartree=vartree,
+ scheduler=scheduler).isowner(portage._python_interpreter):
+ msg = ("Not unmerging package %s since there is no valid reason "
+ "for Portage to unmerge currently used Python interpreter.") % (pkg.cpv,)
+ skip_pkg = True
+ if skip_pkg:
+ for line in textwrap.wrap(msg, 75):
+ out.eerror(line)
+ # adjust pkgmap so the display output is correct
+ pkgmap[cp]["selected"].remove(cpv)
+ all_selected.remove(cpv)
+ pkgmap[cp]["protected"].add(cpv)
+ continue
parents = []
for s in installed_sets:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 48fad6f94aa044c638d5cad8851b4fed8e80309b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 11 03:29:57 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:23:29 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=48fad6f9
Scheduler: avoid infinite loop after CTRL-C
If CTRL-C was received at certain times, it was possible for discarded
tasks to be erroneously left in Scheduler._running_tasks, which would
cause the main loop to run infinitely. Thanks to David James
<davidjames <AT> google.com> for reporting this issue and helping to devise
a solution.
---
pym/_emerge/Scheduler.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index e9c1b6a..306c945 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -295,6 +295,13 @@ class Scheduler(PollScheduler):
def _terminate_tasks(self):
self._status_display.quiet = True
+ # Remove running_tasks that have been added to queues but
+ # haven't been started yet, since we're going to discard
+ # them and their start/exit handlers won't be called.
+ for build in self._task_queues.jobs._task_queue:
+ self._running_tasks.remove(build.pkg)
+ for merge in self._task_queues.merge._task_queue:
+ self._running_tasks.remove(merge.merge.pkg)
for q in self._task_queues.values():
q.clear()
@@ -1469,7 +1476,13 @@ class Scheduler(PollScheduler):
mtimedb.commit()
def _build_exit(self, build):
- if build.returncode == os.EX_OK:
+ if build.returncode == os.EX_OK and self._terminated.is_set():
+ # We've been interrupted, so we won't
+ # add this to the merge queue.
+ self.curval += 1
+ self._running_tasks.remove(build.pkg)
+ self._deallocate_config(build.settings)
+ elif build.returncode == os.EX_OK:
self.curval += 1
merge = PackageMerge(merge=build)
if not build.build_opts.buildpkgonly and \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: bcb3ead57e5f207652f506a13604f60dbebf047b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 11 05:21:19 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:23:47 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcb3ead5
PollScheduler: call _terminate_tasks in _schedule
This prevents it from being called while the _schedule_tasks()
implementation is running, in order to avoid potential interference.
---
pym/_emerge/PollScheduler.py | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index a319066..94fd924 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -57,9 +57,11 @@ class PollScheduler(object):
def _terminate_tasks(self):
"""
Send signals to terminate all tasks. This is called once
- from the event dispatching thread. All task should be
- cleaned up at the earliest opportunity, but not necessarily
- before this method returns.
+ from self._schedule() in the event dispatching thread. This
+ prevents it from being called while the _schedule_tasks()
+ implementation is running, in order to avoid potential
+ interference. All tasks should be cleaned up at the earliest
+ opportunity, but not necessarily before this method returns.
"""
raise NotImplementedError()
@@ -74,6 +76,12 @@ class PollScheduler(object):
return False
self._scheduling = True
try:
+
+ if self._terminated.is_set() and \
+ not self._terminated_tasks:
+ self._terminated_tasks = True
+ self._terminate_tasks()
+
return self._schedule_tasks()
finally:
self._scheduling = False
@@ -145,10 +153,6 @@ class PollScheduler(object):
raises StopIteration if timeout is None and there are
no file descriptors to poll.
"""
- if self._terminated.is_set() and \
- not self._terminated_tasks:
- self._terminated_tasks = True
- self._terminate_tasks()
if not self._poll_event_queue:
self._poll(timeout)
if not self._poll_event_queue:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 11aacb6a6d57d92080ee1c93d6711f2ec29913cc
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 12 18:35:23 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:24:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11aacb6a
Scheduler: fix AttributeError in _terminate_tasks
Thanks to David James <davidjames <AT> google.com> for reporting this error:
AttributeError: 'EbuildPhase' object has no attribute 'merge'
---
pym/_emerge/Scheduler.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 2f49c34..de635b2 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -301,7 +301,10 @@ class Scheduler(PollScheduler):
for build in self._task_queues.jobs._task_queue:
self._running_tasks.remove(build.pkg)
for merge in self._task_queues.merge._task_queue:
- self._running_tasks.remove(merge.merge.pkg)
+ # Setup phases may be scheduled in this queue, but
+ # we're only interested in the PackageMerge instances.
+ if isinstance(merge, PackageMerge):
+ self._running_tasks.remove(merge.merge.pkg)
for q in self._task_queues.values():
q.clear()
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: d57e5baf22dccb5160249299e6db039f69a4214d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 11 06:02:19 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:24:01 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d57e5baf
PollScheduler: tweek termination logic
* PollScheduler and all subclasses now use the _terminated_tasks
variable to check whether or not _terminate_tasks() has been called,
and behave appropriately in that case.
* The _schedule_tasks() method now has documentation about the
relationship with _terminate_tasks() and _terminated_tasks.
---
pym/_emerge/MetadataRegen.py | 15 ++++++++-------
pym/_emerge/PollScheduler.py | 21 +++++++++++++++++++++
pym/_emerge/QueueScheduler.py | 3 +++
pym/_emerge/Scheduler.py | 8 ++++----
4 files changed, 36 insertions(+), 11 deletions(-)
diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 45c4f4d..8103175 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -44,7 +44,7 @@ class MetadataRegen(PollScheduler):
portage.writemsg_stdout("Regenerating cache entries...\n")
every_cp.sort(reverse=True)
try:
- while not self._terminated.is_set():
+ while not self._terminated_tasks:
yield every_cp.pop()
except IndexError:
pass
@@ -56,13 +56,13 @@ class MetadataRegen(PollScheduler):
consumer = self._consumer
for cp in self._cp_iter:
- if self._terminated.is_set():
+ if self._terminated_tasks:
break
cp_set.add(cp)
portage.writemsg_stdout("Processing %s\n" % cp)
cpv_list = portdb.cp_list(cp)
for cpv in cpv_list:
- if self._terminated.is_set():
+ if self._terminated_tasks:
break
valid_pkgs.add(cpv)
ebuild_path, repo_path = portdb.findname2(cpv)
@@ -94,7 +94,7 @@ class MetadataRegen(PollScheduler):
while self._jobs:
self._poll_loop()
- if self._terminated.is_set():
+ if self._terminated_tasks:
self.returncode = 1
return
@@ -145,9 +145,10 @@ class MetadataRegen(PollScheduler):
@returns: True if there may be remaining tasks to schedule,
False otherwise.
"""
+ if self._terminated_tasks:
+ return False
+
while self._can_add_job():
- if self._terminated.is_set():
- return False
try:
metadata_process = next(self._process_iter)
except StopIteration:
@@ -167,7 +168,7 @@ class MetadataRegen(PollScheduler):
self.returncode = 1
self._error_count += 1
self._valid_pkgs.discard(metadata_process.cpv)
- if not self._terminated.is_set():
+ if not self._terminated_tasks:
portage.writemsg("Error processing %s, continuing...\n" % \
(metadata_process.cpv,), noiselevel=-1)
diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 94fd924..8f4bd64 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -65,6 +65,24 @@ class PollScheduler(object):
"""
raise NotImplementedError()
+ def _schedule_tasks(self):
+ """
+ This is called from inside the _schedule() method, which
+ guarantees the following:
+
+ 1) It will not be called recursively.
+ 2) _terminate_tasks() will not be called while it is running.
+ 3) The state of the boolean _terminated_tasks variable will
+ not change while it is running.
+
+ Unless this method is used to perform user interface updates,
+ or something like that, the first thing it should do is check
+ the state of _terminated_tasks and if that is True then it
+ should return False immediately (since there's no need to
+ schedule anything after _terminate_tasks() has been called).
+ """
+ raise NotImplementedError()
+
def _schedule(self):
"""
Calls _schedule_tasks() and automatically returns early from
@@ -90,6 +108,9 @@ class PollScheduler(object):
return self._jobs
def _can_add_job(self):
+ if self._terminated_tasks:
+ return False
+
max_jobs = self._max_jobs
max_load = self._max_load
diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index 8a7ea30..2d727c9 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -79,6 +79,9 @@ class QueueScheduler(PollScheduler):
@returns: True if there may be remaining tasks to schedule,
False otherwise.
"""
+ if self._terminated_tasks:
+ return False
+
while self._can_add_job():
n = self._max_jobs - self._running_job_count()
if n < 1:
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 306c945..2f49c34 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1441,7 +1441,7 @@ class Scheduler(PollScheduler):
build_dir=build_dir, build_log=build_log,
pkg=pkg,
returncode=merge.returncode))
- if not self._terminated.is_set():
+ if not self._terminated_tasks:
self._failed_pkg_msg(self._failed_pkgs[-1], "install", "to")
self._status_display.failed = len(self._failed_pkgs)
return
@@ -1476,7 +1476,7 @@ class Scheduler(PollScheduler):
mtimedb.commit()
def _build_exit(self, build):
- if build.returncode == os.EX_OK and self._terminated.is_set():
+ if build.returncode == os.EX_OK and self._terminated_tasks:
# We've been interrupted, so we won't
# add this to the merge queue.
self.curval += 1
@@ -1505,7 +1505,7 @@ class Scheduler(PollScheduler):
build_dir=build_dir, build_log=build_log,
pkg=build.pkg,
returncode=build.returncode))
- if not self._terminated.is_set():
+ if not self._terminated_tasks:
self._failed_pkg_msg(self._failed_pkgs[-1], "emerge", "for")
self._status_display.failed = len(self._failed_pkgs)
self._deallocate_config(build.settings)
@@ -1685,7 +1685,7 @@ class Scheduler(PollScheduler):
self._poll_loop()
def _keep_scheduling(self):
- return bool(not self._terminated.is_set() and self._pkg_queue and \
+ return bool(not self._terminated_tasks and self._pkg_queue and \
not (self._failed_pkgs and not self._build_opts.fetchonly))
def _is_work_scheduled(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 0df535d2f3115901a429930b90ff1fbc2b04df9e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 01:19:02 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:47:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0df535d2
AsynchronousTask: always call wait() if cancelled
This is needed in order to ensure that exit listeners are called.
Subclasses call the base class cancel() method in order to inherit the
wait() call.
---
pym/_emerge/CompositeTask.py | 3 ++-
pym/_emerge/FifoIpcDaemon.py | 4 ++--
pym/_emerge/PipeReader.py | 4 ++--
pym/_emerge/SubProcess.py | 6 +-----
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index ddbfe63..4667b78 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AsynchronousTask import AsynchronousTask
@@ -15,6 +15,7 @@ class CompositeTask(AsynchronousTask):
self.cancelled = True
if self._current_task is not None:
self._current_task.cancel()
+ AsynchronousTask.cancel(self)
def _poll(self):
"""
diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index ac83646..c31508a 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage import os
@@ -48,7 +48,7 @@ class FifoIpcDaemon(AbstractPollTask):
self.returncode = 1
self.cancelled = True
self._unregister()
- self.wait()
+ AbstractPollTask.cancel(self)
def _wait(self):
if self.returncode is not None:
diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 6952ffd..061921a 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage import os
@@ -36,7 +36,7 @@ class PipeReader(AbstractPollTask):
if self.returncode is None:
self.returncode = 1
self.cancelled = True
- self.wait()
+ AbstractPollTask.cancel(self)
def _wait(self):
if self.returncode is not None:
diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index fc035d1..16c71fe 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -49,11 +49,7 @@ class SubProcess(AbstractPollTask):
if e.errno != errno.ESRCH:
raise
del e
-
- self.cancelled = True
- if self.pid is not None:
- self.wait()
- return self.returncode
+ AbstractPollTask.cancel(self)
def isAlive(self):
return self.pid is not None and \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 7b021591b59ef5a995fcdec79c0fbda790853a17
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 00:36:36 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:47:11 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7b021591
Scheduler: terminate _merge_wait_queue
---
pym/_emerge/Scheduler.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index de635b2..b5b258d 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -300,6 +300,10 @@ class Scheduler(PollScheduler):
# them and their start/exit handlers won't be called.
for build in self._task_queues.jobs._task_queue:
self._running_tasks.remove(build.pkg)
+ if self._merge_wait_queue:
+ for merge in self._merge_wait_queue:
+ self._running_tasks.remove(merge.merge.pkg)
+ del self._merge_wait_queue[:]
for merge in self._task_queues.merge._task_queue:
# Setup phases may be scheduled in this queue, but
# we're only interested in the PackageMerge instances.
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: cd01cd70242e7fc9c2d52375948bbe76378f1471
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 01:42:59 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:48:03 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cd01cd70
CompositeTask: fix assertion in _wait
---
pym/_emerge/CompositeTask.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index 4667b78..b5e8ce5 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -49,6 +49,11 @@ class CompositeTask(AsynchronousTask):
# don't wait for the same task more than once
break
if task is prev:
+ if self.returncode is not None:
+ # This is expected if we're being
+ # called from the task's exit listener
+ # after it's been cancelled.
+ break
# Before the task.wait() method returned, an exit
# listener should have set self._current_task to either
# a different task or None. Something is wrong.
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 379b1e85b516ca17f0f220ec8ac9b9997a2b8c22
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 04:50:36 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:48:53 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=379b1e85
Scheduler: tweak prefetcher cancellation logic
This should prevent "TypeError: an integer is required" raised from
waitpid when trying to cancel a prefetcher that never started.
---
pym/_emerge/AbstractPollTask.py | 3 +++
pym/_emerge/Binpkg.py | 5 ++---
pym/_emerge/EbuildBuild.py | 5 ++---
pym/_emerge/Scheduler.py | 10 +++++++++-
4 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 6cbf984..f7f3a95 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -17,6 +17,9 @@ class AbstractPollTask(AsynchronousTask):
_registered_events = PollConstants.POLLIN | PollConstants.POLLHUP | \
_exceptional_events
+ def isAlive(self):
+ return bool(self._registered)
+
def _read_buf(self, f, event):
"""
| POLLIN | RETURN
diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index b011b00..0058745 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -77,9 +77,8 @@ class Binpkg(CompositeTask):
prefetcher = self.prefetcher
if prefetcher is None:
pass
- elif not prefetcher.isAlive():
- prefetcher.cancel()
- elif prefetcher.poll() is None:
+ elif prefetcher.isAlive() and \
+ prefetcher.poll() is None:
waiting_msg = ("Fetching '%s' " + \
"in the background. " + \
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index f7381ca..98f5a2b 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -65,9 +65,8 @@ class EbuildBuild(CompositeTask):
prefetcher = self.prefetcher
if prefetcher is None:
pass
- elif not prefetcher.isAlive():
- prefetcher.cancel()
- elif prefetcher.poll() is None:
+ elif prefetcher.isAlive() and \
+ prefetcher.poll() is None:
waiting_msg = "Fetching files " + \
"in the background. " + \
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index b5b258d..5d19042 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1819,6 +1819,14 @@ class Scheduler(PollScheduler):
"installed", pkg.root_config, installed=True,
operation="uninstall")
+ prefetcher = self._prefetchers.pop(pkg, None)
+ if prefetcher is not None and not prefetcher.isAlive():
+ try:
+ self._task_queues.fetch._task_queue.remove(prefetcher)
+ except ValueError:
+ pass
+ prefetcher = None
+
task = MergeListItem(args_set=self._args_set,
background=self._background, binpkg_opts=self._binpkg_opts,
build_opts=self._build_opts,
@@ -1828,7 +1836,7 @@ class Scheduler(PollScheduler):
find_blockers=self._find_blockers(pkg), logger=self._logger,
mtimedb=self._mtimedb, pkg=pkg, pkg_count=self._pkg_count.copy(),
pkg_to_replace=pkg_to_replace,
- prefetcher=self._prefetchers.get(pkg),
+ prefetcher=prefetcher,
scheduler=self._sched_iface,
settings=self._allocate_config(pkg.root),
statusMessage=self._status_msg,
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 2b4d81caa05f5cb5aaf231ca25573c5547583c38
Author: David James <davidjames <AT> google <DOT> com>
AuthorDate: Thu Mar 17 04:54:37 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:49:12 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2b4d81ca
Update Scheduler to protect against infinite loop
If we have running tasks, but we're not listening to these tasks,
we're going to loop forever. So throw an exception in this case.
---
pym/_emerge/Scheduler.py | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5d19042..fa4825c 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1681,15 +1681,13 @@ class Scheduler(PollScheduler):
self._set_max_jobs(1)
while self._schedule():
- if self._poll_event_handlers:
- self._poll_loop()
+ self._poll_loop()
while True:
self._schedule()
if not self._is_work_scheduled():
break
- if self._poll_event_handlers:
- self._poll_loop()
+ self._poll_loop()
def _keep_scheduling(self):
return bool(not self._terminated_tasks and self._pkg_queue and \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: ef507665cb7b3fe697126f75e794025edf3f03eb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 03:44:55 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:48:18 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ef507665
CompositeTask: handle unstarted terminated tasks
---
pym/_emerge/Binpkg.py | 4 ++--
pym/_emerge/CompositeTask.py | 22 ++++++++++++++++++++--
pym/_emerge/EbuildExecuter.py | 4 ++--
3 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 65a5ef4..b011b00 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.EbuildPhase import EbuildPhase
@@ -277,7 +277,7 @@ class Binpkg(CompositeTask):
settings=settings)
setup_phase.addExitListener(self._setup_exit)
- self._current_task = setup_phase
+ self._task_queued(setup_phase)
self.scheduler.scheduleSetup(setup_phase)
def _setup_exit(self, setup_phase):
diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index b5e8ce5..8e8f084 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -8,13 +8,19 @@ class CompositeTask(AsynchronousTask):
__slots__ = ("scheduler",) + ("_current_task",)
+ _TASK_QUEUED = -1
+
def isAlive(self):
return self._current_task is not None
def cancel(self):
self.cancelled = True
if self._current_task is not None:
- self._current_task.cancel()
+ if self._current_task is self._TASK_QUEUED:
+ self.returncode = 1
+ self._current_task = None
+ else:
+ self._current_task.cancel()
AsynchronousTask.cancel(self)
def _poll(self):
@@ -32,7 +38,9 @@ class CompositeTask(AsynchronousTask):
prev = None
while True:
task = self._current_task
- if task is None or task is prev:
+ if task is None or \
+ task is self._TASK_QUEUED or \
+ task is prev:
# don't poll the same task more than once
break
task.poll()
@@ -48,6 +56,10 @@ class CompositeTask(AsynchronousTask):
if task is None:
# don't wait for the same task more than once
break
+ if task is self._TASK_QUEUED:
+ self.returncode = 1
+ self._current_task = None
+ break
if task is prev:
if self.returncode is not None:
# This is expected if we're being
@@ -123,3 +135,9 @@ class CompositeTask(AsynchronousTask):
self._current_task = task
task.start()
+ def _task_queued(self, task):
+ task.addStartListener(self._task_queued_start_handler)
+ self._current_task = self._TASK_QUEUED
+
+ def _task_queued_start_handler(self, task):
+ self._current_task = task
diff --git a/pym/_emerge/EbuildExecuter.py b/pym/_emerge/EbuildExecuter.py
index b28c737..f8febd4 100644
--- a/pym/_emerge/EbuildExecuter.py
+++ b/pym/_emerge/EbuildExecuter.py
@@ -51,7 +51,7 @@ class EbuildExecuter(CompositeTask):
settings=settings)
setup_phase.addExitListener(self._setup_exit)
- self._current_task = setup_phase
+ self._task_queued(setup_phase)
self.scheduler.scheduleSetup(setup_phase)
def _setup_exit(self, setup_phase):
@@ -69,7 +69,7 @@ class EbuildExecuter(CompositeTask):
# otherwise they can interfere with eachother.
unpack_phase.addExitListener(self._unpack_exit)
- self._current_task = unpack_phase
+ self._task_queued(unpack_phase)
self.scheduler.scheduleUnpack(unpack_phase)
else:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 5c1e74b2d9a68eb97557c76859bcdc74675d03d7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 05:36:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:49:35 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5c1e74b2
AsynchronousTask: add _cancel template method
---
pym/_emerge/AsynchronousLock.py | 4 ++++
pym/_emerge/AsynchronousTask.py | 15 ++++++++++++---
pym/_emerge/CompositeTask.py | 4 +---
pym/_emerge/FifoIpcDaemon.py | 4 +---
pym/_emerge/PipeReader.py | 4 +---
pym/_emerge/SubProcess.py | 4 +---
pym/_emerge/TaskSequence.py | 3 +--
7 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index c47a207..6e0a1ac 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -198,6 +198,10 @@ class _LockProcess(AbstractPollTask):
raise AssertionError('lock process failed with returncode %s' \
% (proc.returncode,))
+ def _cancel(self):
+ if self._proc is not None:
+ self._proc.cancel()
+
def _wait(self):
if self.returncode is not None:
return self.returncode
diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 1918b83..de00800 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.SlotObject import SlotObject
@@ -45,8 +45,17 @@ class AsynchronousTask(SlotObject):
return self.returncode
def cancel(self):
- self.cancelled = True
- self.wait()
+ if not self.cancelled:
+ self.cancelled = True
+ self._cancel()
+ self.wait()
+
+ def _cancel(self):
+ """
+ Subclasses should implement this, as a template method
+ to be called by AsynchronousTask.cancel().
+ """
+ pass
def addStartListener(self, f):
"""
diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index 8e8f084..edc0768 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -13,15 +13,13 @@ class CompositeTask(AsynchronousTask):
def isAlive(self):
return self._current_task is not None
- def cancel(self):
- self.cancelled = True
+ def _cancel(self):
if self._current_task is not None:
if self._current_task is self._TASK_QUEUED:
self.returncode = 1
self._current_task = None
else:
self._current_task.cancel()
- AsynchronousTask.cancel(self)
def _poll(self):
"""
diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index c31508a..a716dac 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -43,12 +43,10 @@ class FifoIpcDaemon(AbstractPollTask):
def isAlive(self):
return self._registered
- def cancel(self):
+ def _cancel(self):
if self.returncode is None:
self.returncode = 1
- self.cancelled = True
self._unregister()
- AbstractPollTask.cancel(self)
def _wait(self):
if self.returncode is not None:
diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 061921a..375c98f 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -32,11 +32,9 @@ class PipeReader(AbstractPollTask):
def isAlive(self):
return self._registered
- def cancel(self):
+ def _cancel(self):
if self.returncode is None:
self.returncode = 1
- self.cancelled = True
- AbstractPollTask.cancel(self)
def _wait(self):
if self.returncode is not None:
diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 16c71fe..115af80 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -41,15 +41,13 @@ class SubProcess(AbstractPollTask):
self.wait()
return self.returncode
- def cancel(self):
+ def _cancel(self):
if self.isAlive():
try:
os.kill(self.pid, signal.SIGTERM)
except OSError as e:
if e.errno != errno.ESRCH:
raise
- del e
- AbstractPollTask.cancel(self)
def isAlive(self):
return self.pid is not None and \
diff --git a/pym/_emerge/TaskSequence.py b/pym/_emerge/TaskSequence.py
index 7a1bd5a..1233c99 100644
--- a/pym/_emerge/TaskSequence.py
+++ b/pym/_emerge/TaskSequence.py
@@ -25,9 +25,8 @@ class TaskSequence(CompositeTask):
def _start(self):
self._start_next_task()
- def cancel(self):
+ def _cancel(self):
self._task_queue.clear()
- CompositeTask.cancel(self)
def _start_next_task(self):
self._start_task(self._task_queue.popleft(),
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: f72d4b20478a33da08dd30f399b3a55cc7a9dda4
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 20:08:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:50:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f72d4b20
AsynchronousLock: implement _cancel
---
pym/_emerge/AsynchronousLock.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 6e0a1ac..6fa2bf6 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -66,6 +66,10 @@ class AsynchronousLock(AsynchronousTask):
if not self._waiting:
self.wait()
+ def _cancel(self):
+ if self._imp is not None:
+ self._imp.cancel()
+
def _wait(self):
if self.returncode is not None:
return self.returncode
@@ -127,6 +131,10 @@ class _LockThread(AbstractPollTask):
self.returncode = os.EX_OK
self.wait()
+ def _cancel(self):
+ # There's currently no way to force thread termination.
+ pass
+
def _wait(self):
if self.returncode is not None:
return self.returncode
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 2f3235abef72d61cdcdf549a08e645933698a4ff
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 21:39:53 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:50:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2f3235ab
EbuildIpcDaemon: use non-blocking write
This prevents the Scheduler from hanging if the client is killed before
we can send the reply, as reported by David James:
http://codereview.chromium.org/6713003
This commit depends on ebuild-ipc (the client) opening the other side
of this fifo before it sends its request, which has already been added
in commit eff879ff0ce7dcc1ce68d5f16de1ec73051f8c18.
---
pym/_emerge/EbuildIpcDaemon.py | 29 ++++++++++++++++++++++++-----
1 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/pym/_emerge/EbuildIpcDaemon.py b/pym/_emerge/EbuildIpcDaemon.py
index efcda93..5dabe34 100644
--- a/pym/_emerge/EbuildIpcDaemon.py
+++ b/pym/_emerge/EbuildIpcDaemon.py
@@ -1,9 +1,12 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import errno
+import logging
import pickle
from portage import os
+from portage.localization import _
+from portage.util import writemsg_level
from _emerge.FifoIpcDaemon import FifoIpcDaemon
from _emerge.PollConstants import PollConstants
@@ -83,7 +86,23 @@ class EbuildIpcDaemon(FifoIpcDaemon):
def _send_reply(self, reply):
# File streams are in unbuffered mode since we do atomic
- # read and write of whole pickles.
- output_file = open(self.output_fifo, 'wb', 0)
- output_file.write(pickle.dumps(reply))
- output_file.close()
+ # read and write of whole pickles. Use non-blocking mode so
+ # we don't hang if the client is killed before we can send
+ # the reply. We rely on the client opening the other side
+ # of this fifo before it sends its request, since otherwise
+ # we'd have a race condition with this open call raising
+ # ENXIO if the client hasn't opened the fifo yet.
+ try:
+ output_fd = os.open(self.output_fifo,
+ os.O_WRONLY | os.O_NONBLOCK)
+ try:
+ os.write(output_fd, pickle.dumps(reply))
+ finally:
+ os.close(output_fd)
+ except OSError as e:
+ # This probably means that the client has been killed,
+ # which causes open to fail with ENXIO.
+ writemsg_level(
+ "!!! EbuildIpcDaemon %s: %s\n" % \
+ (_('failed to send reply'), e),
+ level=logging.ERROR, noiselevel=-1)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: ca312327324fac20c1b4d8cb548789c6114e91d3
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 18 21:05:07 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 21:12:19 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca312327
CompositeTask: fix _wait for TASK_QUEUED
Though this case might never have been triggered, the logic was broken
for cases in which self.cancelled was false and a task was queued. In
this case we need to call back into the scheduler until the queued task
is started or we are cancelled, whichever comes first.
---
pym/_emerge/CompositeTask.py | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index edc0768..644a69b 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -55,9 +55,21 @@ class CompositeTask(AsynchronousTask):
# don't wait for the same task more than once
break
if task is self._TASK_QUEUED:
- self.returncode = 1
- self._current_task = None
- break
+ if self.cancelled:
+ self.returncode = 1
+ self._current_task = None
+ break
+ else:
+ self.scheduler.schedule(condition=self._task_queued_wait)
+ if self.returncode is not None:
+ break
+ elif self.cancelled:
+ self.returncode = 1
+ self._current_task = None
+ break
+ else:
+ # try this again with new _current_task value
+ continue
if task is prev:
if self.returncode is not None:
# This is expected if we're being
@@ -139,3 +151,7 @@ class CompositeTask(AsynchronousTask):
def _task_queued_start_handler(self, task):
self._current_task = task
+
+ def _task_queued_wait(self):
+ return self._current_task is not self._TASK_QUEUED or \
+ self.cancelled or self.returncode is not None
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 5d26b19d2654adbb431103db864e6c9364b5a641
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 18 23:45:47 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:19:52 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5d26b19d
TaskSequence: also call CompositeTask._cancel()
This is a regression from commit
363a7478a100495d2e8597bc6c6d2fdac94339e0 but it's usually not
noticeable with Ctrl-C since SIGINT is propagated to nested processes.
---
pym/_emerge/TaskSequence.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/TaskSequence.py b/pym/_emerge/TaskSequence.py
index 5d6b73f..1fecf63 100644
--- a/pym/_emerge/TaskSequence.py
+++ b/pym/_emerge/TaskSequence.py
@@ -27,6 +27,7 @@ class TaskSequence(CompositeTask):
def _cancel(self):
self._task_queue.clear()
+ CompositeTask._cancel(self)
def _start_next_task(self):
self._start_task(self._task_queue.popleft(),
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: bcb6edaa19e18bc64b4517d60054bcd0420d0ea4
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 15:57:42 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:20:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcb6edaa
emerge_main: add "args" parameter (sys.argv[1:])
Also, fix local portage.debug import so that "global portage" is
not necessary.
---
pym/_emerge/main.py | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 33fe034..368def9 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1340,8 +1340,14 @@ def check_procfs():
level=logging.ERROR, noiselevel=-1)
return 1
-def emerge_main():
- global portage # NFC why this is necessary now - genone
+def emerge_main(args=None):
+ """
+ @param args: command arguments (default: sys.argv[1:])
+ @type args: list
+ """
+ if args is None:
+ args = sys.argv[1:]
+
portage._disable_legacy_globals()
portage.dep._internal_warnings = True
# Disable color until we're sure that it should be enabled (after
@@ -1351,7 +1357,7 @@ def emerge_main():
# possible, such as --config-root. They will be parsed again later,
# together with EMERGE_DEFAULT_OPTS (which may vary depending on the
# the value of --config-root).
- myaction, myopts, myfiles = parse_opts(sys.argv[1:], silent=True)
+ myaction, myopts, myfiles = parse_opts(args, silent=True)
if "--debug" in myopts:
os.environ["PORTAGE_DEBUG"] = "1"
if "--config-root" in myopts:
@@ -1372,7 +1378,7 @@ def emerge_main():
tmpcmdline = []
if "--ignore-default-opts" not in myopts:
tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split())
- tmpcmdline.extend(sys.argv[1:])
+ tmpcmdline.extend(args)
myaction, myopts, myfiles = parse_opts(tmpcmdline)
if myaction not in ('help', 'info', 'version') and \
@@ -1536,11 +1542,10 @@ def emerge_main():
if settings.get("PORTAGE_DEBUG", "") == "1":
spinner.update = spinner.update_quiet
- portage.debug=1
portage.util.noiselimit = 0
if "python-trace" in settings.features:
- import portage.debug
- portage.debug.set_trace(True)
+ import portage.debug as portage_debug
+ portage_debug.set_trace(True)
if not ("--quiet" in myopts):
if '--nospinner' in myopts or \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: b402e535f0a728c13183a92a19f48f173164eada
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 21 00:11:14 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:20:25 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b402e535
chk_updated_cfg_files: fix whitespace in message
Thanks to Dennis Schridde in bug #359681.
---
pym/_emerge/actions.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index b683a37..84ed27c 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2944,7 +2944,8 @@ def chk_updated_cfg_files(eroot, config_protect):
portage.util.find_updated_config_files(target_root, config_protect))
for x in result:
- print("\n"+colorize("WARN", " * IMPORTANT:"), end=' ')
+ writemsg_level("\n %s " % (colorize("WARN", "* IMPORTANT:"),),
+ level=logging.INFO, noiselevel=-1)
if not x[1]: # it's a protected file
writemsg_level("config file '%s' needs updating.\n" % x[0],
level=logging.INFO, noiselevel=-1)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 937f4f958f77b54a4c46b94e89af3f1720450e6b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 24 04:08:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:20:35 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=937f4f95
get_dep_chain: handle InvalidDependString
---
pym/_emerge/depgraph.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f17a93c..91ec759 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2308,8 +2308,12 @@ class depgraph(object):
if target_atom is not None and isinstance(node, Package):
affecting_use = set()
for dep_str in "DEPEND", "RDEPEND", "PDEPEND":
- affecting_use.update(extract_affecting_use(
- node.metadata[dep_str], target_atom))
+ try:
+ affecting_use.update(extract_affecting_use(
+ node.metadata[dep_str], target_atom))
+ except InvalidDependString:
+ if not node.installed:
+ raise
affecting_use.difference_update(node.use.mask, node.use.force)
pkg_name = _unicode_decode("%s") % (node.cpv,)
if affecting_use:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 23b334d6553fb637ebe8e38f78183e0955180f0f
Author: David James <davidjames <AT> google <DOT> com>
AuthorDate: Fri Mar 25 01:14:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:21:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=23b334d6
Update Portage to sync BlockerDB at init.
Currently, Portage syncs the BlockerDB before every merge. This slows
down merges considerably because it requires reading the entire vardb
from disk. Since Portage doesn't merge conflicting packages anyway, we
can optimize this by just reading the vardb at initialization and
caching that.
Change-Id: I6701926f022ef3aa2da10482fc8b09573ae24610
Review URL: http://codereview.chromium.org/6688037
---
pym/_emerge/BlockerDB.py | 13 ++++++-------
pym/_emerge/FakeVartree.py | 18 ++++++++++++------
pym/_emerge/Scheduler.py | 24 +++++++-----------------
3 files changed, 25 insertions(+), 30 deletions(-)
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index fd4bf5e..f5adc4d 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -30,12 +30,7 @@ class BlockerDB(object):
"vartree" : fake_vartree,
}}
- def _get_fake_vartree(self, acquire_lock=0):
- fake_vartree = self._fake_vartree
- fake_vartree.sync(acquire_lock=acquire_lock)
- return fake_vartree
-
- def findInstalledBlockers(self, new_pkg, acquire_lock=0):
+ def findInstalledBlockers(self, new_pkg):
"""
Search for installed run-time blockers in the root where
new_pkg is planned to be installed. This ignores build-time
@@ -45,7 +40,7 @@ class BlockerDB(object):
dep_keys = ["RDEPEND", "PDEPEND"]
settings = self._vartree.settings
stale_cache = set(blocker_cache)
- fake_vartree = self._get_fake_vartree(acquire_lock=acquire_lock)
+ fake_vartree = self._fake_vartree
dep_check_trees = self._dep_check_trees
vardb = fake_vartree.dbapi
installed_pkgs = list(vardb)
@@ -118,3 +113,7 @@ class BlockerDB(object):
return blocking_pkgs
+ def discardBlocker(self, pkg):
+ """Discard a package from the list of potential blockers."""
+ self._fake_vartree.cpv_discard(pkg)
+
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 977824c..21bd355 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -100,6 +100,16 @@ class FakeVartree(vartree):
pkg, self.dbapi, self._global_updates)
return self._aux_get(pkg, wants)
+ def cpv_discard(self, pkg):
+ """
+ Discard a package from the fake vardb if it exists.
+ """
+ old_pkg = self.dbapi.get(pkg)
+ if old_pkg is not None:
+ self.dbapi.cpv_remove(old_pkg)
+ self._pkg_cache.pop(old_pkg, None)
+ self._aux_get_history.discard(old_pkg.cpv)
+
def sync(self, acquire_lock=1):
"""
Call this method to synchronize state with the real vardb
@@ -141,9 +151,7 @@ class FakeVartree(vartree):
# Remove any packages that have been uninstalled.
for pkg in list(pkg_vardb):
if pkg.cpv not in current_cpv_set:
- pkg_vardb.cpv_remove(pkg)
- pkg_cache.pop(pkg, None)
- aux_get_history.discard(pkg.cpv)
+ self.cpv_discard(pkg)
# Validate counters and timestamps.
slot_counters = {}
@@ -162,9 +170,7 @@ class FakeVartree(vartree):
if counter != pkg.counter or \
mtime != pkg.mtime:
- pkg_vardb.cpv_remove(pkg)
- pkg_cache.pop(pkg, None)
- aux_get_history.discard(pkg.cpv)
+ self.cpv_discard(pkg)
pkg = None
if pkg is None:
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index fa4825c..e4b6926 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -317,10 +317,6 @@ class Scheduler(PollScheduler):
Initialization structures used for dependency calculations
involving currently installed packages.
"""
- # TODO: Replace the BlockerDB with a depgraph of installed packages
- # that's updated incrementally with each upgrade/uninstall operation
- # This will be useful for making quick and safe decisions with respect
- # to aggressive parallelization discussed in bug #279623.
self._set_graph_config(graph_config)
self._blocker_db = {}
for root in self.trees:
@@ -329,6 +325,7 @@ class Scheduler(PollScheduler):
pkg_cache=self._pkg_cache)
else:
fake_vartree = graph_config.trees[root]['vartree']
+ fake_vartree.sync()
self._blocker_db[root] = BlockerDB(fake_vartree)
def _destroy_graph(self):
@@ -643,27 +640,20 @@ class Scheduler(PollScheduler):
def _find_blockers(self, new_pkg):
"""
- Returns a callable which should be called only when
- the vdb lock has been acquired.
+ Returns a callable.
"""
def get_blockers():
- return self._find_blockers_with_lock(new_pkg, acquire_lock=0)
+ return self._find_blockers_impl(new_pkg)
return get_blockers
- def _find_blockers_with_lock(self, new_pkg, acquire_lock=0):
+ def _find_blockers_impl(self, new_pkg):
if self._opts_ignore_blockers.intersection(self.myopts):
return None
- # Call gc.collect() here to avoid heap overflow that
- # triggers 'Cannot allocate memory' errors (reported
- # with python-2.5).
- gc.collect()
-
blocker_db = self._blocker_db[new_pkg.root]
blocker_dblinks = []
- for blocking_pkg in blocker_db.findInstalledBlockers(
- new_pkg, acquire_lock=acquire_lock):
+ for blocking_pkg in blocker_db.findInstalledBlockers(new_pkg):
if new_pkg.slot_atom == blocking_pkg.slot_atom:
continue
if new_pkg.cpv == blocking_pkg.cpv:
@@ -673,8 +663,6 @@ class Scheduler(PollScheduler):
self.pkgsettings[blocking_pkg.root], treetype="vartree",
vartree=self.trees[blocking_pkg.root]["vartree"]))
- gc.collect()
-
return blocker_dblinks
def _dblink_pkg(self, pkg_dblink):
@@ -1527,6 +1515,8 @@ class Scheduler(PollScheduler):
self._completed_tasks.add(pkg)
self._unsatisfied_system_deps.discard(pkg)
self._choose_pkg_return_early = False
+ blocker_db = self._blocker_db[pkg.root]
+ blocker_db.discardBlocker(pkg)
def _merge(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 35faac42c5958278240ffe7cd3e88f1c050f404b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 25 15:57:10 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:21:59 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=35faac42
PollScheduler: handle missing log directory
This can be triggered by AbstractPollTask._log_poll_exception(), as
reported by Michael Haubenwallner <haubi <AT> gentoo.org> for AIX.
---
pym/_emerge/PollScheduler.py | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 8f4bd64..043f02a 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -2,6 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
import gzip
+import errno
import logging
import select
import time
@@ -318,22 +319,32 @@ class PollScheduler(object):
# (like for parallel-fetch), then use the global value.
background = self._background
+ msg_shown = False
if not background:
writemsg_level(msg, level=level, noiselevel=noiselevel)
+ msg_shown = True
if log_path is not None:
- f = open(_unicode_encode(log_path,
- encoding=_encodings['fs'], errors='strict'),
- mode='ab')
-
- if log_path.endswith('.gz'):
- # NOTE: The empty filename argument prevents us from triggering
- # a bug in python3 which causes GzipFile to raise AttributeError
- # if fileobj.name is bytes instead of unicode.
- f = gzip.GzipFile(filename='', mode='ab', fileobj=f)
-
- f.write(_unicode_encode(msg))
- f.close()
+ try:
+ f = open(_unicode_encode(log_path,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='ab')
+ except IOError as e:
+ if e.errno not in (errno.ENOENT, errno.ESTALE):
+ raise
+ if not msg_shown:
+ writemsg_level(msg, level=level, noiselevel=noiselevel)
+ else:
+
+ if log_path.endswith('.gz'):
+ # NOTE: The empty filename argument prevents us from
+ # triggering a bug in python3 which causes GzipFile
+ # to raise AttributeError if fileobj.name is bytes
+ # instead of unicode.
+ f = gzip.GzipFile(filename='', mode='ab', fileobj=f)
+
+ f.write(_unicode_encode(msg))
+ f.close()
_can_poll_device = None
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 918947179b82ceec2c624bcdd5bc8a182dd3a462
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 25 16:52:40 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:22:13 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=91894717
PollScheduler: tweak _unregister event cleanup
---
pym/_emerge/PollScheduler.py | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 043f02a..a2b5c24 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -250,13 +250,17 @@ class PollScheduler(object):
# delivered to a future handler that is using a reallocated
# file descriptor of the same numeric value (causing
# extremely confusing bugs).
- remove = set()
+ remaining_events = []
+ discarded_events = False
for event in self._poll_event_queue:
if event[0] == f:
- remove.add(event)
- if remove:
- self._poll_event_queue[:] = [event for event in \
- self._poll_event_queue if event not in remove]
+ discarded_events = True
+ else:
+ remaining_events.append(event)
+
+ if discarded_events:
+ self._poll_event_queue[:] = remaining_events
+
del self._poll_event_handlers[f]
del self._poll_event_handler_ids[reg_id]
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: af3fffe0d2717c5bfbe8d185479b53d434a72d7e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 07:38:23 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:27:07 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af3fffe0
unmerge: fix PORTAGE_BACKGROUND logic
---
pym/_emerge/actions.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 84ed27c..865c683 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2602,6 +2602,13 @@ def action_uninstall(settings, trees, ldpath_mtimes,
sched._background = sched._background_mode()
sched._status_display.quiet = True
+ if sched._background:
+ sched.settings.unlock()
+ sched.settings["PORTAGE_BACKGROUND"] = "1"
+ sched.settings.backup_changes("PORTAGE_BACKGROUND")
+ sched.settings.lock()
+ sched.pkgsettings[root] = portage.config(clone=sched.settings)
+
if action in ('clean', 'unmerge') or \
(action == 'prune' and "--nodeps" in opts):
# When given a list of atoms, unmerge them in the order given.
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 6c3cbfebdcf5b461d068ac1515bbd297052d8602
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 17:10:24 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:30:15 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6c3cbfeb
Scheduler: pkg_to_replace beware old-style virt
---
pym/_emerge/Scheduler.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index e4b6926..8ee96eb 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1797,7 +1797,8 @@ class Scheduler(PollScheduler):
pkg_to_replace = None
if pkg.operation != "uninstall":
vardb = pkg.root_config.trees["vartree"].dbapi
- previous_cpv = vardb.match(pkg.slot_atom)
+ previous_cpv = [x for x in vardb.match(pkg.slot_atom) \
+ if portage.cpv_getkey(x) == pkg.cp]
if not previous_cpv and vardb.cpv_exists(pkg.cpv):
# same cpv, different SLOT
previous_cpv = [pkg.cpv]
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 82ddeef5eb825e1661d8a6fb0bb6658306671978
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 16:12:38 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:30:02 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=82ddeef5
BlockerDB: add SLOT match in discardBlocker
---
pym/_emerge/BlockerDB.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index f5adc4d..00be370 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -116,4 +116,6 @@ class BlockerDB(object):
def discardBlocker(self, pkg):
"""Discard a package from the list of potential blockers."""
self._fake_vartree.cpv_discard(pkg)
-
+ for slot_match in self._fake_vartree.dbapi.match_pkgs(pkg.slot_atom):
+ if slot_match.cp == pkg.cp:
+ self._fake_vartree.cpv_discard(pkg)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-03-26 19:31 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-03-26 19:31 UTC (permalink / raw
To: gentoo-commits
commit: 82e0688ce7f2e4be0f16ed7dc89da406b1a91a35
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 08:52:49 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 19:29:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=82e0688c
MergeListItem: inherit _poll and _wait
---
pym/_emerge/MergeListItem.py | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index e7856cc..43f733f 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -103,14 +103,6 @@ class MergeListItem(CompositeTask):
self._start_task(binpkg, self._default_final_exit)
return
- def _poll(self):
- self._install_task.poll()
- return self.returncode
-
- def _wait(self):
- self._install_task.wait()
- return self.returncode
-
def merge(self):
pkg = self.pkg
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-04-13 7:52 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-04-13 7:52 UTC (permalink / raw
To: gentoo-commits
commit: d5172fe51828666314acee3e88a881dce02cb99f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 30 18:36:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 07:40:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5172fe5
chk_updated_info_files: handle --quiet
This will fix bug #361257.
---
pym/_emerge/main.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index cc46e6d..e89e8bb 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -114,10 +114,12 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
if not regen_infodirs:
portage.writemsg_stdout("\n")
- out.einfo("GNU info directory index is up-to-date.")
+ if portage.util.noiselimit >= 0:
+ out.einfo("GNU info directory index is up-to-date.")
else:
portage.writemsg_stdout("\n")
- out.einfo("Regenerating GNU info directory index...")
+ if portage.util.noiselimit >= 0:
+ out.einfo("Regenerating GNU info directory index...")
dir_extensions = ("", ".gz", ".bz2")
icount=0
@@ -204,7 +206,7 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
(icount, badcount))
writemsg_level(errmsg, level=logging.ERROR, noiselevel=-1)
else:
- if icount > 0:
+ if icount > 0 and portage.util.noiselimit >= 0:
out.einfo("Processed %d info files." % (icount,))
def display_preserved_libs(vardbapi, myopts):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-04-13 7:52 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-04-13 7:52 UTC (permalink / raw
To: gentoo-commits
commit: 5a14ed9899a6544f791c6476432c5b7280f01875
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 10 20:05:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 07:50:06 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a14ed98
Fix a typo in a comment.
---
pym/_emerge/Scheduler.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index f28d7ef..c9b7c9f 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1376,7 +1376,7 @@ class Scheduler(PollScheduler):
In general, this keeps track of installed system packages with
unsatisfied RDEPEND or PDEPEND (circular dependencies). It can be
a fragile situation, so we don't execute any unrelated builds until
- the circular dependencies are built and intstalled.
+ the circular dependencies are built and installed.
"""
graph = self._digraph
if graph is None:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-04-13 7:52 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-04-13 7:52 UTC (permalink / raw
To: gentoo-commits
commit: e0219e53e37cd1c984d58d0f6ac8925190ffc939
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 10 20:03:11 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 07:49:59 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e0219e53
Scheduler: add more info in docstring comments
This clarifies the purposes of _system_merge_started and _choose_pkg.
---
pym/_emerge/Scheduler.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 8ee96eb..f28d7ef 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1373,6 +1373,10 @@ class Scheduler(PollScheduler):
def _system_merge_started(self, merge):
"""
Add any unsatisfied runtime deps to self._unsatisfied_system_deps.
+ In general, this keeps track of installed system packages with
+ unsatisfied RDEPEND or PDEPEND (circular dependencies). It can be
+ a fragile situation, so we don't execute any unrelated builds until
+ the circular dependencies are built and intstalled.
"""
graph = self._digraph
if graph is None:
@@ -1552,7 +1556,9 @@ class Scheduler(PollScheduler):
def _choose_pkg(self):
"""
- Choose a task that has all it's dependencies satisfied.
+ Choose a task that has all its dependencies satisfied. This is used
+ for parallel build scheduling, and ensures that we don't build
+ anything with deep dependencies that have yet to be merged.
"""
if self._choose_pkg_return_early:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-04-13 7:52 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-04-13 7:52 UTC (permalink / raw
To: gentoo-commits
commit: f7fbe17d589f5d404131e41cff55a68e4fb19df6
Author: David James <davidjames <AT> google <DOT> com>
AuthorDate: Mon Apr 11 19:00:39 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 07:50:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f7fbe17d
Remove unnecessary sync in Scheduler.py.
If we are passed a fakevartree object, it should already be sync'd, so
there is no need to sync it again here. This sync is only needed when
we create a new FakeVartree, so I moved the sync to the right place to
fix this.
BUG=chromium-os:14035
TEST=Build a bunch of packages with this patch.
Change-Id: I89d79cf946f4c0c27ad585ad7c88a41985260342
Review URL: http://codereview.chromium.org/6813084
---
pym/_emerge/Scheduler.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index c9b7c9f..abb4acc 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -323,9 +323,9 @@ class Scheduler(PollScheduler):
if graph_config is None:
fake_vartree = FakeVartree(self.trees[root]["root_config"],
pkg_cache=self._pkg_cache)
+ fake_vartree.sync()
else:
fake_vartree = graph_config.trees[root]['vartree']
- fake_vartree.sync()
self._blocker_db[root] = BlockerDB(fake_vartree)
def _destroy_graph(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: fb6a41d0a48a3fd5f7d7cb805b73235dde0fb331
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 26 20:19:34 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:26:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fb6a41d0
emerge --info: support new-style virtuals
This will fix bug #364673.
---
pym/_emerge/actions.py | 85 +++++++++++++++++++++++++++++++++++-------------
1 files changed, 62 insertions(+), 23 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 865c683..d2b35d5 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1288,6 +1288,40 @@ def action_deselect(settings, trees, opts, atoms):
world_set.unlock()
return os.EX_OK
+def expand_new_virt(vardb, atom, _traversed=None):
+ """
+ Iterate over the recursively expanded RDEPEND atoms of
+ s new-style virtual. If atom is not a new-style virtual
+ or it does not match an installed package then it is
+ yielded without any expansion.
+ """
+ matches = vardb.match(atom)
+ if not (matches and portage.cpv_getkey(matches[-1]).startswith("virtual/")):
+ yield atom
+ return
+
+ virt_cpv = matches[-1]
+ rdepend, use = vardb.aux_get(virt_cpv, ["RDEPEND", "USE"])
+ use = frozenset(use.split())
+ success, atoms = portage.dep_check(rdepend,
+ None, vardb.settings, myuse=use,
+ myroot=vardb.root, trees={vardb.root:{"porttree":vardb.vartree,
+ "vartree":vardb.vartree}})
+
+ if not success:
+ yield atom
+ return
+
+ if _traversed is None:
+ _traversed = set([atom])
+
+ for child1 in atoms:
+ if child1 not in _traversed:
+ _traversed.add(child1)
+ for child2 in expand_new_virt(vardb, child1,
+ _traversed=_traversed):
+ yield child2
+
class _info_pkgs_ver(object):
def __init__(self, ver, repo_suffix, provide_suffix):
self.ver = ver
@@ -1344,15 +1378,25 @@ def action_info(settings, trees, myopts, myfiles):
myvars = ["sys-devel/autoconf", "sys-devel/automake", "virtual/os-headers",
"sys-devel/binutils", "sys-devel/libtool", "dev-lang/python"]
myvars += portage.util.grabfile(settings["PORTDIR"]+"/profiles/info_pkgs")
- myvars = portage.util.unique_array(myvars)
- myvars.sort()
+ atoms = []
+ vardb = trees["/"]["vartree"].dbapi
+ for x in myvars:
+ try:
+ x = Atom(x)
+ except InvalidAtom:
+ writemsg_stdout("%-20s %s\n" % (x+":", "[NOT VALID]"),
+ noiselevel=-1)
+ else:
+ for atom in expand_new_virt(vardb, x):
+ if not atom.blocker:
+ atoms.append((x, atom))
+
+ myvars = sorted(set(atoms))
portdb = trees["/"]["porttree"].dbapi
- vardb = trees["/"]["vartree"].dbapi
main_repo = portdb.getRepositoryName(portdb.porttree_root)
- for x in myvars:
- if portage.isvalidatom(x):
+ for orig_atom, x in myvars:
pkg_matches = vardb.match(x)
versions = []
@@ -1367,10 +1411,10 @@ def action_info(settings, trees, myopts, myfiles):
repo_suffix = "::" + repo
matched_cp = portage.versions.cpv_getkey(cpv)
- if matched_cp == x:
+ if matched_cp == orig_atom.cp:
provide_suffix = ""
else:
- provide_suffix = " (%s)" % matched_cp
+ provide_suffix = " (%s)" % (orig_atom,)
versions.append(
_info_pkgs_ver(ver, repo_suffix, provide_suffix))
@@ -1381,9 +1425,6 @@ def action_info(settings, trees, myopts, myfiles):
versions = ", ".join(ver.toString() for ver in versions)
writemsg_stdout("%-20s %s\n" % (x+":", versions),
noiselevel=-1)
- else:
- writemsg_stdout("%-20s %s\n" % (x+":", "[NOT VALID]"),
- noiselevel=-1)
libtool_vers = ",".join(trees["/"]["vartree"].dbapi.match("sys-devel/libtool"))
@@ -2767,24 +2808,22 @@ def getportageversion(portdir, target_root, profile, chost, vardb):
if profilever is None:
profilever = "unavailable"
- libcver=[]
- libclist = vardb.match("virtual/libc")
- libclist += vardb.match("virtual/glibc")
- libclist = portage.util.unique_array(libclist)
- for x in libclist:
- xs=portage.catpkgsplit(x)
- if libcver:
- libcver+=","+"-".join(xs[1:])
- else:
- libcver="-".join(xs[1:])
- if libcver==[]:
- libcver="unavailable"
+ libcver = []
+ libclist = set()
+ for atom in expand_new_virt(vardb, portage.const.LIBC_PACKAGE_ATOM):
+ if not atom.blocker:
+ libclist.update(vardb.match(atom))
+ if libclist:
+ for cpv in sorted(libclist):
+ libcver.append("-".join(portage.catpkgsplit(cpv)[1:]))
+ else:
+ libcver = ["unavailable"]
gccver = getgccversion(chost)
unameout=platform.release()+" "+platform.machine()
return "Portage %s (%s, %s, %s, %s)" % \
- (portage.VERSION, profilever, gccver, libcver, unameout)
+ (portage.VERSION, profilever, gccver, ",".join(libcver), unameout)
def git_sync_timestamps(settings, portdir):
"""
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: cfbf59de8435dc4a1b74b6e9693a01f1ff686de5
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Tue Apr 26 20:50:03 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:26:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cfbf59de
Fix a typo.
---
pym/_emerge/actions.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index d2b35d5..20b1e3c 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1291,7 +1291,7 @@ def action_deselect(settings, trees, opts, atoms):
def expand_new_virt(vardb, atom, _traversed=None):
"""
Iterate over the recursively expanded RDEPEND atoms of
- s new-style virtual. If atom is not a new-style virtual
+ a new-style virtual. If atom is not a new-style virtual
or it does not match an installed package then it is
yielded without any expansion.
"""
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: ba17e2e1eb19612d189f1dbb1280696acc0ac086
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 26 23:57:20 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:27:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ba17e2e1
expand_new_virt: use stack for recursion
---
pym/_emerge/actions.py | 49 ++++++++++++++++++++++++-----------------------
1 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 20b1e3c..7f228a4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1288,39 +1288,40 @@ def action_deselect(settings, trees, opts, atoms):
world_set.unlock()
return os.EX_OK
-def expand_new_virt(vardb, atom, _traversed=None):
+def expand_new_virt(vardb, atom):
"""
Iterate over the recursively expanded RDEPEND atoms of
a new-style virtual. If atom is not a new-style virtual
or it does not match an installed package then it is
yielded without any expansion.
"""
- matches = vardb.match(atom)
- if not (matches and portage.cpv_getkey(matches[-1]).startswith("virtual/")):
- yield atom
- return
-
- virt_cpv = matches[-1]
- rdepend, use = vardb.aux_get(virt_cpv, ["RDEPEND", "USE"])
- use = frozenset(use.split())
- success, atoms = portage.dep_check(rdepend,
- None, vardb.settings, myuse=use,
- myroot=vardb.root, trees={vardb.root:{"porttree":vardb.vartree,
- "vartree":vardb.vartree}})
+ traversed = set()
+ stack = [atom]
+
+ while stack:
+ atom = stack.pop()
+ matches = vardb.match(atom)
+ if not (matches and \
+ portage.cpv_getkey(matches[-1]).startswith("virtual/")):
+ yield atom
+ continue
- if not success:
- yield atom
- return
+ virt_cpv = matches[-1]
+ if virt_cpv in traversed:
+ continue
- if _traversed is None:
- _traversed = set([atom])
+ traversed.add(virt_cpv)
+ rdepend, use = vardb.aux_get(virt_cpv, ["RDEPEND", "USE"])
+ use = frozenset(use.split())
+ success, atoms = portage.dep_check(rdepend,
+ None, vardb.settings, myuse=use,
+ myroot=vardb.root, trees={vardb.root:{"porttree":vardb.vartree,
+ "vartree":vardb.vartree}})
- for child1 in atoms:
- if child1 not in _traversed:
- _traversed.add(child1)
- for child2 in expand_new_virt(vardb, child1,
- _traversed=_traversed):
- yield child2
+ if success:
+ stack.extend(atoms)
+ else:
+ yield atom
class _info_pkgs_ver(object):
def __init__(self, ver, repo_suffix, provide_suffix):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 4abea4acc567de87264f734428d883fef4e0abb6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 14:35:57 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:27:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4abea4ac
expand_new_virt: validate EAPI, IUSE and USE
---
pym/_emerge/actions.py | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ce52d40..68b8282 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -31,7 +31,7 @@ from portage.cache.cache_errors import CacheError
from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH
from portage.const import _ENABLE_DYN_LINK_MAP
from portage.dbapi.dep_expand import dep_expand
-from portage.dep import Atom, extended_cp_match
+from portage.dep import Atom, extended_cp_match, _get_useflag_re
from portage.exception import InvalidAtom
from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
red, yellow
@@ -1310,10 +1310,31 @@ def expand_new_virt(vardb, atom):
continue
traversed.add(virt_cpv)
- rdepend, use = vardb.aux_get(virt_cpv, ["RDEPEND", "USE"])
- use = frozenset(use.split())
+ eapi, iuse, rdepend, use = vardb.aux_get(virt_cpv,
+ ["EAPI", "IUSE", "RDEPEND", "USE"])
+ if not portage.eapi_is_supported(eapi):
+ yield atom
+ continue
+
+ # Validate IUSE and IUSE, for early detection of vardb corruption.
+ useflag_re = _get_useflag_re(eapi)
+ valid_iuse = []
+ for x in iuse.split():
+ if x[:1] in ("+", "-"):
+ x = x[1:]
+ if useflag_re.match(x) is not None:
+ valid_iuse.append(x)
+ valid_iuse = frozenset(valid_iuse)
+
+ iuse_implicit_match = vardb.settings._iuse_implicit_match
+ valid_use = []
+ for x in use.split():
+ if x in valid_iuse or iuse_implicit_match(x):
+ valid_use.append(x)
+ valid_use = frozenset(valid_use)
+
success, atoms = portage.dep_check(rdepend,
- None, vardb.settings, myuse=use,
+ None, vardb.settings, myuse=valid_use,
myroot=vardb.root, trees={vardb.root:{"porttree":vardb.vartree,
"vartree":vardb.vartree}})
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 55a00a199b363cf214c8526f65aa2f939edf73c8
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 14:05:24 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:27:19 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=55a00a19
expand_new_virt: eliminate cpv_getkey
---
pym/_emerge/actions.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 7f228a4..ce52d40 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1301,8 +1301,7 @@ def expand_new_virt(vardb, atom):
while stack:
atom = stack.pop()
matches = vardb.match(atom)
- if not (matches and \
- portage.cpv_getkey(matches[-1]).startswith("virtual/")):
+ if not (matches and matches[-1].startswith("virtual/")):
yield atom
continue
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: a76dd07a2569eb515855ecc6ce3487d39ff8005d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 16:13:51 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:27:40 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a76dd07a
expand_new_virt: don't traverse blockers
---
pym/_emerge/actions.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 68b8282..1c68298 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1295,11 +1295,17 @@ def expand_new_virt(vardb, atom):
or it does not match an installed package then it is
yielded without any expansion.
"""
+ if not isinstance(atom, Atom):
+ atom = Atom(atom)
traversed = set()
stack = [atom]
while stack:
atom = stack.pop()
+ if atom.blocker:
+ yield atom
+ continue
+
matches = vardb.match(atom)
if not (matches and matches[-1].startswith("virtual/")):
yield atom
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 152dc1470136e8594178741099955d5722034fa1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 12:58:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:33:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=152dc147
emerge: fix indent for --binpkg-respect-use help
---
pym/_emerge/help.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index a120f54..bc7811d 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -327,7 +327,7 @@ def help(myopts, havecolor=1):
for line in wrap(desc, desc_width):
print(desc_indent + line)
print()
- print(" " + green("--binpkg-respect-use") + " [ %s | %s ]" % \
+ print(" " + green("--binpkg-respect-use") + " [ %s | %s ]" % \
(turquoise("y"), turquoise("n")))
desc = "Tells emerge to ignore binary packages if their use flags" + \
" don't match the current configuration. (default: 'n')"
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 329564d1ecaff96f894283200906c2c22a1ede7e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 21:07:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:34:07 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=329564d1
display_preserved_libs: load plib_registry
Since commit 7535cabdf2fab76fc55df83643157613dfd66be9, the
plib_registry is modified in a subprocess, and the parent
process' copy can become stale because of this. Therefore,
explicitly load it.
---
pym/_emerge/main.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index fa83556..7d7fee2 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -217,7 +217,9 @@ def display_preserved_libs(vardbapi, myopts):
# preserve-libs is entirely disabled
return
- # Ensure the registry is consistent with existing files.
+ # Explicitly load and prune the PreservedLibsRegistry in order
+ # to ensure that we do not display stale data.
+ vardbapi._plib_registry.load()
vardbapi._plib_registry.pruneNonExisting()
if vardbapi._plib_registry.hasEntries():
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 7d2833a7b0650a3a51190619a993315143ab1b04
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 29 16:07:25 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:47:07 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d2833a7
emergelog: only set permission on creation
This will fix bug #365319.
---
pym/_emerge/emergelog.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index 4006530..dde662e 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -32,13 +32,15 @@ def emergelog(xterm_titles, mystr, short_msg=None):
xtermTitle(short_msg)
try:
file_path = os.path.join(_emerge_log_dir, 'emerge.log')
+ existing_log = os.path.isfile(file_path)
mylogfile = codecs.open(_unicode_encode(file_path,
encoding=_encodings['fs'], errors='strict'),
mode='a', encoding=_encodings['content'],
errors='backslashreplace')
- portage.util.apply_secpass_permissions(file_path,
- uid=portage.portage_uid, gid=portage.portage_gid,
- mode=0o660)
+ if not existing_log:
+ portage.util.apply_secpass_permissions(file_path,
+ uid=portage.portage_uid, gid=portage.portage_gid,
+ mode=0o660)
mylock = None
try:
mylock = portage.locks.lockfile(mylogfile)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 5a26bb626213d5db94c1b9c2121f3d8b838c3d7d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 29 15:04:13 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:37:57 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a26bb62
action_info: eliminate duplicate info_pkgs match
Currently, sys-kernel/linux-headers is matched by both a plain
sys-kernel/linux-headers atom and by the virtual/os-headers new-style
virtual. For backward compatibility, we're going to have duplicates
like this for at least a few months (see bug #364673, comment #5).
Therefore, automatically eliminate duplicates in the display. Entries
that include virtual provider info are preferred over those that do
not.
---
pym/_emerge/actions.py | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 1c68298..47db134 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1422,13 +1422,26 @@ def action_info(settings, trees, myopts, myfiles):
portdb = trees["/"]["porttree"].dbapi
main_repo = portdb.getRepositoryName(portdb.porttree_root)
+ cp_map = {}
+ cp_max_len = 0
for orig_atom, x in myvars:
pkg_matches = vardb.match(x)
versions = []
for cpv in pkg_matches:
+ matched_cp = portage.versions.cpv_getkey(cpv)
ver = portage.versions.cpv_getversion(cpv)
+ ver_map = cp_map.setdefault(matched_cp, {})
+ prev_match = ver_map.get(ver)
+ if prev_match is not None:
+ if prev_match.provide_suffix:
+ # prefer duplicate matches that include
+ # additional virtual provider info
+ continue
+
+ if len(matched_cp) > cp_max_len:
+ cp_max_len = len(matched_cp)
repo = vardb.aux_get(cpv, ["repository"])[0]
if repo == main_repo:
repo_suffix = ""
@@ -1436,22 +1449,20 @@ def action_info(settings, trees, myopts, myfiles):
repo_suffix = "::<unknown repository>"
else:
repo_suffix = "::" + repo
-
- matched_cp = portage.versions.cpv_getkey(cpv)
+
if matched_cp == orig_atom.cp:
provide_suffix = ""
else:
provide_suffix = " (%s)" % (orig_atom,)
- versions.append(
- _info_pkgs_ver(ver, repo_suffix, provide_suffix))
-
- versions.sort()
+ ver_map[ver] = _info_pkgs_ver(ver, repo_suffix, provide_suffix)
- if versions:
- versions = ", ".join(ver.toString() for ver in versions)
- writemsg_stdout("%-20s %s\n" % (x+":", versions),
- noiselevel=-1)
+ for cp in sorted(cp_map):
+ versions = sorted(cp_map[cp].values())
+ versions = ", ".join(ver.toString() for ver in versions)
+ writemsg_stdout("%s %s\n" % \
+ ((cp + ":").ljust(cp_max_len + 1), versions),
+ noiselevel=-1)
libtool_vers = ",".join(trees["/"]["vartree"].dbapi.match("sys-devel/libtool"))
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 8ec7366c3099fdbfd8619704ad219239466e963e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 20:38:00 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:48:09 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8ec7366c
depgraph: migrate implicit libc deps from Sched
Now all the virtual/libc handling is done by the depgraph, which
will be helpful when fixing bug #364681.
---
pym/_emerge/Scheduler.py | 65 ----------------------------------------------
pym/_emerge/depgraph.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index abb4acc..1b79623 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -22,7 +22,6 @@ from portage import os
from portage import _encodings
from portage import _unicode_decode, _unicode_encode
from portage.cache.mappings import slot_dict_class
-from portage.const import LIBC_PACKAGE_ATOM
from portage.elog.messages import eerror
from portage.localization import _
from portage.output import colorize, create_color_func, red
@@ -476,7 +475,6 @@ class Scheduler(PollScheduler):
self._find_system_deps()
self._prune_digraph()
self._prevent_builddir_collisions()
- self._implicit_libc_deps()
if '--debug' in self.myopts:
writemsg("\nscheduler digraph:\n\n", noiselevel=-1)
self._digraph.debug_print()
@@ -542,69 +540,6 @@ class Scheduler(PollScheduler):
priority=DepPriority(buildtime=True))
cpv_map[pkg.cpv].append(pkg)
- def _implicit_libc_deps(self):
- """
- Create implicit dependencies on libc, in order to ensure that libc
- is installed as early as possible (see bug #303567). If the merge
- list contains both a new-style virtual and an old-style PROVIDE
- virtual, the new-style virtual is used.
- """
- implicit_libc_roots = set([self._running_root.root])
- libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
- norm_libc_pkgs = {}
- virt_libc_pkgs = {}
- for pkg in self._mergelist:
- if not isinstance(pkg, Package):
- # a satisfied blocker
- continue
- if pkg.installed:
- continue
- if pkg.root in implicit_libc_roots and \
- pkg.operation == 'merge':
- if libc_set.findAtomForPackage(pkg):
- if pkg.category == 'virtual':
- d = virt_libc_pkgs
- else:
- d = norm_libc_pkgs
- if pkg.root in d:
- raise AssertionError(
- "found 2 libc matches: %s and %s" % \
- (d[pkg.root], pkg))
- d[pkg.root] = pkg
-
- # Prefer new-style virtuals over old-style PROVIDE virtuals.
- libc_pkg_map = norm_libc_pkgs.copy()
- libc_pkg_map.update(virt_libc_pkgs)
-
- # Only add a dep when the version changes.
- for libc_pkg in list(libc_pkg_map.values()):
- if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
- libc_pkg.cpv):
- del libc_pkg_map[pkg.root]
-
- if not libc_pkg_map:
- return
-
- libc_pkgs = set(libc_pkg_map.values())
- earlier_libc_pkgs = set()
-
- for pkg in self._mergelist:
- if not isinstance(pkg, Package):
- # a satisfied blocker
- continue
- if pkg.installed:
- continue
- if pkg.root in implicit_libc_roots and \
- pkg.operation == 'merge':
- if pkg in libc_pkgs:
- earlier_libc_pkgs.add(pkg)
- else:
- my_libc = libc_pkg_map.get(pkg.root)
- if my_libc is not None and \
- my_libc in earlier_libc_pkgs:
- self._digraph.add(my_libc, pkg,
- priority=DepPriority(buildtime=True))
-
class _pkg_failure(portage.exception.PortageException):
"""
An instance of this class is raised by unmerge() when
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e0c3e22..913d5ee 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4102,6 +4102,69 @@ class depgraph(object):
retlist.reverse()
return retlist
+ def _implicit_libc_deps(self, mergelist, graph):
+ """
+ Create implicit dependencies on libc, in order to ensure that libc
+ is installed as early as possible (see bug #303567). If the merge
+ list contains both a new-style virtual and an old-style PROVIDE
+ virtual, the new-style virtual is used.
+ """
+ implicit_libc_roots = set([self._frozen_config._running_root.root])
+ libc_set = InternalPackageSet([portage.const.LIBC_PACKAGE_ATOM])
+ norm_libc_pkgs = {}
+ virt_libc_pkgs = {}
+ for pkg in mergelist:
+ if not isinstance(pkg, Package):
+ # a satisfied blocker
+ continue
+ if pkg.installed:
+ continue
+ if pkg.root in implicit_libc_roots and \
+ pkg.operation == 'merge':
+ if libc_set.findAtomForPackage(pkg):
+ if pkg.category == 'virtual':
+ d = virt_libc_pkgs
+ else:
+ d = norm_libc_pkgs
+ if pkg.root in d:
+ raise AssertionError(
+ "found 2 libc matches: %s and %s" % \
+ (d[pkg.root], pkg))
+ d[pkg.root] = pkg
+
+ # Prefer new-style virtuals over old-style PROVIDE virtuals.
+ libc_pkg_map = norm_libc_pkgs.copy()
+ libc_pkg_map.update(virt_libc_pkgs)
+
+ # Only add a dep when the version changes.
+ for libc_pkg in list(libc_pkg_map.values()):
+ if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
+ libc_pkg.cpv):
+ del libc_pkg_map[pkg.root]
+
+ if not libc_pkg_map:
+ return
+
+ libc_pkgs = set(libc_pkg_map.values())
+ earlier_libc_pkgs = set()
+
+ for pkg in mergelist:
+ if not isinstance(pkg, Package):
+ # a satisfied blocker
+ continue
+ if pkg.installed:
+ continue
+ if pkg.root in implicit_libc_roots and \
+ pkg.operation == 'merge':
+ if pkg in libc_pkgs:
+ earlier_libc_pkgs.add(pkg)
+ else:
+ my_libc = libc_pkg_map.get(pkg.root)
+ if my_libc is not None and \
+ my_libc in earlier_libc_pkgs:
+ graph.add(my_libc, pkg,
+ priority=DepPriority(buildtime=True))
+
def schedulerGraph(self):
"""
The scheduler graph is identical to the normal one except that
@@ -4119,6 +4182,8 @@ class depgraph(object):
# NOTE: altlist initializes self._dynamic_config._scheduler_graph
mergelist = self.altlist()
+ self._implicit_libc_deps(mergelist,
+ self._dynamic_config._scheduler_graph)
self.break_refs(mergelist)
self.break_refs(self._dynamic_config._scheduler_graph.order)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: c5cd596143d23163f183271fb43a46668f40193b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 2 01:42:32 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:51:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c5cd5961
depgraph: account for new-style virtual/libc
This will fix bug #364681.
---
pym/_emerge/depgraph.py | 164 ++++++++++++++++++++++++++--------------------
1 files changed, 93 insertions(+), 71 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 913d5ee..5d715a2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2289,6 +2289,39 @@ class depgraph(object):
return selected_atoms
+ def _expand_virt_from_graph(self, root, atom):
+ if not isinstance(atom, Atom):
+ atom = Atom(atom)
+ graphdb = self._dynamic_config.mydbapi[root]
+ match = graphdb.match_pkgs(atom)
+ if not match:
+ yield atom
+ return
+ pkg = match[-1]
+ if not pkg.cpv.startswith("virtual/"):
+ yield atom
+ return
+ try:
+ rdepend = self._select_atoms_from_graph(
+ pkg.root, pkg.metadata.get("RDEPEND", ""),
+ myuse=self._pkg_use_enabled(pkg),
+ parent=pkg, strict=False)
+ except InvalidDependString as e:
+ writemsg_level("!!! Invalid RDEPEND in " + \
+ "'%svar/db/pkg/%s/RDEPEND': %s\n" % \
+ (pkg.root, pkg.cpv, e),
+ noiselevel=-1, level=logging.ERROR)
+ yield atom
+ return
+
+ for atoms in rdepend.values():
+ for atom in atoms:
+ if hasattr(atom, "_orig_atom"):
+ # Ignore virtual atoms since we're only
+ # interested in expanding the real atoms.
+ continue
+ yield atom
+
def _get_dep_chain(self, start_node, target_atom=None,
unsatisfied_dependency=False):
"""
@@ -4105,65 +4138,44 @@ class depgraph(object):
def _implicit_libc_deps(self, mergelist, graph):
"""
Create implicit dependencies on libc, in order to ensure that libc
- is installed as early as possible (see bug #303567). If the merge
- list contains both a new-style virtual and an old-style PROVIDE
- virtual, the new-style virtual is used.
+ is installed as early as possible (see bug #303567).
"""
- implicit_libc_roots = set([self._frozen_config._running_root.root])
- libc_set = InternalPackageSet([portage.const.LIBC_PACKAGE_ATOM])
- norm_libc_pkgs = {}
- virt_libc_pkgs = {}
- for pkg in mergelist:
- if not isinstance(pkg, Package):
- # a satisfied blocker
- continue
- if pkg.installed:
- continue
- if pkg.root in implicit_libc_roots and \
- pkg.operation == 'merge':
- if libc_set.findAtomForPackage(pkg):
- if pkg.category == 'virtual':
- d = virt_libc_pkgs
- else:
- d = norm_libc_pkgs
- if pkg.root in d:
- raise AssertionError(
- "found 2 libc matches: %s and %s" % \
- (d[pkg.root], pkg))
- d[pkg.root] = pkg
-
- # Prefer new-style virtuals over old-style PROVIDE virtuals.
- libc_pkg_map = norm_libc_pkgs.copy()
- libc_pkg_map.update(virt_libc_pkgs)
-
- # Only add a dep when the version changes.
- for libc_pkg in list(libc_pkg_map.values()):
- if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
- libc_pkg.cpv):
- del libc_pkg_map[pkg.root]
-
- if not libc_pkg_map:
+ libc_pkgs = {}
+ implicit_libc_roots = (self._frozen_config._running_root.root,)
+ for root in implicit_libc_roots:
+ graphdb = self._dynamic_config.mydbapi[root]
+ vardb = self._frozen_config.trees[root]["vartree"].dbapi
+ for atom in self._expand_virt_from_graph(root,
+ portage.const.LIBC_PACKAGE_ATOM):
+ if atom.blocker:
+ continue
+ match = graphdb.match_pkgs(atom)
+ if not match:
+ continue
+ pkg = match[-1]
+ if pkg.operation == "merge" and \
+ not vardb.cpv_exists(pkg.cpv):
+ libc_pkgs.setdefault(pkg.root, set()).add(pkg)
+
+ if not libc_pkgs:
return
- libc_pkgs = set(libc_pkg_map.values())
earlier_libc_pkgs = set()
for pkg in mergelist:
if not isinstance(pkg, Package):
# a satisfied blocker
continue
- if pkg.installed:
- continue
- if pkg.root in implicit_libc_roots and \
- pkg.operation == 'merge':
- if pkg in libc_pkgs:
+ root_libc_pkgs = libc_pkgs.get(pkg.root)
+ if root_libc_pkgs is not None and \
+ pkg.operation == "merge":
+ if pkg in root_libc_pkgs:
earlier_libc_pkgs.add(pkg)
else:
- my_libc = libc_pkg_map.get(pkg.root)
- if my_libc is not None and \
- my_libc in earlier_libc_pkgs:
- graph.add(my_libc, pkg,
- priority=DepPriority(buildtime=True))
+ for libc_pkg in root_libc_pkgs:
+ if libc_pkg in earlier_libc_pkgs:
+ graph.add(libc_pkg, pkg,
+ priority=DepPriority(buildtime=True))
def schedulerGraph(self):
"""
@@ -4380,29 +4392,39 @@ class depgraph(object):
# Merge libc asap, in order to account for implicit
# dependencies. See bug #303567.
- for root in (running_root,):
- libc_pkg = self._dynamic_config.mydbapi[root].match_pkgs(
- portage.const.LIBC_PACKAGE_ATOM)
- if libc_pkg:
- libc_pkg = libc_pkg[0]
- if libc_pkg.operation == 'merge':
- # Only add a dep when the version changes.
- if not libc_pkg.root_config.trees[
- 'vartree'].dbapi.cpv_exists(libc_pkg.cpv):
-
- # If there's also an os-headers upgrade, we need to
- # pull that in first. See bug #328317.
- os_headers_pkg = self._dynamic_config.mydbapi[root].match_pkgs(
- portage.const.OS_HEADERS_PACKAGE_ATOM)
- if os_headers_pkg:
- os_headers_pkg = os_headers_pkg[0]
- if os_headers_pkg.operation == 'merge':
- # Only add a dep when the version changes.
- if not os_headers_pkg.root_config.trees[
- 'vartree'].dbapi.cpv_exists(os_headers_pkg.cpv):
- asap_nodes.append(os_headers_pkg)
-
- asap_nodes.append(libc_pkg)
+ implicit_libc_roots = (running_root,)
+ for root in implicit_libc_roots:
+ libc_pkgs = set()
+ vardb = self._frozen_config.trees[root]["vartree"].dbapi
+ graphdb = self._dynamic_config.mydbapi[root]
+ for atom in self._expand_virt_from_graph(root,
+ portage.const.LIBC_PACKAGE_ATOM):
+ if atom.blocker:
+ continue
+ match = graphdb.match_pkgs(atom)
+ if not match:
+ continue
+ pkg = match[-1]
+ if pkg.operation == "merge" and \
+ not vardb.cpv_exists(pkg.cpv):
+ libc_pkgs.add(pkg)
+
+ if libc_pkgs:
+ # If there's also an os-headers upgrade, we need to
+ # pull that in first. See bug #328317.
+ for atom in self._expand_virt_from_graph(root,
+ portage.const.OS_HEADERS_PACKAGE_ATOM):
+ if atom.blocker:
+ continue
+ match = graphdb.match_pkgs(atom)
+ if not match:
+ continue
+ pkg = match[-1]
+ if pkg.operation == "merge" and \
+ not vardb.cpv_exists(pkg.cpv):
+ asap_nodes.append(pkg)
+
+ asap_nodes.extend(libc_pkgs)
def gather_deps(ignore_priority, mergeable_nodes,
selected_nodes, node):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 49e33a6336ad909ced1eb53240b5825aa7ae298e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 2 19:34:21 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:53:47 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=49e33a63
depgraph: autounmask account for optional deps
---
pym/_emerge/depgraph.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5d715a2..8750a18 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1221,6 +1221,20 @@ class depgraph(object):
def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string,
allow_unsatisfied, ignore_blockers=False):
+ _autounmask_backup = self._dynamic_config._autounmask
+ if dep_priority.optional:
+ # Temporarily disable autounmask for deps that
+ # don't necessarily need to be satisfied.
+ self._dynamic_config._autounmask = False
+ try:
+ return self._wrapped_add_pkg_dep_string(
+ pkg, dep_root, dep_priority, dep_string,
+ allow_unsatisfied, ignore_blockers=ignore_blockers)
+ finally:
+ self._dynamic_config._autounmask = _autounmask_backup
+
+ def _wrapped_add_pkg_dep_string(self, pkg, dep_root, dep_priority,
+ dep_string, allow_unsatisfied, ignore_blockers=False):
depth = pkg.depth + 1
deep = self._dynamic_config.myparams.get("deep", 0)
recurse_satisfied = deep is True or depth <= deep
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: 9f8c5b27515e6663403c465a88df761235ce513b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 2 19:54:54 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:54:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f8c5b27
emerge: skip misspell suggestion if cp exists
---
pym/_emerge/depgraph.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8750a18..b230635 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2792,8 +2792,16 @@ class depgraph(object):
writemsg_stdout("\n", noiselevel=-1)
mask_docs = True
else:
+ cp_exists = False
+ if not atom.cp.startswith("null/"):
+ for pkg in self._iter_match_pkgs_any(
+ root_config, Atom(atom.cp)):
+ cp_exists = True
+ break
+
writemsg_stdout("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
if isinstance(myparent, AtomArg) and \
+ not cp_exists and \
self._frozen_config.myopts.get(
"--misspell-suggestions", "y") != "n":
cp = myparent.atom.cp.lower()
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-05 16:01 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-05 16:01 UTC (permalink / raw
To: gentoo-commits
commit: 62e95606f6000ff133d95d7369de65ad0de25168
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 5 15:58:22 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 5 16:00:40 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62e95606
emerge: fix misspell suggestion with category
A name collision in the "cp" variable caused it to malfunction.
---
pym/_emerge/depgraph.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b230635..9e7b0bb 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2819,9 +2819,8 @@ class depgraph(object):
all_cp.update(bindb.cp_all())
orig_cp_map = {}
- for cp in all_cp:
- cp_lower = cp.lower()
- orig_cp_map.setdefault(cp_lower, []).append(cp)
+ for cp_orig in all_cp:
+ orig_cp_map.setdefault(cp_orig.lower(), []).append(cp_orig)
all_cp = set(orig_cp_map)
if cat:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-05 18:12 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-05 18:12 UTC (permalink / raw
To: gentoo-commits
commit: c603773283a5288c702a742a0eb2b10f49915809
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 5 17:21:43 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 5 18:10:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6037732
depgraph: simplify break_refs
---
pym/_emerge/RootConfig.py | 10 +++++++++-
pym/_emerge/depgraph.py | 34 ++++++++++++++--------------------
2 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/pym/_emerge/RootConfig.py b/pym/_emerge/RootConfig.py
index 110f116..d84f108 100644
--- a/pym/_emerge/RootConfig.py
+++ b/pym/_emerge/RootConfig.py
@@ -1,9 +1,10 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
class RootConfig(object):
"""This is used internally by depgraph to track information about a
particular $ROOT."""
+ __slots__ = ("root", "setconfig", "sets", "settings", "trees")
pkg_tree_map = {
"ebuild" : "porttree",
@@ -24,3 +25,10 @@ class RootConfig(object):
self.sets = {}
else:
self.sets = self.setconfig.getSets()
+
+ def update(self, other):
+ """
+ Shallow copy all attributes from another instance.
+ """
+ for k in self.__slots__:
+ setattr(self, k, getattr(other, k))
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9e7b0bb..23197db 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4217,8 +4217,6 @@ class depgraph(object):
mergelist = self.altlist()
self._implicit_libc_deps(mergelist,
self._dynamic_config._scheduler_graph)
- self.break_refs(mergelist)
- self.break_refs(self._dynamic_config._scheduler_graph.order)
# Break DepPriority.satisfied attributes which reference
# installed Package instances.
@@ -4240,31 +4238,27 @@ class depgraph(object):
for root in trees:
trees[root]['vartree']._pkg_cache = pruned_pkg_cache
- self.break_refs(trees[root]['vartree'].dbapi)
- self.break_refs(pruned_pkg_cache)
+ self.break_refs()
sched_config = \
_scheduler_graph_config(trees, pruned_pkg_cache, graph, mergelist)
return sched_config
- def break_refs(self, nodes):
+ def break_refs(self):
"""
- Take a mergelist like that returned from self.altlist() and
- break any references that lead back to the depgraph. This is
- useful if you want to hold references to packages without
- also holding the depgraph on the heap.
+ Break any references in Package instances that lead back to the depgraph.
+ This is useful if you want to hold references to packages without also
+ holding the depgraph on the heap. It should only be called after the
+ depgraph will not be used for any more calculations.
"""
- for node in nodes:
- if hasattr(node, "root_config"):
- # The FakeVartree references the _package_cache which
- # references the depgraph. So that Package instances don't
- # hold the depgraph and FakeVartree on the heap, replace
- # the RootConfig that references the FakeVartree with the
- # original RootConfig instance which references the actual
- # vartree.
- node.root_config = \
- self._frozen_config._trees_orig[node.root_config.root]["root_config"]
+ for root_config in self._frozen_config.roots.values():
+ root_config.update(self._frozen_config._trees_orig[
+ root_config.root]["root_config"])
+ # Both instances are now identical, so discard the
+ # original which should have no other references.
+ self._frozen_config._trees_orig[
+ root_config.root]["root_config"] = root_config
def _resolve_conflicts(self):
if not self._complete_graph():
@@ -6029,7 +6023,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
# package has already been installed.
dropped_tasks.update(pkg for pkg in \
unsatisfied_parents if pkg.operation != "nomerge")
- mydepgraph.break_refs(unsatisfied_parents)
+ mydepgraph.break_refs()
del e, graph, traversed_nodes, \
unsatisfied_parents, unsatisfied_stack
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-08 20:50 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-08 20:50 UTC (permalink / raw
To: gentoo-commits
commit: 7a2cef7d74ec6fe48b88803e1300cc77c687e922
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 7 03:28:21 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 8 18:42:24 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a2cef7d
Remove redundant pruneNonExisting() call.
Since commit f36b9fa38b5268c2a5579db62acec026625f84a9, the
PreservedLibsRegistry automatically prunes itself each time
that it is loaded.
---
pym/_emerge/main.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 7d7fee2..5e6c312 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -220,7 +220,6 @@ def display_preserved_libs(vardbapi, myopts):
# Explicitly load and prune the PreservedLibsRegistry in order
# to ensure that we do not display stale data.
vardbapi._plib_registry.load()
- vardbapi._plib_registry.pruneNonExisting()
if vardbapi._plib_registry.hasEntries():
if "--quiet" in myopts:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-08 20:50 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-08 20:50 UTC (permalink / raw
To: gentoo-commits
commit: 4bebd088c43db654e69661979d2e2d29a3073cd2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 8 18:24:40 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 8 18:55:41 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4bebd088
resume_depgraph: don't call break_refs in loop
The break_refs call was unnecessary and it broke the state of the
frozen_config instance, causing the following error:
File "pym/_emerge/depgraph.py", line 1290, in
_wrapped_add_pkg_dep_string
inst_pkgs = vardb.match_pkgs(atom)
AttributeError: 'vardbapi' object has no attribute 'match_pkgs'
---
pym/_emerge/depgraph.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 23197db..0c36e3a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4250,7 +4250,7 @@ class depgraph(object):
Break any references in Package instances that lead back to the depgraph.
This is useful if you want to hold references to packages without also
holding the depgraph on the heap. It should only be called after the
- depgraph will not be used for any more calculations.
+ depgraph and _frozen_config will not be used for any more calculations.
"""
for root_config in self._frozen_config.roots.values():
root_config.update(self._frozen_config._trees_orig[
@@ -6023,7 +6023,6 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
# package has already been installed.
dropped_tasks.update(pkg for pkg in \
unsatisfied_parents if pkg.operation != "nomerge")
- mydepgraph.break_refs()
del e, graph, traversed_nodes, \
unsatisfied_parents, unsatisfied_stack
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-08 20:50 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-08 20:50 UTC (permalink / raw
To: gentoo-commits
commit: 1c8ec672ea685d346e355b7e44416b2258bc66bd
Author: David James <davidjames <AT> chromium <DOT> org>
AuthorDate: Sun May 8 06:08:01 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 8 18:54:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1c8ec672
Use new vardbapi lock function in FakeVartree.
BUG=none
TEST=Merged some packages with new code. Ran test suite.
Change-Id: Ibb9380122631bf6c79e39691233cfd641931b75a
---
pym/_emerge/FakeVartree.py | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 919770b..db31535 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -116,20 +116,15 @@ class FakeVartree(vartree):
after one or more packages may have been installed or
uninstalled.
"""
- vdb_path = os.path.join(self.settings['EROOT'], portage.VDB_PATH)
+ locked = False
try:
- # At least the parent needs to exist for the lock file.
- portage.util.ensure_dirs(vdb_path)
- except portage.exception.PortageException:
- pass
- vdb_lock = None
- try:
- if acquire_lock and os.access(vdb_path, os.W_OK):
- vdb_lock = portage.locks.lockdir(vdb_path)
+ if acquire_lock and os.access(self._real_vardb._dbroot, os.W_OK):
+ self._real_vardb.lock()
+ locked = True
self._sync()
finally:
- if vdb_lock:
- portage.locks.unlockdir(vdb_lock)
+ if locked:
+ self._real_vardb.unlock()
# Populate the old-style virtuals using the cached values.
# Skip the aux_get wrapper here, to avoid unwanted
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-08 20:50 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-08 20:50 UTC (permalink / raw
To: gentoo-commits
commit: 87077a5c26fb164e7db172b380111694855bc4a0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 8 05:58:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 8 18:53:43 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87077a5c
Be careful with system pkgs + parallel-install.
This should prevent FEATURES=parallel-install from interfering with
the fixes from bug #256616 and bug #259954.
---
pym/_emerge/Scheduler.py | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 1b79623..e71f4f6 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -3,6 +3,7 @@
from __future__ import print_function
+from collections import deque
import gc
import gzip
import logging
@@ -176,8 +177,9 @@ class Scheduler(PollScheduler):
# Holds merges that will wait to be executed when no builds are
# executing. This is useful for system packages since dependencies
- # on system packages are frequently unspecified.
- self._merge_wait_queue = []
+ # on system packages are frequently unspecified. For example, see
+ # bug #256616.
+ self._merge_wait_queue = deque()
# Holds merges that have been transfered from the merge_wait_queue to
# the actual merge queue. They are removed from this list upon
# completion. Other packages can start building only when this list is
@@ -1631,14 +1633,19 @@ class Scheduler(PollScheduler):
while True:
- # When the number of jobs drops to zero, process all waiting merges.
- if not self._jobs and self._merge_wait_queue:
- for task in self._merge_wait_queue:
- task.addExitListener(self._merge_wait_exit_handler)
- self._task_queues.merge.add(task)
+ # When the number of jobs and merges drops to zero,
+ # process a single merge from _merge_wait_queue if
+ # it's not empty. We only process one since these are
+ # special packages and we want to ensure that
+ # parallel-install does not cause more than one of
+ # them to install at the same time.
+ if (self._merge_wait_queue and not self._jobs and
+ not self._task_queues.merge):
+ task = self._merge_wait_queue.popleft()
+ task.addExitListener(self._merge_wait_exit_handler)
+ self._task_queues.merge.add(task)
self._status_display.merges = len(self._task_queues.merge)
- self._merge_wait_scheduled.extend(self._merge_wait_queue)
- del self._merge_wait_queue[:]
+ self._merge_wait_scheduled.append(task)
self._schedule_tasks_imp()
self._status_display.display()
@@ -1657,7 +1664,8 @@ class Scheduler(PollScheduler):
state_change += 1
if not (state_change or \
- (not self._jobs and self._merge_wait_queue)):
+ (self._merge_wait_queue and not self._jobs and
+ not self._task_queues.merge)):
break
return self._keep_scheduling()
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-08 20:50 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-08 20:50 UTC (permalink / raw
To: gentoo-commits
commit: 35b332ecbf426ec660477bf8d457f1e07c6c8ec7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 8 19:05:49 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 8 19:07:15 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=35b332ec
merge_wait_queue: use deque.clear()
---
pym/_emerge/Scheduler.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index e71f4f6..14b89a8 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -304,7 +304,7 @@ class Scheduler(PollScheduler):
if self._merge_wait_queue:
for merge in self._merge_wait_queue:
self._running_tasks.remove(merge.merge.pkg)
- del self._merge_wait_queue[:]
+ self._merge_wait_queue.clear()
for merge in self._task_queues.merge._task_queue:
# Setup phases may be scheduled in this queue, but
# we're only interested in the PackageMerge instances.
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: e8025f33863bad51bc5dbebb45e0d561469b2596
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 9 06:08:43 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:09:11 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e8025f33
unmerge: skip getvirtuals() if cat is not virtual
This allows us to avoid triggering the old-style virtual code which
scans /var/db/pkg/*/*/PROVIDE.
---
pym/_emerge/unmerge.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 7e66ff9..6c0ef8d 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -67,8 +67,14 @@ def unmerge(root_config, myopts, unmerge_action,
syslist = []
for x in realsyslist:
- mycp = portage.dep_getkey(x)
- if mycp in settings.getvirtuals():
+ mycp = x.cp
+ # Since Gentoo stopped using old-style virtuals in
+ # 2011, typically it's possible to avoid getvirtuals()
+ # calls entirely. It will not be triggered here by
+ # new-style virtuals since those are expanded to
+ # non-virtual atoms above by expand_new_virt().
+ if mycp.startswith("virtual/") and \
+ mycp in settings.getvirtuals():
providers = []
for provider in settings.getvirtuals()[mycp]:
if vartree.dbapi.match(provider):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: 632ca01e73e148cde1178d7490f3b5ceb2e977bd
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 9 06:27:39 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:09:28 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=632ca01e
display_news_notification: don't populate virts
This typically isn't useful anymore, since Gentoo has stopped using
old-style virtuals.
---
pym/_emerge/actions.py | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 3710f7f..bab39b9 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2995,10 +2995,6 @@ def display_news_notification(root_config, myopts):
if "news" not in settings.features:
return
- # Populate these using our existing vartree, to avoid
- # having a temporary one instantiated.
- settings._populate_treeVirtuals_if_needed(trees["vartree"])
-
for repo in portdb.getRepositories():
unreadItems = checkUpdatedNewsItems(
portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=update)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: dd1e101308407c1420373203fa75f7a814bd1d33
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 10 01:03:27 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:11:40 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd1e1013
dep_check_composite_db: remove unused _dep_expand
This code has been unused since dep_check started passing
token_class=Atom to use_reduce in commit
c9f7930883d62fc26af72bff0c4623db0bbc8221. Since then, any atoms
without categories are dropped by dep_check because it returns
early after catching an InvalidDependString exception.
---
pym/_emerge/depgraph.py | 42 +-----------------------------------------
1 files changed, 1 insertions(+), 41 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index acf941e..bd72631 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5693,9 +5693,6 @@ class _dep_check_composite_db(dbapi):
ret = self._match_cache.get(atom)
if ret is not None:
return ret[:]
- orig_atom = atom
- if "/" not in atom:
- atom = self._dep_expand(atom)
pkg, existing = self._depgraph._select_package(self._root, atom)
if not pkg:
ret = []
@@ -5735,7 +5732,7 @@ class _dep_check_composite_db(dbapi):
ret.append(pkg.cpv)
if ret:
self._cpv_sort_ascending(ret)
- self._match_cache[orig_atom] = ret
+ self._match_cache[atom] = ret
return ret[:]
def _visible(self, pkg):
@@ -5790,43 +5787,6 @@ class _dep_check_composite_db(dbapi):
return False
return True
- def _dep_expand(self, atom):
- """
- This is only needed for old installed packages that may
- contain atoms that are not fully qualified with a specific
- category. Emulate the cpv_expand() function that's used by
- dbapi.match() in cases like this. If there are multiple
- matches, it's often due to a new-style virtual that has
- been added, so try to filter those out to avoid raising
- a ValueError.
- """
- root_config = self._depgraph.roots[self._root]
- orig_atom = atom
- expanded_atoms = self._depgraph._dep_expand(root_config, atom)
- if len(expanded_atoms) > 1:
- non_virtual_atoms = []
- for x in expanded_atoms:
- if not x.cp.startswith("virtual/"):
- non_virtual_atoms.append(x)
- if len(non_virtual_atoms) == 1:
- expanded_atoms = non_virtual_atoms
- if len(expanded_atoms) > 1:
- # compatible with portage.cpv_expand()
- raise portage.exception.AmbiguousPackageName(
- [x.cp for x in expanded_atoms])
- if expanded_atoms:
- atom = expanded_atoms[0]
- else:
- null_atom = Atom(insert_category_into_atom(atom, "null"))
- cat, atom_pn = portage.catsplit(null_atom.cp)
- virts_p = root_config.settings.get_virts_p().get(atom_pn)
- if virts_p:
- # Allow the resolver to choose which virtual.
- atom = Atom(null_atom.replace('null/', 'virtual/', 1))
- else:
- atom = null_atom
- return atom
-
def aux_get(self, cpv, wants):
metadata = self._cpv_pkg_map[cpv].metadata
return [metadata.get(x, "") for x in wants]
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: d5ac30306268beb5b30bb971a61a3cb7159fadca
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 9 22:34:06 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:10:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5ac3030
dep_check_composite_db: implement cp_list
This is used by dep_check since commit
6f9ee9c508c1506cdf8eb0dc46796dbe30f268db.
---
pym/_emerge/depgraph.py | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 0c36e3a..acf941e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5672,6 +5672,23 @@ class _dep_check_composite_db(dbapi):
self._match_cache.clear()
self._cpv_pkg_map.clear()
+ def cp_list(self, cp):
+ """
+ Emulate cp_list just so it can be used to check for existence
+ of new-style virtuals.
+ """
+ if isinstance(cp, Atom):
+ atom = cp
+ else:
+ atom = Atom(cp)
+ ret = []
+ for pkg in self._depgraph._iter_match_pkgs_any(
+ self._depgraph._frozen_config.roots[self._root], atom):
+ if pkg.cp == cp:
+ ret.append(pkg.cpv)
+
+ return ret
+
def match(self, atom):
ret = self._match_cache.get(atom)
if ret is not None:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: e4e1a5dba0589b0bde34abbe5f362d8509192078
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 10 05:11:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:20:12 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e4e1a5db
depgraph: don't clear vardbapi cache in _load_vdb
Most of the memory is probably held on the heap by the installed
package instances anyway, and the cache is useful for being inherited
by subprocess in MergeProcess.
---
pym/_emerge/depgraph.py | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index bd72631..30085a5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -357,14 +357,6 @@ class depgraph(object):
vardb.aux_get(pkg.cpv, [])
fakedb.cpv_inject(pkg)
- # Now that the vardb state is cached in our FakeVartree,
- # we won't be needing the real vartree cache for awhile.
- # To make some room on the heap, clear the vardbapi
- # caches.
- self._frozen_config._trees_orig[myroot
- ]["vartree"].dbapi._clear_cache()
- gc.collect()
-
self._dynamic_config._vdb_loaded = True
def _spinner_update(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: e2e27248dd65af1c00514afefa19f63a5d78e9f6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 04:03:02 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:21:58 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2e27248
dep_check_composite_db: return early from cp_list
Since this implementation is only intended to check for existence of
new-style virtuals, it's a waste of time to return more than one cpv.
---
pym/_emerge/depgraph.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 30085a5..344dcd9 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5667,7 +5667,9 @@ class _dep_check_composite_db(dbapi):
def cp_list(self, cp):
"""
Emulate cp_list just so it can be used to check for existence
- of new-style virtuals.
+ of new-style virtuals. Since it's a waste of time to return
+ more than one cpv for this use case, a maximum of one cpv will
+ be returned.
"""
if isinstance(cp, Atom):
atom = cp
@@ -5678,6 +5680,7 @@ class _dep_check_composite_db(dbapi):
self._depgraph._frozen_config.roots[self._root], atom):
if pkg.cp == cp:
ret.append(pkg.cpv)
+ break
return ret
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: 9f1927572ba68ea9b43229e85dcd6a0732c420bd
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 23:50:15 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:22:53 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f192757
EbuildPhase: extract binpkg env for pkg_pretend
This will fix bug #366939.
---
pym/_emerge/EbuildPhase.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 5849e77..66b6bc8 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -99,7 +99,7 @@ class EbuildPhase(CompositeTask):
os.path.join(self.settings['PKGDIR'],
self.settings['CATEGORY'], self.settings['PF']) + '.tbz2'
- if self.phase == 'prerm':
+ if self.phase in ("pretend", "prerm"):
env_extractor = BinpkgEnvExtractor(background=self.background,
scheduler=self.scheduler, settings=self.settings)
if env_extractor.saved_env_exists():
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: 3874579c3a53b70a8d6aad21f7de9ce8bbce5420
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 20:24:22 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:22:41 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3874579c
unmerge: use frozenset for syslist
---
pym/_emerge/unmerge.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 6c0ef8d..8fff516 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -83,6 +83,7 @@ def unmerge(root_config, myopts, unmerge_action,
syslist.extend(providers)
else:
syslist.append(mycp)
+ syslist = frozenset(syslist)
mysettings = portage.config(clone=settings)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 06ff898b73227d4c3f0c3414a5e1085b2fc651a6
Author: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Sat May 14 20:44:22 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 02:46:49 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06ff898b
--autounmask: Use >= atoms if possible
If the package is the latest avaiable it now uses >=cat/pkg-ver instead
of =cat/pkg-ver. If the package is not the latest, but the latest in
its slot, >=cat/pkg-ver:slot is used. In all other case =cat/pkg-ver
is used. Rational is that it's more likely that newer versions, added
in the future, will work with the same configuration changes as the
currently latest version than not.
---
pym/_emerge/depgraph.py | 52 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 344dcd9..e652958 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5182,10 +5182,38 @@ class depgraph(object):
else:
self._show_missed_update()
+ def check_if_latest(pkg):
+ is_latest = True
+ is_latest_in_slot = True
+ dbs = self._dynamic_config._filtered_trees[pkg.root]["dbs"]
+ root_config = self._frozen_config.roots[pkg.root]
+
+ all_cpv_by_slot = {}
+ for db, pkg_type, built, installed, db_keys in dbs:
+ for other_pkg in self._iter_match_pkgs(root_config, pkg_type, Atom(pkg.cp)):
+ slot = other_pkg.metadata["SLOT"]
+ all_cpv_by_slot.setdefault(slot, set())
+ all_cpv_by_slot[slot].add(other_pkg.cpv)
+
+ all_cpv = []
+ for cpvs in all_cpv_by_slot.values():
+ all_cpv.extend(cpvs)
+ all_cpv.sort(key=portage.versions.cpv_sort_key())
+
+ if all_cpv[-1] != pkg.cpv:
+ is_latest = False
+ slot_cpvs = sorted(all_cpv_by_slot[pkg.metadata["SLOT"]], key=portage.versions.cpv_sort_key())
+ if slot_cpvs[-1] != pkg.cpv:
+ is_latest_in_slot = False
+
+ return is_latest, is_latest_in_slot
+
+
unstable_keyword_msg = []
for pkg in self._dynamic_config._needed_unstable_keywords:
self._show_merge_list()
if pkg in self._dynamic_config.digraph:
+ is_latest, is_latest_in_slot = check_if_latest(pkg)
pkgsettings = self._frozen_config.pkgsettings[pkg.root]
mreasons = _get_masking_status(pkg, pkgsettings, pkg.root_config,
use=self._pkg_use_enabled(pkg))
@@ -5195,12 +5223,18 @@ class depgraph(object):
keyword = reason.unmask_hint.value
unstable_keyword_msg.append(self._get_dep_chain_as_comment(pkg))
- unstable_keyword_msg.append("=%s %s\n" % (pkg.cpv, keyword))
+ if is_latest:
+ unstable_keyword_msg.append(">=%s %s\n" % (pkg.cpv, keyword))
+ elif is_latest_in_slot:
+ unstable_keyword_msg.append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], keyword))
+ else:
+ unstable_keyword_msg.append("=%s %s\n" % (pkg.cpv, keyword))
use_changes_msg = []
for pkg, needed_use_config_change in self._dynamic_config._needed_use_config_changes.items():
self._show_merge_list()
if pkg in self._dynamic_config.digraph:
+ is_latest, is_latest_in_slot = check_if_latest(pkg)
changes = needed_use_config_change[1]
adjustments = []
for flag, state in changes.items():
@@ -5209,14 +5243,26 @@ class depgraph(object):
else:
adjustments.append("-" + flag)
use_changes_msg.append(self._get_dep_chain_as_comment(pkg, unsatisfied_dependency=True))
- use_changes_msg.append("=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
+ if is_latest:
+ use_changes_msg.append(">=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
+ elif is_latest_in_slot:
+ use_changes_msg.append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(adjustments)))
+ else:
+ use_changes_msg.append("=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
license_msg = []
for pkg, missing_licenses in self._dynamic_config._needed_license_changes.items():
self._show_merge_list()
if pkg in self._dynamic_config.digraph:
+ is_latest, is_latest_in_slot = check_if_latest(pkg)
+
license_msg.append(self._get_dep_chain_as_comment(pkg))
- license_msg.append("=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
+ if is_latest:
+ license_msg.append(">=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
+ elif is_latest_in_slot:
+ license_msg.append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(sorted(missing_licenses))))
+ else:
+ license_msg.append("=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
if unstable_keyword_msg:
writemsg_stdout("\nThe following " + colorize("BAD", "keyword changes") + \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: a891dbf9456a5ab93db28fafc45cfded2beaf8d0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 15 05:21:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 02:51:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a891dbf9
Use vardbapi.lock() where applicable.
---
pym/_emerge/main.py | 5 +++--
pym/_emerge/unmerge.py | 10 +++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 5e6c312..c1484f2 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -356,7 +356,8 @@ def post_emerge(myaction, myopts, myfiles,
portage.util.ensure_dirs(vdb_path)
vdb_lock = None
if os.access(vdb_path, os.W_OK) and not "--pretend" in myopts:
- vdb_lock = portage.locks.lockdir(vdb_path)
+ vardbapi.lock()
+ vdb_lock = True
if vdb_lock:
try:
@@ -366,7 +367,7 @@ def post_emerge(myaction, myopts, myfiles,
mtimedb.commit()
finally:
if vdb_lock:
- portage.locks.unlockdir(vdb_lock)
+ vardbapi.unlock()
chk_updated_cfg_files(settings['EROOT'], config_protect)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 8fff516..5331744 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -11,6 +11,7 @@ from portage import os
from portage.dbapi._expand_new_virt import expand_new_virt
from portage.output import bold, colorize, darkgreen, green
from portage._sets import SETPREFIX
+from portage._sets.base import EditablePackageSet
from portage.util import cmp_sort_key
from _emerge.emergelog import emergelog
@@ -57,7 +58,8 @@ def unmerge(root_config, myopts, unmerge_action,
vdb_lock = None
try:
if os.access(vdb_path, os.W_OK):
- vdb_lock = portage.locks.lockdir(vdb_path)
+ vartree.dbapi.lock()
+ vdb_lock = True
realsyslist = []
for x in sets["system"].getAtoms():
@@ -293,10 +295,8 @@ def unmerge(root_config, myopts, unmerge_action,
finally:
if vdb_lock:
vartree.dbapi.flush_cache()
- portage.locks.unlockdir(vdb_lock)
-
- from portage._sets.base import EditablePackageSet
-
+ vartree.dbapi.unlock()
+
# generate a list of package sets that are directly or indirectly listed in "selected",
# as there is no persistent list of "installed" sets
installed_sets = ["selected"]
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: efe6d64295c5cf20869daac60a38651cb1158c51
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 06:54:49 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:04:16 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=efe6d642
_LockProcess: handle process failure more
---
pym/_emerge/AsynchronousLock.py | 39 ++++++++++++++++++++++++++++-----------
1 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index b62b684..1135df7 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -3,6 +3,7 @@
import dummy_threading
import fcntl
+import logging
import sys
try:
@@ -13,7 +14,9 @@ except ImportError:
import portage
from portage import os
from portage.exception import TryAgain
+from portage.localization import _
from portage.locks import lockfile, unlockfile
+from portage.util import writemsg_level
from _emerge.AbstractPollTask import AbstractPollTask
from _emerge.AsynchronousTask import AsynchronousTask
from _emerge.PollConstants import PollConstants
@@ -176,7 +179,7 @@ class _LockProcess(AbstractPollTask):
"""
__slots__ = ('path', 'scheduler',) + \
- ('_proc', '_files', '_reg_id', '_unlocked')
+ ('_acquired', '_proc', '_files', '_reg_id', '_unlocked')
def _start(self):
in_pr, in_pw = os.pipe()
@@ -201,16 +204,29 @@ class _LockProcess(AbstractPollTask):
os.close(in_pw)
def _proc_exit(self, proc):
- if proc.returncode != os.EX_OK and \
- not self.cancelled and \
- not self._unlocked:
- # Typically, lock process failure should only happen
- # if it's killed by a signal. We don't want lost
- # locks going unnoticed, so it's only safe to ignore
- # if either the cancel() or unlock() methods have
- # been previously called.
- raise AssertionError('lock process failed with returncode %s' \
- % (proc.returncode,))
+ if proc.returncode != os.EX_OK:
+ # Typically, this will happen due to the
+ # process being killed by a signal.
+ if not self._acquired:
+ # If the lock hasn't been aquired yet, the
+ # caller can check the returncode and handle
+ # this failure appropriately.
+ if not self.cancelled:
+ writemsg_level("_LockProcess: %s\n" % \
+ _("failed to acquire lock on '%s'") % (self.path,),
+ level=logging.ERROR, noiselevel=-1)
+ self._unregister()
+ self.returncode = proc.returncode
+ self.wait()
+ return
+
+ if not self.cancelled and \
+ not self._unlocked:
+ # We don't want lost locks going unnoticed, so it's
+ # only safe to ignore if either the cancel() or
+ # unlock() methods have been previously called.
+ raise AssertionError("lock process failed with returncode %s" \
+ % (proc.returncode,))
def _cancel(self):
if self._proc is not None:
@@ -226,6 +242,7 @@ class _LockProcess(AbstractPollTask):
def _output_handler(self, f, event):
buf = self._read_buf(self._files['pipe_in'], event)
if buf:
+ self._acquired = True
self._unregister()
self.returncode = os.EX_OK
self.wait()
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 6c419c4b44a29efb22f37fd8f596043ef709395e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 06:17:27 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:04:06 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6c419c4b
_LockProcess: handle process failure if cancelled
---
pym/_emerge/AsynchronousLock.py | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 6fa2bf6..b62b684 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -176,7 +176,7 @@ class _LockProcess(AbstractPollTask):
"""
__slots__ = ('path', 'scheduler',) + \
- ('_proc', '_files', '_reg_id')
+ ('_proc', '_files', '_reg_id', '_unlocked')
def _start(self):
in_pr, in_pw = os.pipe()
@@ -201,8 +201,14 @@ class _LockProcess(AbstractPollTask):
os.close(in_pw)
def _proc_exit(self, proc):
- if proc.returncode != os.EX_OK:
- # There's no good reason for locks to fail.
+ if proc.returncode != os.EX_OK and \
+ not self.cancelled and \
+ not self._unlocked:
+ # Typically, lock process failure should only happen
+ # if it's killed by a signal. We don't want lost
+ # locks going unnoticed, so it's only safe to ignore
+ # if either the cancel() or unlock() methods have
+ # been previously called.
raise AssertionError('lock process failed with returncode %s' \
% (proc.returncode,))
@@ -244,6 +250,7 @@ class _LockProcess(AbstractPollTask):
raise AssertionError('not locked')
if self.returncode is None:
raise AssertionError('lock not acquired yet')
+ self._unlocked = True
self._files['pipe_out'].write(b'\0')
self._files['pipe_out'].close()
self._files = None
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 7e8cf234141ea5c1c86032b82e81c3c9640908ed
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 07:10:07 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:04:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7e8cf234
EbuildBuildDir: handle AsynchronousLock failure
---
pym/_emerge/EbuildBuildDir.py | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/pym/_emerge/EbuildBuildDir.py b/pym/_emerge/EbuildBuildDir.py
index 1da3c93..3e0aefb 100644
--- a/pym/_emerge/EbuildBuildDir.py
+++ b/pym/_emerge/EbuildBuildDir.py
@@ -43,6 +43,8 @@ class EbuildBuildDir(SlotObject):
catdir_lock = AsynchronousLock(path=catdir, scheduler=self.scheduler)
catdir_lock.start()
catdir_lock.wait()
+ self._assert_lock(catdir_lock)
+
try:
try:
portage.util.ensure_dirs(catdir,
@@ -55,12 +57,19 @@ class EbuildBuildDir(SlotObject):
scheduler=self.scheduler)
builddir_lock.start()
builddir_lock.wait()
+ self._assert_lock(builddir_lock)
self._lock_obj = builddir_lock
self.settings['PORTAGE_BUILDIR_LOCKED'] = '1'
finally:
self.locked = self._lock_obj is not None
catdir_lock.unlock()
+ def _assert_lock(self, async_lock):
+ if async_lock.returncode != os.EX_OK:
+ # TODO: create a better way to propagate this error to the caller
+ raise AssertionError("AsynchronousLock failed with returncode %s" \
+ % (async_lock.returncode,))
+
def clean_log(self):
"""Discard existing log. The log will not be be discarded
in cases when it would not make sense, like when FEATURES=keepwork
@@ -85,15 +94,15 @@ class EbuildBuildDir(SlotObject):
self.settings.pop('PORTAGE_BUILDIR_LOCKED', None)
catdir_lock = AsynchronousLock(path=self._catdir, scheduler=self.scheduler)
catdir_lock.start()
- catdir_lock.wait()
- try:
- os.rmdir(self._catdir)
- except OSError as e:
- if e.errno not in (errno.ENOENT,
- errno.ENOTEMPTY, errno.EEXIST, errno.EPERM):
- raise
- finally:
- catdir_lock.unlock()
+ if catdir_lock.wait() == os.EX_OK:
+ try:
+ os.rmdir(self._catdir)
+ except OSError as e:
+ if e.errno not in (errno.ENOENT,
+ errno.ENOTEMPTY, errno.EEXIST, errno.EPERM):
+ raise
+ finally:
+ catdir_lock.unlock()
class AlreadyLocked(portage.exception.PortageException):
pass
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 4780c4916f10cb2f54827c3620eb0567b468ebc8
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 07:21:03 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:04:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4780c491
BinpkgFetcher: handle AsynchronousLock failure
---
pym/_emerge/BinpkgFetcher.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 221d9a7..12544d1 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -158,7 +158,12 @@ class BinpkgFetcher(SpawnProcess):
async_lock = AsynchronousLock(path=self.pkg_path,
scheduler=self.scheduler)
async_lock.start()
- async_lock.wait()
+
+ if async_lock.wait() != os.EX_OK:
+ # TODO: Use CompositeTask for better handling, like in EbuildPhase.
+ raise AssertionError("AsynchronousLock failed with returncode %s" \
+ % (async_lock.returncode,))
+
self._lock_obj = async_lock
self.locked = True
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: b74ea509d291740a0204096f2d1298014a98b500
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 21:32:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:05:58 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b74ea509
AsynchronousTask: tweak poll() logic
---
pym/_emerge/AsynchronousTask.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index bd72291..057063c 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -29,10 +29,11 @@ class AsynchronousTask(SlotObject):
return self.returncode is None
def poll(self):
- self._wait_hook()
if self.returncode is not None:
return self.returncode
- return self._poll()
+ self._poll()
+ self._wait_hook()
+ return self.returncode
def _poll(self):
return self.returncode
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 805a8535623c3a15fd22910e32780365a9f57857
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 00:54:34 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:06:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=805a8535
display_autounmask: optimize check_if_latest
---
pym/_emerge/depgraph.py | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 283ea8d..b5c3ab8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5188,23 +5188,24 @@ class depgraph(object):
dbs = self._dynamic_config._filtered_trees[pkg.root]["dbs"]
root_config = self._frozen_config.roots[pkg.root]
- all_cpv_by_slot = {}
for db, pkg_type, built, installed, db_keys in dbs:
for other_pkg in self._iter_match_pkgs(root_config, pkg_type, Atom(pkg.cp)):
- slot = other_pkg.metadata["SLOT"]
- all_cpv_by_slot.setdefault(slot, set())
- all_cpv_by_slot[slot].add(other_pkg.cpv)
-
- all_cpv = []
- for cpvs in all_cpv_by_slot.values():
- all_cpv.extend(cpvs)
- all_cpv.sort(key=portage.versions.cpv_sort_key())
-
- if all_cpv[-1] != pkg.cpv:
- is_latest = False
- slot_cpvs = sorted(all_cpv_by_slot[pkg.metadata["SLOT"]], key=portage.versions.cpv_sort_key())
- if slot_cpvs[-1] != pkg.cpv:
- is_latest_in_slot = False
+ if other_pkg.cp != pkg.cp:
+ # old-style PROVIDE virtual means there are no
+ # normal matches for this pkg_type
+ break
+ if other_pkg > pkg:
+ is_latest = False
+ if other_pkg.slot_atom == pkg.slot_atom:
+ is_latest_in_slot = False
+ break
+ else:
+ # iter_match_pkgs yields highest verion first, so
+ # there's no need to search this pkg_type any further
+ break
+
+ if not is_latest_in_slot:
+ break
return is_latest, is_latest_in_slot
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 1b98c8733b89dde89d8a33c334e441da9cb0b1d7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 04:00:39 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:12:35 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1b98c873
_LockProcess.unlock: assert successful returncode
---
pym/_emerge/AsynchronousLock.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 3e7600f..d117979 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -277,6 +277,9 @@ class _LockProcess(AbstractPollTask):
raise AssertionError('not locked')
if self.returncode is None:
raise AssertionError('lock not acquired yet')
+ if self.returncode != os.EX_OK:
+ raise AssertionError("lock process failed with returncode %s" \
+ % (self.returncode,))
self._unlocked = True
self._files['pipe_out'].write(b'\0')
self._files['pipe_out'].close()
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: cc736d073ac4444eb250d5510217fcf15d1b0d19
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 01:49:57 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:12:03 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cc736d07
Fix a typo in a comment.
---
pym/_emerge/depgraph.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e3b8710..2d0ad82 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5204,7 +5204,7 @@ class depgraph(object):
is_latest_in_slot = False
break
else:
- # iter_match_pkgs yields highest verion first, so
+ # iter_match_pkgs yields highest version first, so
# there's no need to search this pkg_type any further
break
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: f0a842be08044052e715461470c57077263e0443
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 01:31:15 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:11:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f0a842be
depgraph._resolve: use temp set for autounmask
---
pym/_emerge/depgraph.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b5c3ab8..e3b8710 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2044,15 +2044,19 @@ class depgraph(object):
except self._unknown_internal_error:
return False, myfavorites
- if set(self._dynamic_config.digraph).intersection( \
+ digraph_set = frozenset(self._dynamic_config.digraph)
+
+ if digraph_set.intersection(
self._dynamic_config._needed_unstable_keywords) or \
- set(self._dynamic_config.digraph).intersection( \
+ digraph_set.intersection(
self._dynamic_config._needed_use_config_changes) or \
- set(self._dynamic_config.digraph).intersection( \
+ digraph_set.intersection(
self._dynamic_config._needed_license_changes) :
#We failed if the user needs to change the configuration
return False, myfavorites
+ digraph_set = None
+
# We're true here unless we are missing binaries.
return (True, myfavorites)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 70d7c4449cc39f522987a6134440432ba95ab8bf
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 04:37:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:16:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=70d7c444
_pkg_visibility_check: if in graph then visible
---
pym/_emerge/depgraph.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2d0ad82..e6f9b12 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3023,7 +3023,16 @@ class depgraph(object):
if pkg.visible:
return True
- if self._frozen_config.myopts.get('--autounmask', 'n') is not True:
+ if pkg in self._dynamic_config.digraph:
+ # Sometimes we need to temporarily disable
+ # dynamic_config._autounmask, but for overall
+ # consistency in dependency resolution, in any
+ # case we want to respect autounmask visibity
+ # for packages that have already been added to
+ # the dependency graph.
+ return True
+
+ if not self._dynamic_config._autounmask:
return False
pkgsettings = self._frozen_config.pkgsettings[pkg.root]
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 164647b7fa04e80f3018070c2d029b22d60cb02f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 06:23:51 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:30:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=164647b7
Task: remove unnecessary _get_hash_key() method
---
pym/_emerge/Blocker.py | 11 ++---------
pym/_emerge/Package.py | 3 ---
pym/_emerge/Task.py | 24 +++++++++---------------
3 files changed, 11 insertions(+), 27 deletions(-)
diff --git a/pym/_emerge/Blocker.py b/pym/_emerge/Blocker.py
index 5c335b0..4f61c88 100644
--- a/pym/_emerge/Blocker.py
+++ b/pym/_emerge/Blocker.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.Task import Task
@@ -11,11 +11,4 @@ class Blocker(Task):
def __init__(self, **kwargs):
Task.__init__(self, **kwargs)
self.cp = self.atom.cp
-
- def _get_hash_key(self):
- hash_key = getattr(self, "_hash_key", None)
- if hash_key is None:
- self._hash_key = \
- ("blocks", self.root, self.atom, self.eapi)
- return self._hash_key
-
+ self._hash_key = ("blocks", self.root, self.atom, self.eapi)
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index d7efbf2..3f76c0e 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -407,9 +407,6 @@ class Package(Task):
missing_iuse.append(flag)
return missing_iuse
- def _get_hash_key(self):
- return self._hash_key
-
def __lt__(self, other):
if other.cp != self.cp:
return False
diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py
index 31788b5..3dd1193 100644
--- a/pym/_emerge/Task.py
+++ b/pym/_emerge/Task.py
@@ -1,43 +1,37 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.SlotObject import SlotObject
class Task(SlotObject):
__slots__ = ("_hash_key", "_hash_value")
- def _get_hash_key(self):
- try:
- return self._hash_key
- except AttributeError:
- raise NotImplementedError(self)
-
def __eq__(self, other):
- return self._get_hash_key() == other
+ return self._hash_key == other
def __ne__(self, other):
- return self._get_hash_key() != other
+ return self._hash_key != other
def __hash__(self):
hash_value = getattr(self, "_hash_value", None)
if hash_value is None:
- self._hash_value = hash(self._get_hash_key())
+ self._hash_value = hash(self._hash_key)
return self._hash_value
def __len__(self):
- return len(self._get_hash_key())
+ return len(self._hash_key)
def __getitem__(self, key):
- return self._get_hash_key()[key]
+ return self._hash_key[key]
def __iter__(self):
- return iter(self._get_hash_key())
+ return iter(self._hash_key)
def __contains__(self, key):
- return key in self._get_hash_key()
+ return key in self._hash_key
def __str__(self):
"""
Emulate tuple.__repr__, but don't show 'foo' as u'foo' for unicode
strings.
"""
- return "(%s)" % ", ".join(("'%s'" % x for x in self._get_hash_key()))
+ return "(%s)" % ", ".join(("'%s'" % x for x in self._hash_key))
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: c8f48112ca556b872851bb2a5f30695865db0093
Author: Marat Radchenko <marat <AT> slonopotamus <DOT> org>
AuthorDate: Fri May 20 04:25:17 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:27:49 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c8f48112
Package: precalculate _hash_key
This eliminates an expensive getattr call in _get_hash_key(), which
greatly improves depgraph performance on a weak ARM cpu.
---
pym/_emerge/Package.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index f11da6e..d7efbf2 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -73,6 +73,9 @@ class Package(Task):
else:
self.operation = "merge"
+ self._hash_key = \
+ (self.type_name, self.root, self.cpv, self.operation)
+
def _validate_deps(self):
"""
Validate deps. This does not trigger USE calculation since that
@@ -405,10 +408,6 @@ class Package(Task):
return missing_iuse
def _get_hash_key(self):
- hash_key = getattr(self, "_hash_key", None)
- if hash_key is None:
- self._hash_key = \
- (self.type_name, self.root, self.cpv, self.operation)
return self._hash_key
def __lt__(self, other):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: d8f02a6e4ba9429018065189fd1acecbc08132ea
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 06:31:55 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:32:56 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d8f02a6e
Task: precalculate _hash_value
---
pym/_emerge/Blocker.py | 1 +
pym/_emerge/Package.py | 1 +
pym/_emerge/Task.py | 3 ---
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/Blocker.py b/pym/_emerge/Blocker.py
index 4f61c88..9304606 100644
--- a/pym/_emerge/Blocker.py
+++ b/pym/_emerge/Blocker.py
@@ -12,3 +12,4 @@ class Blocker(Task):
Task.__init__(self, **kwargs)
self.cp = self.atom.cp
self._hash_key = ("blocks", self.root, self.atom, self.eapi)
+ self._hash_value = hash(self._hash_key)
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 3f76c0e..a7d8e26 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -75,6 +75,7 @@ class Package(Task):
self._hash_key = \
(self.type_name, self.root, self.cpv, self.operation)
+ self._hash_value = hash(self._hash_key)
def _validate_deps(self):
"""
diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py
index 3dd1193..4dbdb11 100644
--- a/pym/_emerge/Task.py
+++ b/pym/_emerge/Task.py
@@ -12,9 +12,6 @@ class Task(SlotObject):
return self._hash_key != other
def __hash__(self):
- hash_value = getattr(self, "_hash_value", None)
- if hash_value is None:
- self._hash_value = hash(self._hash_key)
return self._hash_value
def __len__(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 7eb27501a30dab7669837c1cb5c2b54230a36127
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 21:56:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:36:33 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7eb27501
depclean: adjust failure message wrt --with-bdeps
We need to be more explicit about using --with-bdeps=y, since this
subtlety often leads to confusion.
---
pym/_emerge/actions.py | 30 +++++++++++++++++++++---------
1 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6e238b0..5d1823e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -786,15 +786,27 @@ def calc_depclean(settings, trees, ldpath_mtimes,
msg.append(" %s pulled in by:" % (atom,))
msg.append(" %s" % (parent,))
msg.append("")
- msg.append("Have you forgotten to run " + \
- good("`emerge --update --newuse --deep @world`") + " prior")
- msg.append(("to %s? It may be necessary to manually " + \
- "uninstall packages that no longer") % action)
- msg.append("exist in the portage tree since " + \
- "it may not be possible to satisfy their")
- msg.append("dependencies. Also, be aware of " + \
- "the --with-bdeps option that is documented")
- msg.append("in " + good("`man emerge`") + ".")
+ msg.extend(textwrap.wrap(
+ "Have you forgotten to do a complete update prior " + \
+ "depclean? The most comprehensive command for this " + \
+ "purpose is as follows:", 65
+ ))
+ msg.append("")
+ msg.append(" " + \
+ good("emerge --update --newuse --deep --with-bdeps=y @world"))
+ msg.append("")
+ msg.extend(textwrap.wrap(
+ "Note that the --with-bdeps=y option is not required in " + \
+ "many situations. Refer to the emerge manual page " + \
+ "(run `man emerge`) for more information about " + \
+ "--with-bdeps.", 65
+ ))
+ msg.append("")
+ msg.extend(textwrap.wrap(
+ "Also, note that it may be necessary to manually uninstall " + \
+ "packages that no longer exist in the portage tree, since " + \
+ "it may not be possible to satisfy their dependencies.", 65
+ ))
if action == "prune":
msg.append("")
msg.append("If you would like to ignore " + \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 6dddcdf40fec90d4eaab3417b67dcc849c2547c7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 20:40:13 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:36:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6dddcdf4
Task: optimize == and != _hash_key comparison
---
pym/_emerge/Task.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py
index 4dbdb11..3e1a4ba 100644
--- a/pym/_emerge/Task.py
+++ b/pym/_emerge/Task.py
@@ -6,10 +6,16 @@ class Task(SlotObject):
__slots__ = ("_hash_key", "_hash_value")
def __eq__(self, other):
- return self._hash_key == other
+ try:
+ return self._hash_key == other._hash_key
+ except AttributeError:
+ return False
def __ne__(self, other):
- return self._hash_key != other
+ try:
+ return self._hash_key != other._hash_key
+ except AttributeError:
+ return True
def __hash__(self):
return self._hash_value
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: c8feed3611b0e7539bbab3eca87b74f00004d538
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 22:01:21 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:36:44 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c8feed36
Fix grammar in previous commit.
---
pym/_emerge/actions.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 5d1823e..32ea457 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -788,7 +788,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
msg.append("")
msg.extend(textwrap.wrap(
"Have you forgotten to do a complete update prior " + \
- "depclean? The most comprehensive command for this " + \
+ "to depclean? The most comprehensive command for this " + \
"purpose is as follows:", 65
))
msg.append("")
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 2e54071b3ccd259a555f30f1cc32b2be9ef136d3
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 08:40:30 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:43:33 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2e54071b
Task.__eq__: allow _hash_key as input
This is used by depgraph._pkg() for lookups.
---
pym/_emerge/Task.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py
index 3e1a4ba..efbe3a9 100644
--- a/pym/_emerge/Task.py
+++ b/pym/_emerge/Task.py
@@ -9,7 +9,9 @@ class Task(SlotObject):
try:
return self._hash_key == other._hash_key
except AttributeError:
- return False
+ # depgraph._pkg() generates _hash_key
+ # for lookups here, so handle that
+ return self._hash_key == other
def __ne__(self, other):
try:
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 0a7d76f7ea98aaa041a314f607e46cc7f81ce588
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 00:46:11 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:51:11 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0a7d76f7
DepPriority: remove "rebuild" attribute
Since the addition of DepPriorityNormalRange and
DepPrioritySatisfiedRange in commit
bd369956b2a2fbc019a655a372628998499156c0, which solves most cases of
bug 199856, the Depriority.rebuild attribute doesn't appear to make any
difference. The edges that this attribute differentiates are already
naturally differentiated by the fact that the child node of a satisfied
buildtime dependency that's not being rebuilt will naturally be
identified as a leaf node earlier and removed from the graph, thereby
eliminating the edge before there's an opportunity to compare it with
a higher priority rebuild edge. The addition of the "optional"
attribute (in commit 15476805a156acd11fdaaa19212691e8ee09b309) also
plays a role here, since it converts some satisfied buildtime edges to
optional edges, thereby reducing their priority.
---
pym/_emerge/DepPriority.py | 2 +-
pym/_emerge/DepPrioritySatisfiedRange.py | 31 +++++++----------------------
pym/_emerge/depgraph.py | 12 -----------
3 files changed, 9 insertions(+), 36 deletions(-)
diff --git a/pym/_emerge/DepPriority.py b/pym/_emerge/DepPriority.py
index f99b726..91afc05 100644
--- a/pym/_emerge/DepPriority.py
+++ b/pym/_emerge/DepPriority.py
@@ -4,7 +4,7 @@
from _emerge.AbstractDepPriority import AbstractDepPriority
class DepPriority(AbstractDepPriority):
- __slots__ = ("satisfied", "optional", "rebuild")
+ __slots__ = ("satisfied", "optional")
def __int__(self):
"""
diff --git a/pym/_emerge/DepPrioritySatisfiedRange.py b/pym/_emerge/DepPrioritySatisfiedRange.py
index aa32d8f..7c2ea81 100644
--- a/pym/_emerge/DepPrioritySatisfiedRange.py
+++ b/pym/_emerge/DepPrioritySatisfiedRange.py
@@ -7,18 +7,17 @@ class DepPrioritySatisfiedRange(object):
DepPriority Index Category
not satisfied and buildtime HARD
- not satisfied and runtime 7 MEDIUM
- not satisfied and runtime_post 6 MEDIUM_SOFT
- satisfied and buildtime and rebuild 5 SOFT
+ not satisfied and runtime 6 MEDIUM
+ not satisfied and runtime_post 5 MEDIUM_SOFT
satisfied and buildtime 4 SOFT
satisfied and runtime 3 SOFT
satisfied and runtime_post 2 SOFT
optional 1 SOFT
(none of the above) 0 NONE
"""
- MEDIUM = 7
- MEDIUM_SOFT = 6
- SOFT = 5
+ MEDIUM = 6
+ MEDIUM_SOFT = 5
+ SOFT = 4
NONE = 0
@classmethod
@@ -51,21 +50,8 @@ class DepPrioritySatisfiedRange(object):
def _ignore_satisfied_buildtime(cls, priority):
if priority.__class__ is not DepPriority:
return False
- if priority.optional:
- return True
- if not priority.satisfied:
- return False
- if priority.buildtime:
- return not priority.rebuild
- return True
-
- @classmethod
- def _ignore_satisfied_buildtime_rebuild(cls, priority):
- if priority.__class__ is not DepPriority:
- return False
- if priority.optional:
- return True
- return bool(priority.satisfied)
+ return bool(priority.optional or \
+ priority.satisfied)
@classmethod
def _ignore_runtime_post(cls, priority):
@@ -84,7 +70,7 @@ class DepPrioritySatisfiedRange(object):
ignore_medium = _ignore_runtime
ignore_medium_soft = _ignore_runtime_post
- ignore_soft = _ignore_satisfied_buildtime_rebuild
+ ignore_soft = _ignore_satisfied_buildtime
DepPrioritySatisfiedRange.ignore_priority = (
@@ -93,7 +79,6 @@ DepPrioritySatisfiedRange.ignore_priority = (
DepPrioritySatisfiedRange._ignore_satisfied_runtime_post,
DepPrioritySatisfiedRange._ignore_satisfied_runtime,
DepPrioritySatisfiedRange._ignore_satisfied_buildtime,
- DepPrioritySatisfiedRange._ignore_satisfied_buildtime_rebuild,
DepPrioritySatisfiedRange._ignore_runtime_post,
DepPrioritySatisfiedRange._ignore_runtime
)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 808103c..d0409a4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -831,18 +831,6 @@ class depgraph(object):
return 0
if not pkg.onlydeps:
- if not pkg.installed and \
- "empty" not in self._dynamic_config.myparams and \
- vardbapi.match(pkg.slot_atom):
- # Increase the priority of dependencies on packages that
- # are being rebuilt. This optimizes merge order so that
- # dependencies are rebuilt/updated as soon as possible,
- # which is needed especially when emerge is called by
- # revdep-rebuild since dependencies may be affected by ABI
- # breakage that has rendered them useless. Don't adjust
- # priority here when in "empty" mode since all packages
- # are being merged in that case.
- priority.rebuild = True
existing_node, existing_node_matches = \
self._check_slot_conflict(pkg, dep.atom)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 3aa1e1568f61e0975dd65f933a496b991093c37e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 18:53:41 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 04:19:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3aa1e156
Package: add new _gen_hash_key method
---
pym/_emerge/FakeVartree.py | 6 ++++--
pym/_emerge/Package.py | 26 ++++++++++++++++++++++++--
pym/_emerge/Scheduler.py | 11 ++++-------
pym/_emerge/depgraph.py | 12 +++++++-----
4 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index db31535..61dd540 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -150,11 +150,13 @@ class FakeVartree(vartree):
# Validate counters and timestamps.
slot_counters = {}
- root = self.root
+ root_config = self._pkg_root_config
validation_keys = ["COUNTER", "_mtime_"]
for cpv in current_cpv_set:
- pkg_hash_key = ("installed", root, cpv, "nomerge")
+ pkg_hash_key = Package._gen_hash_key(cpv=cpv,
+ installed=True, root_config=root_config,
+ type_name="installed")
pkg = pkg_vardb.get(pkg_hash_key)
if pkg is not None:
counter, mtime = real_vardb.aux_get(cpv, validation_keys)
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index a7d8e26..90425a7 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -73,10 +73,32 @@ class Package(Task):
else:
self.operation = "merge"
- self._hash_key = \
- (self.type_name, self.root, self.cpv, self.operation)
+ self._hash_key = Package._gen_hash_key(cpv=self.cpv,
+ installed=self.installed, onlydeps=self.onlydeps,
+ operation=self.operation,
+ root_config=self.root_config,
+ type_name=self.type_name)
self._hash_value = hash(self._hash_key)
+ @classmethod
+ def _gen_hash_key(cls, cpv=None, installed=None, onlydeps=None,
+ operation=None, repo_name=None, root_config=None,
+ type_name=None, **kwargs):
+
+ if operation is None:
+ if installed or onlydeps:
+ operation = "nomerge"
+ else:
+ operation = "merge"
+
+ root = None
+ if root_config is not None:
+ root = root_config.root
+ else:
+ raise TypeError("root_config argument is required")
+
+ return (type_name, root, cpv, operation)
+
def _validate_deps(self):
"""
Validate deps. This does not trigger USE calculation since that
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 14b89a8..46aa11d 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -2002,15 +2002,12 @@ class Scheduler(PollScheduler):
failures for some reason (package does not exist or is
corrupt).
"""
- if operation is None:
- if installed:
- operation = "nomerge"
- else:
- operation = "merge"
# Reuse existing instance when available.
- pkg = self._pkg_cache.get(
- (type_name, root_config.root, cpv, operation))
+ pkg = self._pkg_cache.get(Package._gen_hash_key(cpv=cpv,
+ type_name=type_name, root_config=root_config,
+ installed=installed, operation=operation))
+
if pkg is not None:
return pkg
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d0409a4..6c126e1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3744,18 +3744,20 @@ class depgraph(object):
failures for some reason (package does not exist or is
corrupt).
"""
- operation = "merge"
- if installed or onlydeps:
- operation = "nomerge"
+
# Ensure that we use the specially optimized RootConfig instance
# that refers to FakeVartree instead of the real vartree.
root_config = self._frozen_config.roots[root_config.root]
pkg = self._frozen_config._pkg_cache.get(
- (type_name, root_config.root, cpv, operation))
+ Package._gen_hash_key(cpv=cpv, type_name=type_name,
+ root_config=root_config,
+ installed=installed, onlydeps=onlydeps))
if pkg is None and onlydeps and not installed:
# Maybe it already got pulled in as a "merge" node.
pkg = self._dynamic_config.mydbapi[root_config.root].get(
- (type_name, root_config.root, cpv, 'merge'))
+ Package._gen_hash_key(cpv=cpv, type_name=type_name,
+ root_config=root_config,
+ installed=installed, onlydeps=False))
if pkg is None:
tree_type = self.pkg_tree_map[type_name]
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 0c8c887c5e46bf5b7f337a7b2618042e9b444933
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 21:20:56 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 04:20:36 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c8c887c
_validate_blockers: reference bug 128809
---
pym/_emerge/depgraph.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6c126e1..4cb4593 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3786,7 +3786,8 @@ class depgraph(object):
"""Remove any blockers from the digraph that do not match any of the
packages within the graph. If necessary, create hard deps to ensure
correct merge order such that mutually blocking packages are never
- installed simultaneously."""
+ installed simultaneously. Also add runtime blockers from all installed
+ packages if any of them haven't been added already (bug 128809)."""
if "--buildpkgonly" in self._frozen_config.myopts or \
"--nodeps" in self._frozen_config.myopts:
@@ -3797,9 +3798,11 @@ class depgraph(object):
if True:
# Pull in blockers from all installed packages that haven't already
- # been pulled into the depgraph. This is not enabled by default
- # due to the performance penalty that is incurred by all the
- # additional dep_check calls that are required.
+ # been pulled into the depgraph, in order to ensure that the are
+ # respected (bug 128809). Due to the performance penalty that is
+ # incurred by all the additional dep_check calls that are required,
+ # blockers returned from dep_check are cached on disk by the
+ # BlockerCache class.
# For installed packages, always ignore blockers from DEPEND since
# only runtime dependencies should be relevant for packages that
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 04052f030a975ee8e2a8d44fcb8402ea4f815b31
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 22:12:24 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 04:26:43 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04052f03
PackageUninstall: use _unmerge_display()
This is preparation for asynchronous support.
---
pym/_emerge/PackageUninstall.py | 51 ++++++++++++++++++++++++++-------------
1 files changed, 34 insertions(+), 17 deletions(-)
diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index 5e8850b..0e91307 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -1,34 +1,51 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import logging
import portage
from portage import os
-from _emerge.AsynchronousTask import AsynchronousTask
-from _emerge.unmerge import unmerge
-from _emerge.UninstallFailure import UninstallFailure
+from _emerge.emergelog import emergelog
+from _emerge.CompositeTask import CompositeTask
+from _emerge.unmerge import _unmerge_display
-class PackageUninstall(AsynchronousTask):
+class PackageUninstall(CompositeTask):
__slots__ = ("world_atom", "ldpath_mtimes", "opts",
- "pkg", "scheduler", "settings")
+ "pkg", "settings")
def _start(self):
- try:
- retval = unmerge(self.pkg.root_config, self.opts, "unmerge",
- [self.pkg.cpv], self.ldpath_mtimes, clean_world=0,
- clean_delay=0, raise_on_error=1, scheduler=self.scheduler,
- writemsg_level=self._writemsg_level)
- except UninstallFailure as e:
- self.returncode = e.status
- else:
- self.returncode = os.EX_OK
- if retval == 1:
- self.world_atom(self.pkg)
+ retval, pkgmap = _unmerge_display(self.pkg.root_config,
+ self.opts, "unmerge", [self.pkg.cpv], clean_delay=0,
+ writemsg_level=self._writemsg_level)
+
+ if retval != os.EX_OK:
+ self.returncode = retval
+ self.wait()
+ return
+
+ self._writemsg_level(">>> Unmerging %s...\n" % (self.pkg.cpv,),
+ noiselevel=-1)
+ self._emergelog("=== Unmerging... (%s)" % (self.pkg.cpv,))
+
+ cat, pf = portage.catsplit(self.pkg.cpv)
+ retval = portage.unmerge(cat, pf, settings=self.settings,
+ vartree=self.pkg.root_config.trees["vartree"],
+ ldpath_mtimes=self.ldpath_mtimes,
+ scheduler=self.scheduler)
+ if retval != os.EX_OK:
+ self._emergelog(" !!! unmerge FAILURE: %s" % (self.pkg.cpv,))
+ else:
+ self._emergelog(" >>> unmerge success: %s" % (self.pkg.cpv,))
+ self.world_atom(self.pkg)
+
+ self.returncode = retval
self.wait()
+ def _emergelog(self, msg):
+ emergelog("notitles" not in self.settings.features, msg)
+
def _writemsg_level(self, msg, level=0, noiselevel=0):
log_path = self.settings.get("PORTAGE_LOG_FILE")
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 23ce830068c4025201225470f6bcf785c9ecd51c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 21:21:43 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 04:26:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=23ce8300
unmerge: split out _unmerge_display() function
This will be useful for adding asynchronous support to the
PackageUninstall class, since it will be able to call
_unmerge_display() for the display portion, and then do the
actual unmerge asynchronously.
---
pym/_emerge/unmerge.py | 64 +++++++++++++++++++++++++++++++++---------------
1 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 5331744..0b02b32 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -20,21 +20,20 @@ from _emerge.UninstallFailure import UninstallFailure
from _emerge.userquery import userquery
from _emerge.countdown import countdown
-def unmerge(root_config, myopts, unmerge_action,
- unmerge_files, ldpath_mtimes, autoclean=0,
- clean_world=1, clean_delay=1, ordered=0, raise_on_error=0,
- scheduler=None, writemsg_level=portage.util.writemsg_level):
+def _unmerge_display(root_config, myopts, unmerge_action,
+ unmerge_files, clean_delay=1, ordered=0,
+ writemsg_level=portage.util.writemsg_level):
+ """
+ Returns a tuple of (returncode, pkgmap) where returncode is
+ os.EX_OK is no errors occur, and 1 otherwise.
+ """
- if clean_world:
- clean_world = myopts.get('--deselect') != 'n'
quiet = "--quiet" in myopts
- enter_invalid = '--ask-enter-invalid' in myopts
settings = root_config.settings
sets = root_config.sets
vartree = root_config.trees["vartree"]
candidate_catpkgs=[]
global_unmerge=0
- xterm_titles = "notitles" not in settings.features
out = portage.output.EOutput()
pkg_cache = {}
db_keys = list(vartree.dbapi._aux_cache_keys)
@@ -87,14 +86,12 @@ def unmerge(root_config, myopts, unmerge_action,
syslist.append(mycp)
syslist = frozenset(syslist)
- mysettings = portage.config(clone=settings)
-
if not unmerge_files:
if unmerge_action == "unmerge":
print()
print(bold("emerge unmerge") + " can only be used with specific package names")
print()
- return 0
+ return 1, {}
else:
global_unmerge = 1
@@ -108,7 +105,7 @@ def unmerge(root_config, myopts, unmerge_action,
#we've got command-line arguments
if not unmerge_files:
print("\nNo packages to unmerge have been provided.\n")
- return 0
+ return 1, {}
for x in unmerge_files:
arg_parts = x.split('/')
if x[0] not in [".","/"] and \
@@ -124,7 +121,7 @@ def unmerge(root_config, myopts, unmerge_action,
# ebuild and we're in "unmerge" mode, so it's ok.
if not os.path.exists(x):
print("\n!!! The path '"+x+"' doesn't exist.\n")
- return 0
+ return 1, {}
absx = os.path.abspath(x)
sp_absx = absx.split("/")
@@ -135,14 +132,13 @@ def unmerge(root_config, myopts, unmerge_action,
sp_absx_len = len(sp_absx)
vdb_path = os.path.join(settings["EROOT"], portage.VDB_PATH)
- vdb_len = len(vdb_path)
sp_vdb = vdb_path.split("/")
sp_vdb_len = len(sp_vdb)
if not os.path.exists(absx+"/CONTENTS"):
print("!!! Not a valid db dir: "+str(absx))
- return 0
+ return 1, {}
if sp_absx_len <= sp_vdb_len:
# The Path is shorter... so it can't be inside the vdb.
@@ -150,7 +146,7 @@ def unmerge(root_config, myopts, unmerge_action,
print(absx)
print("\n!!!",x,"cannot be inside "+ \
vdb_path+"; aborting.\n")
- return 0
+ return 1, {}
for idx in range(0,sp_vdb_len):
if idx >= sp_absx_len or sp_vdb[idx] != sp_absx[idx]:
@@ -158,7 +154,7 @@ def unmerge(root_config, myopts, unmerge_action,
print(absx)
print("\n!!!", x, "is not inside "+\
vdb_path+"; aborting.\n")
- return 0
+ return 1, {}
print("="+"/".join(sp_absx[sp_vdb_len:]))
candidate_catpkgs.append(
@@ -285,13 +281,13 @@ def unmerge(root_config, myopts, unmerge_action,
numselected = len(all_selected)
if global_unmerge and not numselected:
portage.writemsg_stdout("\n>>> No outdated packages were found on your system.\n")
- return 0
+ return 1, {}
if not numselected:
portage.writemsg_stdout(
"\n>>> No packages selected for removal by " + \
unmerge_action + "\n")
- return 0
+ return 1, {}
finally:
if vdb_lock:
vartree.dbapi.flush_cache()
@@ -407,7 +403,7 @@ def unmerge(root_config, myopts, unmerge_action,
writemsg_level(
"\n>>> No packages selected for removal by " + \
unmerge_action + "\n")
- return 0
+ return 1, {}
# Unmerge order only matters in some cases
if not ordered:
@@ -492,6 +488,34 @@ def unmerge(root_config, myopts, unmerge_action,
" and " + colorize("GOOD", "'omitted'") + \
" packages will not be removed.\n\n")
+ return os.EX_OK, pkgmap
+
+def unmerge(root_config, myopts, unmerge_action,
+ unmerge_files, ldpath_mtimes, autoclean=0,
+ clean_world=1, clean_delay=1, ordered=0, raise_on_error=0,
+ scheduler=None, writemsg_level=portage.util.writemsg_level):
+ """
+ Returns 1 if successful, otherwise 0.
+ """
+
+ if clean_world:
+ clean_world = myopts.get('--deselect') != 'n'
+
+ rval, pkgmap = _unmerge_display(root_config, myopts,
+ unmerge_action, unmerge_files,
+ clean_delay=clean_delay, ordered=ordered,
+ writemsg_level=portage.util.writemsg_level)
+
+ if rval != os.EX_OK:
+ return 0
+
+ enter_invalid = '--ask-enter-invalid' in myopts
+ vartree = root_config.trees["vartree"]
+ sets = root_config.sets
+ settings = root_config.settings
+ mysettings = portage.config(clone=settings)
+ xterm_titles = "notitles" not in settings.features
+
if "--pretend" in myopts:
#we're done... return
return 0
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: ec2782d7858d492f7766966aa41a3e46fb5254cb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 00:45:06 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 04:40:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ec2782d7
PackageUninstall: return early if pkg is missing
---
pym/_emerge/PackageUninstall.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index 0e91307..c846dab 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -15,6 +15,16 @@ class PackageUninstall(CompositeTask):
def _start(self):
+ vardb = self.pkg.root_config.trees["vartree"].dbapi
+ dbdir = vardb.getpath(self.pkg.cpv)
+ if not os.path.exists(dbdir):
+ # Apparently the package got uninstalled
+ # already, so we can safely return early.
+ self.returncode = os.EX_OK
+ self.wait()
+ return
+
+ self.settings.setcpv(self.pkg)
retval, pkgmap = _unmerge_display(self.pkg.root_config,
self.opts, "unmerge", [self.pkg.cpv], clean_delay=0,
writemsg_level=self._writemsg_level)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 65736474c0d70cb10ff1290b3787b61d8a502aed
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 02:52:17 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 06:11:52 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=65736474
depgraph: detect deps broken by autounmask
This will fix bug #368429.
---
pym/_emerge/depgraph.py | 41 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 21d5c19..5f74b6d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2479,14 +2479,17 @@ class depgraph(object):
def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None,
- check_backtrack=False):
+ check_backtrack=False, check_autounmask_breakage=False):
"""
When check_backtrack=True, no output is produced and
the method either returns or raises _backtrack_mask if
a matching package has been masked by backtracking.
"""
backtrack_mask = False
+ autounmask_broke_use_dep = False
atom_set = InternalPackageSet(initial_atoms=(atom.without_use,))
+ atom_set_with_use = InternalPackageSet(initial_atoms=(atom,),
+ allow_repo=True)
xinfo = '"%s"' % atom.unevaluated_atom
if arg:
xinfo='"%s"' % arg
@@ -2553,6 +2556,8 @@ class depgraph(object):
or atom.violated_conditionals(self._pkg_use_enabled(pkg), pkg.iuse.is_valid_flag).use:
missing_use.append(pkg)
if not mreasons:
+ if atom_set_with_use.findAtomForPackage(pkg):
+ autounmask_broke_use_dep = True
continue
except InvalidAtom:
writemsg("violated_conditionals raised " + \
@@ -2580,6 +2585,12 @@ class depgraph(object):
else:
return
+ if check_autounmask_breakage:
+ if autounmask_broke_use_dep:
+ raise self._autounmask_breakage()
+ else:
+ return
+
missing_use_reasons = []
missing_iuse_reasons = []
for pkg in missing_use:
@@ -5708,10 +5719,26 @@ class depgraph(object):
backtracking.
"""
+ class _autounmask_breakage(_internal_exception):
+ """
+ This is raised by _show_unsatisfied_dep() when it's called with
+ check_autounmask_breakage=True and a matching package has been
+ been disqualified due to autounmask changes.
+ """
+
def need_restart(self):
return self._dynamic_config._need_restart and \
not self._dynamic_config._skip_restart
+ def autounmask_breakage_detected(self):
+ try:
+ for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display:
+ self._show_unsatisfied_dep(
+ *pargs, check_autounmask_breakage=True, **kwargs)
+ except self._autounmask_breakage:
+ return True
+ return False
+
def get_backtrack_parameters(self):
return {
"needed_unstable_keywords":
@@ -5994,6 +6021,18 @@ def _backtrack_depgraph(settings, trees, myopts, myparams,
break
else:
break
+
+ if not success and mydepgraph.autounmask_breakage_detected():
+ if "--debug" in myopts:
+ writemsg_level(
+ "\n\nautounmask breakage detected\n\n",
+ noiselevel=-1, level=logging.DEBUG)
+ myopts["--autounmask"] = "n"
+ mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
+ frozen_config=frozen_config,
+ allow_backtracking=allow_backtracking)
+ success, favorites = mydepgraph.select_files(myfiles)
+
return (success, mydepgraph, favorites)
def resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 96a1c4577e7b96cbe7968789013289b82874486e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 00:30:36 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 06:12:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=96a1c457
rebuilt-binaries: prefer newer unbuilt
---
pym/_emerge/depgraph.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5f74b6d..4556681 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3521,11 +3521,15 @@ class depgraph(object):
if rebuilt_binaries:
inst_pkg = None
built_pkg = None
+ unbuilt_pkg = None
for pkg in matched_packages:
if pkg.installed:
inst_pkg = pkg
elif pkg.built:
built_pkg = pkg
+ else:
+ if unbuilt_pkg is None or pkg > unbuilt_pkg:
+ unbuilt_pkg = pkg
if built_pkg is not None and inst_pkg is not None:
# Only reinstall if binary package BUILD_TIME is
# non-empty, in order to avoid cases like to
@@ -3541,7 +3545,9 @@ class depgraph(object):
except (KeyError, ValueError):
installed_timestamp = 0
- if "--rebuilt-binaries-timestamp" in self._frozen_config.myopts:
+ if unbuilt_pkg is not None and unbuilt_pkg > built_pkg:
+ pass
+ elif "--rebuilt-binaries-timestamp" in self._frozen_config.myopts:
minimal_timestamp = self._frozen_config.myopts["--rebuilt-binaries-timestamp"]
if built_timestamp and \
built_timestamp > installed_timestamp and \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: cd6304f1245df0265d8f73f68d45a382a8f8ac1d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 01:04:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 06:12:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cd6304f1
FakeVartree: use live meta if installed EAPI ok
This will fix bug #368725.
---
pym/_emerge/FakeVartree.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 61dd540..4bc6261 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -85,11 +85,23 @@ class FakeVartree(vartree):
if pkg in self._aux_get_history:
return self._aux_get(pkg, wants)
self._aux_get_history.add(pkg)
+ # We need to check the EAPI, and this also raises
+ # a KeyError to the caller if appropriate.
+ installed_eapi, repo = self._aux_get(pkg, ["EAPI", "repository"])
try:
# Use the live ebuild metadata if possible.
live_metadata = dict(zip(self._portdb_keys,
self._portdb.aux_get(pkg, self._portdb_keys)))
- if not portage.eapi_is_supported(live_metadata["EAPI"]):
+ # Use the metadata from the installed instance if the EAPI
+ # of either instance is unsupported, since if the installed
+ # instance has an unsupported or corrupt EAPI then we don't
+ # want to attempt to do complex operations such as execute
+ # pkg_config, pkg_prerm or pkg_postrm phases. If both EAPIs
+ # are supported then go ahead and use the live_metadata, in
+ # order to respect dep updates without revision bump or EAPI
+ # bump, as in bug #368725.
+ if not (portage.eapi_is_supported(live_metadata["EAPI"]) and \
+ portage.eapi_is_supported(installed_eapi)):
raise KeyError(pkg)
self.dbapi.aux_update(pkg, live_metadata)
except (KeyError, portage.exception.PortageException):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 12:05 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 12:05 UTC (permalink / raw
To: gentoo-commits
commit: 83ea56442726ac55cdc05fe1c91635c104c7d48a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 12:00:01 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 12:04:19 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=83ea5644
discardBlocker: fix cpv match so it works
---
pym/_emerge/BlockerDB.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index 00be370..d094a23 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -114,8 +114,10 @@ class BlockerDB(object):
return blocking_pkgs
def discardBlocker(self, pkg):
- """Discard a package from the list of potential blockers."""
- self._fake_vartree.cpv_discard(pkg)
+ """Discard a package from the list of potential blockers.
+ This will match any package(s) with identical cpv or cp:slot."""
+ for cpv_match in self._fake_vartree.dbapi.match_pkgs("=%s" % (pkg.cpv,)):
+ self._fake_vartree.cpv_discard(cpv_match)
for slot_match in self._fake_vartree.dbapi.match_pkgs(pkg.slot_atom):
if slot_match.cp == pkg.cp:
self._fake_vartree.cpv_discard(pkg)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 12:26 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 12:26 UTC (permalink / raw
To: gentoo-commits
commit: 3054aaf5dc903c2b315a8d5b6e9b306ae6223e11
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 12:22:18 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 12:25:07 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3054aaf5
discardBlocker: fix bug in slot match code
---
pym/_emerge/BlockerDB.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index d094a23..bd85e6f 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -117,7 +117,8 @@ class BlockerDB(object):
"""Discard a package from the list of potential blockers.
This will match any package(s) with identical cpv or cp:slot."""
for cpv_match in self._fake_vartree.dbapi.match_pkgs("=%s" % (pkg.cpv,)):
- self._fake_vartree.cpv_discard(cpv_match)
+ if cpv_match.cp == pkg.cp:
+ self._fake_vartree.cpv_discard(cpv_match)
for slot_match in self._fake_vartree.dbapi.match_pkgs(pkg.slot_atom):
if slot_match.cp == pkg.cp:
- self._fake_vartree.cpv_discard(pkg)
+ self._fake_vartree.cpv_discard(slot_match)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 12:52 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 12:52 UTC (permalink / raw
To: gentoo-commits
commit: 45432ac05e2693e9e3a285d150b3a99a8d5c1ce6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 12:52:27 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 12:52:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=45432ac0
autounmask_breakage_detected: disable backtrack
---
pym/_emerge/depgraph.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4556681..dcebafe 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6036,7 +6036,7 @@ def _backtrack_depgraph(settings, trees, myopts, myparams,
myopts["--autounmask"] = "n"
mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
frozen_config=frozen_config,
- allow_backtracking=allow_backtracking)
+ allow_backtracking=False)
success, favorites = mydepgraph.select_files(myfiles)
return (success, mydepgraph, favorites)
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 13:04 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 13:04 UTC (permalink / raw
To: gentoo-commits
commit: f5144f6f920c23fff37cfc50859d463dd9930f72
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 13:02:11 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 13:03:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f5144f6f
unmerge: pass through writemsg_level param
---
pym/_emerge/unmerge.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 0b02b32..9f348a3 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -504,7 +504,7 @@ def unmerge(root_config, myopts, unmerge_action,
rval, pkgmap = _unmerge_display(root_config, myopts,
unmerge_action, unmerge_files,
clean_delay=clean_delay, ordered=ordered,
- writemsg_level=portage.util.writemsg_level)
+ writemsg_level=writemsg_level)
if rval != os.EX_OK:
return 0
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 21:37 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 21:37 UTC (permalink / raw
To: gentoo-commits
commit: f7594e756f54aa03d59e9be08ebc1c0b5c6d2c60
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 21:37:04 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 21:37:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f7594e75
_add_pkg_dep_string: fix virt_dep satisfied check
This is a mistake made when merging commit
6e6b9c5928e175af42615542866fc9b3aef694e6 to create commit
75b0a8aed8e56f02c0b455b4ee31fdc7e2b464cf.
---
pym/_emerge/depgraph.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index dcebafe..7affe3b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1341,7 +1341,7 @@ class depgraph(object):
(virt_pkg.cpv, [str(x) for x in atoms]),
noiselevel=-1, level=logging.DEBUG)
- inst_pkgs = vardb.match_pkgs(atom)
+ inst_pkgs = vardb.match_pkgs(virt_dep.atom)
if inst_pkgs:
for inst_pkg in inst_pkgs:
if self._pkg_visibility_check(inst_pkg):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-26 22:34 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-26 22:34 UTC (permalink / raw
To: gentoo-commits
commit: b37b5d5cf4a87fee0d9afdd90c775c82ef92d6c1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 22:14:07 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 22:15:55 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b37b5d5c
AsynchronousLock: check type in _poll and _cancel
---
pym/_emerge/AsynchronousLock.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index d117979..debf153 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -70,12 +70,12 @@ class AsynchronousLock(AsynchronousTask):
self.wait()
def _cancel(self):
- if self._imp is not None:
+ if isinstance(self._imp, AsynchronousTask):
self._imp.cancel()
def _poll(self):
- if self._imp is not None:
- return self._imp.poll()
+ if isinstance(self._imp, AsynchronousTask):
+ self._imp.poll()
return self.returncode
def _wait(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-27 0:40 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-27 0:40 UTC (permalink / raw
To: gentoo-commits
commit: cbfa2f2e4b82e816f8f28c74012794e4bb6a0386
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 00:38:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 27 00:40:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cbfa2f2e
_LockProcess: remove redundant scheduler attrib
---
pym/_emerge/AsynchronousLock.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index debf153..ec02364 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -183,7 +183,7 @@ class _LockProcess(AbstractPollTask):
lock and exit.
"""
- __slots__ = ('path', 'scheduler',) + \
+ __slots__ = ('path',) + \
('_acquired', '_kill_test', '_proc', '_files', '_reg_id', '_unlocked')
def _start(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-27 1:26 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-27 1:26 UTC (permalink / raw
To: gentoo-commits
commit: 4762f2f388727d30d4d0b1ba3d2eb3da94d83871
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 01:26:18 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 27 01:28:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4762f2f3
autounmask_broke_use_dep: flag masked pkgs too
---
pym/_emerge/depgraph.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7affe3b..fc52558 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2555,9 +2555,9 @@ class depgraph(object):
if not pkg.iuse.is_valid_flag(atom.unevaluated_atom.use.required) \
or atom.violated_conditionals(self._pkg_use_enabled(pkg), pkg.iuse.is_valid_flag).use:
missing_use.append(pkg)
+ if atom_set_with_use.findAtomForPackage(pkg):
+ autounmask_broke_use_dep = True
if not mreasons:
- if atom_set_with_use.findAtomForPackage(pkg):
- autounmask_broke_use_dep = True
continue
except InvalidAtom:
writemsg("violated_conditionals raised " + \
^ permalink raw reply related [flat|nested] 136+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/
@ 2011-05-27 3:36 Zac Medico
0 siblings, 0 replies; 136+ messages in thread
From: Zac Medico @ 2011-05-27 3:36 UTC (permalink / raw
To: gentoo-commits
commit: 9d407e3722896d7d4b967bf59e7a1e885684ee89
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 03:28:54 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 27 03:36:25 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9d407e37
_LockProcess: fix _poll returncode
We don't want to return the returncode directly from the
subprocess. Return self.returncode instead.
---
pym/_emerge/AsynchronousLock.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index ec02364..637ba73 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -239,7 +239,7 @@ class _LockProcess(AbstractPollTask):
def _poll(self):
if self._proc is not None:
- return self._proc.poll()
+ self._proc.poll()
return self.returncode
def _wait(self):
^ permalink raw reply related [flat|nested] 136+ messages in thread
end of thread, other threads:[~2011-05-27 3:36 UTC | newest]
Thread overview: 136+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08 20:50 [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2011-05-27 3:36 Zac Medico
2011-05-27 1:26 Zac Medico
2011-05-27 0:40 Zac Medico
2011-05-26 22:34 Zac Medico
2011-05-26 21:37 Zac Medico
2011-05-26 13:04 Zac Medico
2011-05-26 12:52 Zac Medico
2011-05-26 12:26 Zac Medico
2011-05-26 12:05 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-26 6:18 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-12 5:24 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-05 18:12 Zac Medico
2011-05-05 16:01 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-05-04 20:03 Zac Medico
2011-04-13 7:52 Zac Medico
2011-04-13 7:52 Zac Medico
2011-04-13 7:52 Zac Medico
2011-04-13 7:52 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-26 19:31 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-01 21:54 Zac Medico
2011-03-01 20:55 Zac Medico
2011-03-01 20:55 Zac Medico
2011-03-01 20:55 Zac Medico
2011-02-22 17:41 Zac Medico
2011-02-22 3:16 Zac Medico
2011-02-22 3:14 Zac Medico
2011-02-22 3:14 Zac Medico
2011-02-22 3:14 Zac Medico
2011-02-22 3:14 Zac Medico
2011-02-22 3:14 Zac Medico
2011-02-22 3:14 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-14 17:02 Zac Medico
2011-02-14 16:45 Zac Medico
2011-02-14 16:35 Zac Medico
2011-02-14 16:04 Zac Medico
2011-02-14 7:49 Zac Medico
2011-02-14 7:49 Zac Medico
2011-02-14 7:49 Zac Medico
2011-02-14 7:49 Zac Medico
2011-02-14 7:49 Zac Medico
2011-02-14 5:04 Zac Medico
2011-02-14 4:31 Zac Medico
2011-02-14 4:31 Zac Medico
2011-02-14 4:31 Zac Medico
2011-02-14 4:31 Zac Medico
2011-02-14 4:31 Zac Medico
2011-02-08 20:48 Zac Medico
2011-02-05 3:37 Zac Medico
2011-02-04 17:47 zmedico
2011-02-04 15:57 zmedico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox