public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-04 15:46 zmedico
  0 siblings, 0 replies; 804+ messages in thread
From: zmedico @ 2011-02-04 15:46 UTC (permalink / raw
  To: gentoo-commits

commit:     6503980e0e3bcfce9fbaff85c33d87f616e955a9
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:41:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6503980e0e3bcfce9fbaff85c33d87f616e955a9

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 811eda6..4334a33 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -683,8 +683,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:
@@ -731,33 +729,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-04 17:43 zmedico
  0 siblings, 0 replies; 804+ messages in thread
From: zmedico @ 2011-02-04 17:43 UTC (permalink / raw
  To: gentoo-commits

commit:     f90df89f9053bdad96d61935d704f33239f3fed5
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:41:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f90df89f9053bdad96d61935d704f33239f3fed5

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 4334a33..f131889 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3456,8 +3456,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-05  3:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-05  3:21 UTC (permalink / raw
  To: gentoo-commits

commit:     4d6d55b00d1e08453397c37f6b986c60175fd30f
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:20:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d6d55b0

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 f131889..6e8ca31 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2199,7 +2199,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]:
@@ -2650,7 +2654,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-05  7:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-05  7:33 UTC (permalink / raw
  To: gentoo-commits

commit:     a7c3400c1c8022b5b1b00e1d5b871bf902b25f48
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  5 07:32:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb  5 07:32:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a7c3400c

backtrack_depgraph: get_best_run for last run

It's essential to feed back autounmask config changes, especially
USE changes, in order to make the last run as successful as possible.
This fixes a regression in the master branch, since commit
2186f87c22e0c4bdb86065855c2034bdbb66fa45.

---
 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 6e8ca31..c4d84ab 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5771,7 +5771,8 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 
 		mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
 			frozen_config=frozen_config,
-			allow_backtracking=False)
+			allow_backtracking=False,
+			backtrack_parameters=backtracker.get_best_run())
 		success, favorites = mydepgraph.select_files(myfiles)
 
 	return (success, mydepgraph, favorites)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-08 19:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-08 19:40 UTC (permalink / raw
  To: gentoo-commits

commit:     ea5de5801644502ec225e6cf3172af1918cc3554
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 19:39:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ea5de580

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 c4d84ab..245e38e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1621,7 +1621,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-11  8:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-11  8:59 UTC (permalink / raw
  To: gentoo-commits

commit:     e4bcbdace3e0c28c39fdc9a92da38b21611638bf
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: Fri Feb 11 08:57:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e4bcbdac

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 245e38e..0cfd113 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3006,6 +3006,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
@@ -3117,6 +3118,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-12  6:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-12  6:10 UTC (permalink / raw
  To: gentoo-commits

commit:     0582c0fefb8549cbfe945aa588a0646871346730
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: Sat Feb 12 06:09:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0582c0fe

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 91ec250..fb54f50 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1277,21 +1277,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-13  9:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-13  9:13 UTC (permalink / raw
  To: gentoo-commits

commit:     878f166c5a06b0ab6c5a34dd658c878cc7605fe7
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: Sun Feb 13 09:06:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=878f166c

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-13 11:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-13 11:14 UTC (permalink / raw
  To: gentoo-commits

commit:     d7afc73681967c64a641d9769dae23886b908164
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: Sun Feb 13 11:13:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7afc736

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 72fc1ae..1dba229 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1350,8 +1350,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
@@ -2184,6 +2186,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)]
@@ -2202,9 +2211,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 = []
@@ -2225,7 +2235,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  3:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  3:29 UTC (permalink / raw
  To: gentoo-commits

commit:     b4f98ec5a1eb2e010a455b19db5bef8d61def241
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 03:28:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b4f98ec5

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 30e7046..ef4d1f0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2359,20 +2359,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
@@ -2382,11 +2382,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  5:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  5:01 UTC (permalink / raw
  To: gentoo-commits

commit:     080ee08b577177342b42a7bb2ec22555f0d1d259
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 04:57:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=080ee08b

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 ef4d1f0..d6c74e4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2363,6 +2363,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:
@@ -2381,12 +2382,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  5:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  5:51 UTC (permalink / raw
  To: gentoo-commits

commit:     729b9c2bb068a41c38f93a553794b478a6e2e705
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 05:50:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=729b9c2b

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  6:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  6:06 UTC (permalink / raw
  To: gentoo-commits

commit:     e348dbd08e4aae2346566688d9a6b2c5637b4ebd
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 06:05:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e348dbd0

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 d6c74e4..8a616dc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -655,9 +655,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 \
@@ -1037,8 +1036,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
@@ -1097,8 +1095,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"] = ""
 
@@ -3663,7 +3660,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  6:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  6:45 UTC (permalink / raw
  To: gentoo-commits

commit:     4fd45120a1ec8eb863a0890d947d2d428cfdad55
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 06:40:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4fd45120

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 8a616dc..b85c132 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1280,7 +1280,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:
@@ -1365,7 +1367,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  7:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  7:17 UTC (permalink / raw
  To: gentoo-commits

commit:     398b846a4928aeda385cb56c2b7ee4f303ff6aec
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:17:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=398b846a

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 b85c132..11f268e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1286,9 +1286,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
@@ -1373,10 +1373,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14  7:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14  7:22 UTC (permalink / raw
  To: gentoo-commits

commit:     35c1434375c21b3234cb7178ce8f78182aed58a7
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:20:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=35c14343

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 11f268e..9633874 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2397,7 +2397,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14 15:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14 15:30 UTC (permalink / raw
  To: gentoo-commits

commit:     2f2846acd57c549f14a2084fdd59628a35b15601
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:29:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2f2846ac

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 9633874..cacc8cc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2219,6 +2219,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14 16:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14 16:33 UTC (permalink / raw
  To: gentoo-commits

commit:     4ad43805eb11e6111ba1567dfd66cd0e429166d3
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:32:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4ad43805

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14 16:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14 16:44 UTC (permalink / raw
  To: gentoo-commits

commit:     4e5332a28c86202590b5de04ad14fdfb6f6a2c91
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:43:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4e5332a2

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-14 17:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-14 17:01 UTC (permalink / raw
  To: gentoo-commits

commit:     091ebf260e1fa28134150dff957b6e873b6f2fae
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:00:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=091ebf26

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 d83f8a8..7e55c77 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1307,7 +1307,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)
@@ -1389,7 +1389,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-17 10:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-17 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     734af3a2f4d3e04127d8a467d09b40040dddb72a
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: Thu Feb 17 10:32:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=734af3a2

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 278002b..79d70ba 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2400,6 +2400,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-18 12:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-18 12:05 UTC (permalink / raw
  To: gentoo-commits

commit:     b65b63b49c77e8b55adc6aec2ec2c7ea1a7afff8
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: Fri Feb 18 12:05:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b65b63b4

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-18 15:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-18 15:19 UTC (permalink / raw
  To: gentoo-commits

commit:     7867f86893b6f2c94f8e696428e1d4ab92923fd6
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: Fri Feb 18 15:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7867f868

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-18 16:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-18 16:00 UTC (permalink / raw
  To: gentoo-commits

commit:     bb87f96b0cd894083a4e878baaf1e94224a969a6
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: Fri Feb 18 15:57:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bb87f96b

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 95174cc..47975e3 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-18 16:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-18 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     60e195bbafef6c55711f3cd218d3a2b9929a313e
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: Fri Feb 18 16:16:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60e195bb

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 79d70ba..5aa4f24 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2453,7 +2453,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 47975e3..0ddda85 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-18 16:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-18 16:45 UTC (permalink / raw
  To: gentoo-commits

commit:     c5643d73d1db4d40207d68993811d4d193089a57
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: Fri Feb 18 16:44:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c5643d73

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 5aa4f24..08a92d6 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2400,9 +2400,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-20  9:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-20  9:41 UTC (permalink / raw
  To: gentoo-commits

commit:     048c6515c85633fe3cae3d72be3ae140ee04da4c
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: Sun Feb 20 09:40:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=048c6515

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 b129e1a..aaa05d1 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1540,6 +1540,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-20  9:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-20  9:44 UTC (permalink / raw
  To: gentoo-commits

commit:     e3648874003524630b7506fa87fedceb7a0315d4
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: Sun Feb 20 09:42:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e3648874

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-22  0:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-22  0:37 UTC (permalink / raw
  To: gentoo-commits

commit:     f69707ae4b344f77b36569a01494bfd11db78353
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 00:35:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f69707ae

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 0ddda85..e1ea33a 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-22  2:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-22  2:09 UTC (permalink / raw
  To: gentoo-commits

commit:     550795df709cfa9ec4a9502a4ad835319f778e95
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 02:07:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=550795df

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 e1ea33a..e5738a1 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-22  2:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-22  2:40 UTC (permalink / raw
  To: gentoo-commits

commit:     f11ed8dc9f35d8d211173fd6f9a24091ed86d36b
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 02:38:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f11ed8dc

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 08a92d6..980ad75 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2944,9 +2944,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-22  3:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-22  3:00 UTC (permalink / raw
  To: gentoo-commits

commit:     969ba46944335b7a35337a8ec6d4d2245e728e13
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 02:59:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=969ba469

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 980ad75..8330c04 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2948,7 +2948,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-22  3:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-22  3:16 UTC (permalink / raw
  To: gentoo-commits

commit:     fd48998730ae66ea677353b4bffbf54ec98e179a
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:04:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fd489987

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 e5738a1..fb75ba9 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-22 17:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-22 17:31 UTC (permalink / raw
  To: gentoo-commits

commit:     88a4d89c50b75959a8ed75c4ff59335202007f8a
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:31:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88a4d89c

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-25  6:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-25  6:00 UTC (permalink / raw
  To: gentoo-commits

commit:     0f065ee055741fe219187df3ad5fb58055a53902
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: Fri Feb 25 05:58:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f065ee0

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 8330c04..1b3b181 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2089,7 +2089,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-25  6:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-25  6:30 UTC (permalink / raw
  To: gentoo-commits

commit:     4609f5da90f3d925255d68c2cacc1bda6814dfcf
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: Fri Feb 25 06:29:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4609f5da

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 1b3b181..20220fc 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2088,13 +2088,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(
@@ -2113,7 +2123,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-02-28 18:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-02-28 18:01 UTC (permalink / raw
  To: gentoo-commits

commit:     9ce6da43ab90c4dab97ebf3b8339e5dbc113a0a8
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: Mon Feb 28 17:58:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ce6da43

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 7e55c77..b9c308b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2738,7 +2738,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
@@ -2752,6 +2752,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:
@@ -2764,6 +2770,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-01 21:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-01 21:53 UTC (permalink / raw
  To: gentoo-commits

commit:     5268ad9569a7b1d40694301fe9efa96801c83812
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:52:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5268ad95

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 20220fc..c752800 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-02 16:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-02 16:40 UTC (permalink / raw
  To: gentoo-commits

commit:     bb320d635acb8d745dedf979075331277253167e
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: Wed Mar  2 16:39:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bb320d63

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 b9c308b..6de3d14 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5866,10 +5866,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-09  2:54 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-03-09  2:54 UTC (permalink / raw
  To: gentoo-commits

commit:     cab19378be406d18a80114d00007e12b3310586d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Mar  9 02:57:23 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Wed Mar  9 02:57:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cab19378

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-09  3:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-09  3:29 UTC (permalink / raw
  To: gentoo-commits

commit:     6b604d43c68cab45ea5668042a53c23d4012bb18
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: Wed Mar  9 03:28:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b604d43

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-10  5:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-10  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c649695a92379892a1d545edd12c2bb3dc8c7e41
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: Thu Mar 10 05:55:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c649695a

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-11  3:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-11  3:30 UTC (permalink / raw
  To: gentoo-commits

commit:     c051b01974fbfb1471b3fc60f8152cbec0b3034f
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: Fri Mar 11 03:29:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c051b019

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 aaa05d1..9f72856 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()
 
@@ -1471,7 +1478,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-11  6:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-11  6:02 UTC (permalink / raw
  To: gentoo-commits

commit:     9411ac7406c6e775998bf6055ca8f022acce9e25
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: Fri Mar 11 06:02:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9411ac74

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 9f72856..c616120 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1443,7 +1443,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
@@ -1478,7 +1478,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
@@ -1507,7 +1507,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)
@@ -1687,7 +1687,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-11  6:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-11  6:02 UTC (permalink / raw
  To: gentoo-commits

commit:     33946e6594e16d1c8ff493cf71b8587878ec7b29
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: Fri Mar 11 05:21:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=33946e65

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-12 18:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-12 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     df2638070b38577d23947c40595af058e7b75abd
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: Sat Mar 12 18:35:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=df263807

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 c616120..6c24604 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  0:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     282263a511d13b62e3c4d0636011f486b1eeb588
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: Thu Mar 17 00:36:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=282263a5

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 6c24604..b961e83 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  1:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  1:19 UTC (permalink / raw
  To: gentoo-commits

commit:     19121602b455da19a2c9a4199362f13444709dc7
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: Thu Mar 17 01:19:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19121602

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  1:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  1:43 UTC (permalink / raw
  To: gentoo-commits

commit:     947f4bdcd0303a0170d9e1bac3d0964f747ce36b
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: Thu Mar 17 01:42:59 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=947f4bdc

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  3:47 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  3:47 UTC (permalink / raw
  To: gentoo-commits

commit:     9fa6881ac70e799e09fe98c1eb24177663f3b0e5
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: Thu Mar 17 03:44:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9fa6881a

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  4:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  4:51 UTC (permalink / raw
  To: gentoo-commits

commit:     f7b5b5f0da301d8f5c5585c21db238e28546c70f
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: Thu Mar 17 04:50:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f7b5b5f0

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 afd6399..98ab245 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 b961e83..a1b0ae4 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1821,6 +1821,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,
@@ -1830,7 +1838,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  4:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  4:57 UTC (permalink / raw
  To: gentoo-commits

commit:     5283edc81874fdf5ddf157c3f85032b63955ac86
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: Thu Mar 17 04:54:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5283edc8

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 a1b0ae4..9215678 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1683,15 +1683,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17  5:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17  5:36 UTC (permalink / raw
  To: gentoo-commits

commit:     363a7478a100495d2e8597bc6c6d2fdac94339e0
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: Thu Mar 17 05:36:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=363a7478

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17 20:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17 20:08 UTC (permalink / raw
  To: gentoo-commits

commit:     0eab3143c1aad2addd0f88cfd7a62940d064df3a
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: Thu Mar 17 20:08:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0eab3143

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-17 21:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-17 21:40 UTC (permalink / raw
  To: gentoo-commits

commit:     a81df31ca855cbe236aed8e2154030fe110f4ea3
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: Thu Mar 17 21:39:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a81df31c

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-18 21:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-18 21:11 UTC (permalink / raw
  To: gentoo-commits

commit:     e8fc5d66e57a8a84214fec16610c6a44804e219a
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:05:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e8fc5d66

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-18 21:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-18 21:38 UTC (permalink / raw
  To: gentoo-commits

commit:     d0113119f50b5ccd54719279cf3faebfa9c2e5bc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 18 21:38:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 21:38:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d0113119

PackageVirtualDbapi: fix get() for reposyntax

---
 pym/_emerge/FakeVartree.py         |    2 +-
 pym/_emerge/PackageVirtualDbapi.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index b83dd65..a886353 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -154,7 +154,7 @@ class FakeVartree(vartree):
 		validation_keys = ["COUNTER", "_mtime_"]
 		for cpv in current_cpv_set:
 
-			pkg_hash_key = ("installed", root, cpv, "nomerge")
+			pkg_hash_key = ("installed", root, cpv, "nomerge", "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/PackageVirtualDbapi.py b/pym/_emerge/PackageVirtualDbapi.py
index 3728f2a..44c4313 100644
--- a/pym/_emerge/PackageVirtualDbapi.py
+++ b/pym/_emerge/PackageVirtualDbapi.py
@@ -56,9 +56,9 @@ class PackageVirtualDbapi(dbapi):
 	def get(self, item, default=None):
 		cpv = getattr(item, "cpv", None)
 		if cpv is None:
-			if len(item) != 4:
+			if len(item) != 5:
 				return default
-			type_name, root, cpv, operation = item
+			type_name, root, cpv, operation, repo_key = item
 
 		existing = self._cpv_map.get(cpv)
 		if existing is not None and \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-18 23:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-18 23:45 UTC (permalink / raw
  To: gentoo-commits

commit:     5a8e23bdbca393d7e0edee50ef9a775fd8d11cdf
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: Fri Mar 18 23:45:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a8e23bd

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-20 15:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-20 15:58 UTC (permalink / raw
  To: gentoo-commits

commit:     7ff280c89551def11cf9fa7e5a22c580553e0e6e
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: Sun Mar 20 15:57:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7ff280c8

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 f061ae4..1a63bc7 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-21  0:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-21  0:16 UTC (permalink / raw
  To: gentoo-commits

commit:     1f8f9438935c11fada771ff64a9fae6a7edfe087
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: Mon Mar 21 00:11:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1f8f9438

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 c752800..f79f927 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2965,7 +2965,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-24  4:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-24  4:09 UTC (permalink / raw
  To: gentoo-commits

commit:     c4b26e6ece564edd30d612628ea5f3c29b5df120
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: Thu Mar 24 04:08:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c4b26e6e

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 6de3d14..391c845 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2294,8 +2294,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-25  1:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-25  1:17 UTC (permalink / raw
  To: gentoo-commits

commit:     99ec2a8f810ae7ea2c76d928665ed1d02c2d9cc7
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: Fri Mar 25 01:14:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=99ec2a8f

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 f7f292b..fa490c2 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -103,6 +103,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
@@ -144,9 +154,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 = {}
@@ -165,9 +173,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 9215678..7d34d70 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):
@@ -1529,6 +1517,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-25 16:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-25 16:00 UTC (permalink / raw
  To: gentoo-commits

commit:     0a64f784003c11e151405b7f708d77770de0ed57
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: Fri Mar 25 15:57:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0a64f784

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-25 16:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-25 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     1f1e49dfcbb1858af8a0a09165bb311aac33b423
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: Fri Mar 25 16:52:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1f1e49df

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-26  3:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-26  3:38 UTC (permalink / raw
  To: gentoo-commits

commit:     2e6fe9eb779b94d1f00d9ebdbdf76b3f026ebcd2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 03:38:11 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 03:38:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2e6fe9eb

PackageMerge: call wait() for conformity

---
 pym/_emerge/PackageMerge.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/PackageMerge.py b/pym/_emerge/PackageMerge.py
index 15d8ede..832eac0 100644
--- a/pym/_emerge/PackageMerge.py
+++ b/pym/_emerge/PackageMerge.py
@@ -39,5 +39,4 @@ class PackageMerge(AsynchronousTask):
 
 	def exit_handler(self, task):
 		self.returncode = task.returncode
-		self._wait_hook()
-
+		self.wait()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-26  7:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-26  7:06 UTC (permalink / raw
  To: gentoo-commits

commit:     dc6a4c122e827baf28729caf2dbb32576072d88f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 07:06:01 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 26 07:06:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dc6a4c12

Reoranize PackageMerge/MergeListItem interaction.

---
 pym/_emerge/AsynchronousTask.py |    4 +++-
 pym/_emerge/Binpkg.py           |   11 ++++-------
 pym/_emerge/EbuildBuild.py      |    6 ++----
 pym/_emerge/MergeListItem.py    |   21 ++++++++-------------
 pym/_emerge/PackageMerge.py     |   12 +++++-------
 5 files changed, 22 insertions(+), 32 deletions(-)

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index de00800..2b654ec 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -1,6 +1,7 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+from portage import os
 from _emerge.SlotObject import SlotObject
 class AsynchronousTask(SlotObject):
 	"""
@@ -23,7 +24,8 @@ class AsynchronousTask(SlotObject):
 		self._start()
 
 	def _start(self):
-		raise NotImplementedError(self)
+		self.returncode = os.EX_OK
+		self.wait()
 
 	def isAlive(self):
 		return self.returncode is None

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 62d44c4..bc6b85d 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -307,7 +307,7 @@ class Binpkg(CompositeTask):
 		portage.elog.elog_process(self.pkg.cpv, self.settings)
 		self._build_dir.unlock()
 
-	def install(self, handler):
+	def create_install_task(self):
 
 		# This gives bashrc users an opportunity to do various things
 		# such as remove binary packages after they're installed.
@@ -322,16 +322,13 @@ class Binpkg(CompositeTask):
 			settings=settings, tree=self._tree, world_atom=self.world_atom)
 		task = merge.create_task()
 		task.addExitListener(self._install_exit)
-		self._start_task(task, handler)
+		return task
 
 	def _install_exit(self, task):
 		self.settings.pop("PORTAGE_BINPKG_FILE", None)
 		self._unlock_builddir()
-
-		if self._default_final_exit(task) != os.EX_OK:
-			return
-
-		if 'binpkg-logs' not in self.settings.features and \
+		if task.returncode == os.EX_OK and \
+			'binpkg-logs' not in self.settings.features and \
 			self.settings.get("PORTAGE_LOG_FILE"):
 			try:
 				os.unlink(self.settings["PORTAGE_LOG_FILE"])

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index c7a5f5c..1de8fbf 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -314,7 +314,7 @@ class EbuildBuild(CompositeTask):
 			self._unlock_builddir()
 		self.wait()
 
-	def install(self, exit_handler):
+	def create_install_task(self):
 		"""
 		Install the package and then clean up and release locks.
 		Only call this after the build has completed successfully
@@ -345,9 +345,7 @@ class EbuildBuild(CompositeTask):
 
 		task = merge.create_task()
 		task.addExitListener(self._install_exit)
-		self._start_task(task, exit_handler)
+		return task
 
 	def _install_exit(self, task):
 		self._unlock_builddir()
-		self._default_final_exit(task)
-

diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index 5170de1..124db1a 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -4,6 +4,7 @@
 from portage import os
 from portage.output import colorize
 
+from _emerge.AsynchronousTask import AsynchronousTask
 from _emerge.Binpkg import Binpkg
 from _emerge.CompositeTask import CompositeTask
 from _emerge.EbuildBuild import EbuildBuild
@@ -111,15 +112,11 @@ class MergeListItem(CompositeTask):
 		self._install_task.wait()
 		return self.returncode
 
-	def merge(self, exit_handler):
+	def create_install_task(self):
 
 		pkg = self.pkg
 		build_opts = self.build_opts
-		find_blockers = self.find_blockers
-		logger = self.logger
 		mtimedb = self.mtimedb
-		pkg_count = self.pkg_count
-		prefetcher = self.prefetcher
 		scheduler = self.scheduler
 		settings = self.settings
 		world_atom = self.world_atom
@@ -129,20 +126,18 @@ class MergeListItem(CompositeTask):
 			if not (build_opts.buildpkgonly or \
 				build_opts.fetchonly or build_opts.pretend):
 
-				uninstall = PackageUninstall(background=self.background,
+				task = PackageUninstall(background=self.background,
 					ldpath_mtimes=ldpath_mtimes, opts=self.emerge_opts,
 					pkg=pkg, scheduler=scheduler, settings=settings,
 					world_atom=world_atom)
 
-				uninstall.start()
-				self.returncode = uninstall.wait()
 			else:
-				self.returncode = os.EX_OK
-			exit_handler(self)
+				task = AsynchronousTask()
+
 		elif build_opts.fetchonly or \
 			build_opts.buildpkgonly:
-			exit_handler(self)
+			task = AsynchronousTask()
 		else:
-			self._current_task = self._install_task
-			self._install_task.install(exit_handler)
+			task = self._install_task.create_install_task()
 
+		return task

diff --git a/pym/_emerge/PackageMerge.py b/pym/_emerge/PackageMerge.py
index 832eac0..f8fa04a 100644
--- a/pym/_emerge/PackageMerge.py
+++ b/pym/_emerge/PackageMerge.py
@@ -1,13 +1,14 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from _emerge.AsynchronousTask import AsynchronousTask
+from _emerge.CompositeTask import CompositeTask
 from portage.output import colorize
-class PackageMerge(AsynchronousTask):
+class PackageMerge(CompositeTask):
 	__slots__ = ("merge",)
 
 	def _start(self):
 
+		self.scheduler = self.merge.scheduler
 		pkg = self.merge.pkg
 		pkg_count = self.merge.pkg_count
 
@@ -35,8 +36,5 @@ class PackageMerge(AsynchronousTask):
 			not self.merge.build_opts.buildpkgonly:
 			self.merge.statusMessage(msg)
 
-		self.merge.merge(self.exit_handler)
-
-	def exit_handler(self, task):
-		self.returncode = task.returncode
-		self.wait()
+		task = self.merge.create_install_task()
+		self._start_task(task, self._default_final_exit)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-26  8:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-26  8:53 UTC (permalink / raw
  To: gentoo-commits

commit:     415bd400f40de10f76eec37820c0a09525e2e71f
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 08:52:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=415bd400

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 124db1a..7de48f9 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -104,14 +104,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 create_install_task(self):
 
 		pkg = self.pkg



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-26 16:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-26 16:13 UTC (permalink / raw
  To: gentoo-commits

commit:     81cd62d4db039995f291c724ab12afbaaf9ae596
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 16:12:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=81cd62d4

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 6de63ae..0021f23 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-26 17:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-26 17:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e2981b3398620968dcf3bb5d3c3d6c0f7714d136
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 17:10:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2981b33

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 7d34d70..06eeed5 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1799,7 +1799,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-03-30 18:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-03-30 18:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c133281d9b906f45bf4525dbc08faaeb605c1092
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 Mar 30 18:38:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c133281d

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 d4b14fc..96fee89 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-10 20:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-10 20:04 UTC (permalink / raw
  To: gentoo-commits

commit:     d0ead65b8019f03bad69d88963ac2aa79a8f7693
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: Sun Apr 10 20:03:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d0ead65b

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 06eeed5..d557a14 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1375,6 +1375,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:
@@ -1554,7 +1558,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-10 20:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-10 20:06 UTC (permalink / raw
  To: gentoo-commits

commit:     7c398b8dc2eba2c4f1679ef5ee04cc5d6e37afb5
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: Sun Apr 10 20:05:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7c398b8d

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 d557a14..55febf7 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1378,7 +1378,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-11 19:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-11 19:01 UTC (permalink / raw
  To: gentoo-commits

commit:     1caaa48d23b1d39ee2e8e0632a08cceeba6a6b3a
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: Mon Apr 11 19:00:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1caaa48d

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 55febf7..dfccbc4 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-26 20:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-26 20:27 UTC (permalink / raw
  To: gentoo-commits

commit:     71fe8dac63a91b0fc8ca425ac2068a80b726a32f
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: Tue Apr 26 20:19:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71fe8dac

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 53d1880..43707d2 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1289,6 +1289,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
@@ -1349,15 +1383,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 = []
@@ -1372,10 +1416,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))
@@ -1386,9 +1430,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"))
 
@@ -2788,24 +2829,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-26 20:50 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-04-26 20:50 UTC (permalink / raw
  To: gentoo-commits

commit:     fd6f03e9969b78e2ff881f3da2facfc0a83a2ee1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Tue Apr 26 20:50:03 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 20:50:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fd6f03e9

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 43707d2..f2f4181 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1292,7 +1292,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-26 23:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-26 23:58 UTC (permalink / raw
  To: gentoo-commits

commit:     89ca023f9af14781c202b6f69d4f0e47d0339e88
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: Tue Apr 26 23:57:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=89ca023f

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 f2f4181..e4e87da 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1289,39 +1289,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-27 14:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-27 14:06 UTC (permalink / raw
  To: gentoo-commits

commit:     55000abdfb5a9a5da9d7ee17e752cae4a2756e27
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 Apr 27 14:05:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=55000abd

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 e4e87da..c05d7e2 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1302,8 +1302,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-27 14:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-27 14:36 UTC (permalink / raw
  To: gentoo-commits

commit:     ffe4f3feb6cd9b2bc3b38086894fec8133db1834
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 Apr 27 14:35:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ffe4f3fe

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 c05d7e2..99619fa 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, _ENABLE_SET_CONFIG
 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
@@ -1311,10 +1311,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-27 16:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-27 16:14 UTC (permalink / raw
  To: gentoo-commits

commit:     37b0564dc8013f4495be59eb6af8dc9535c7c695
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 Apr 27 16:13:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=37b0564d

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 99619fa..59db58d 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1296,11 +1296,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-27 22:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-27 22:58 UTC (permalink / raw
  To: gentoo-commits

commit:     16cca624a56e9f5032c83b88e9b58349ac87319f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 22:58:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 27 22:58:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=16cca624

emerge: add --help for 3 new options

---
 pym/_emerge/help.py |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index a120f54..ffc81e9 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -550,6 +550,12 @@ def help(myopts, havecolor=1):
 		print("       "+green("--nospinner"))
 		print("              Disables the spinner regardless of terminal type.")
 		print()
+		print("       " + green("--nousepkg-atoms") + " " + turquoise("ATOMS"))
+		desc = "A space separated list of package names or slot atoms." + \
+			" Emerge will ignore matching binary packages."
+		for line in wrap(desc, desc_width):
+			print(desc_indent + line)
+		print()
 		print("       "+green("--oneshot")+" ("+green("-1")+" short option)")
 		print("              Emerge as normal, but don't add packages to the world profile.")
 		print("              This package will only be updated if it is depended upon by")
@@ -627,6 +633,13 @@ def help(myopts, havecolor=1):
 		print("              not trigger reinstallation when flags that the user has not")
 		print("              enabled are added or removed.")
 		print()
+		print("       " + green("--reinstall-atoms") + " " + turquoise("ATOMS"))
+		desc = "A space separated list of package names or slot atoms. " + \
+			"Emerge will treat matching packages as if they are not " + \
+			"installed, and reinstall them if necessary."
+		for line in wrap(desc, desc_width):
+			print(desc_indent + line)
+		print()
 		print("       "+green("--root=DIR"))
 		desc = "Set the ROOT environment variable " + \
 			"which is documented in the emerge(1) man page."
@@ -709,6 +722,13 @@ def help(myopts, havecolor=1):
 		for line in wrap(desc, desc_width):
 			print(desc_indent + line)
 		print()
+		print("       " + green("--useoldpkg-atoms") + " " + turquoise("ATOMS"))
+		desc = "A space separated list of package names or slot atoms." + \
+			" Emerge will prefer matching binary packages over newer" + \
+			" unbuilt packages."
+		for line in wrap(desc, desc_width):
+			print(desc_indent + line)
+		print()
 		print("       " + green("--usepkg") + \
 			" [ %s | %s ] (%s short option)" % \
 			(turquoise("y"), turquoise("n"), green("-k")))



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-28 13:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-28 13:00 UTC (permalink / raw
  To: gentoo-commits

commit:     a35835dda585b128c8390ce87ec3b4ab6c8a0334
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: Thu Apr 28 12:58:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a35835dd

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 ffc81e9..a928a85 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-28 21:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-28 21:07 UTC (permalink / raw
  To: gentoo-commits

commit:     593b57110c6f441d03d9ae623de9ff99a2e57905
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: Thu Apr 28 21:07:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=593b5711

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 82b1444..e0cd0c0 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-29 15:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-29 15:04 UTC (permalink / raw
  To: gentoo-commits

commit:     b67367d3e7d11a0d7d62e48d433c76eae64e5f99
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: Fri Apr 29 15:04:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b67367d3

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 59db58d..6379b36 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1427,13 +1427,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 = ""
@@ -1441,22 +1454,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-29 16:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-29 16:08 UTC (permalink / raw
  To: gentoo-commits

commit:     a706f4489a017f2609b36acc50081e58e3a7e07f
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: Fri Apr 29 16:07:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a706f448

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-04-30 20:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-04-30 20:41 UTC (permalink / raw
  To: gentoo-commits

commit:     d6080afba243844083838b5779afbe0ebbb81626
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: Sat Apr 30 20:38:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d6080afb

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 dfccbc4..df13b6b 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 7db5ae3..73b81e1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4203,6 +4203,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
@@ -4220,6 +4283,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-01 20:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-01 20:23 UTC (permalink / raw
  To: gentoo-commits

commit:     b26576b2d4b3b5f99dde4d33003192be973401ce
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May  1 20:23:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May  1 20:23:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b26576b2

depgraph: ignore unwanted virtuals

This fixes an unwanted side-effect from commit
470871eeafa89a05486d4eb6f3f7626c1f813e4d.

---
 pym/_emerge/depgraph.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f55d84d..f1c111f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1477,8 +1477,9 @@ class depgraph(object):
 					(virt_pkg.cpv, [str(x) for x in atoms]),
 					noiselevel=-1, level=logging.DEBUG)
 
-			if not self._add_pkg(virt_pkg, virt_dep):
-				return 0
+			if not dep_priority.ignored:
+				if not self._add_pkg(virt_pkg, virt_dep):
+					return 0
 
 			for atom, child in self._minimize_children(
 				pkg, self._priority(runtime=True), root_config, atoms):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-01 21:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-01 21:17 UTC (permalink / raw
  To: gentoo-commits

commit:     a524f21fc85e899455d13301c3d435077c694ece
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May  1 21:17:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May  1 21:17:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a524f21f

depgraph: traverse bdeps in complete mode

This makes the graph as complete as possible, and can help --rebuild to
find more rebuilds.

---
 pym/_emerge/create_depgraph_params.py |    4 ++++
 pym/_emerge/depgraph.py               |    7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 0986347..ae7a8ae 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -17,6 +17,10 @@ def create_depgraph_params(myopts, myaction):
 	# rebuilt_binaries: replace installed packages with rebuilt binaries
 	myparams = {"recurse" : True}
 
+	bdeps = myopts.get("--with-bdeps")
+	if bdeps is not None:
+		myparams["bdeps"] = bdeps
+
 	if myaction == "remove":
 		myparams["remove"] = True
 		myparams["complete"] = True

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f1c111f..4753bd2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1245,7 +1245,7 @@ class depgraph(object):
 
 		ignore_build_time_deps = False
 		if pkg.built and not removal_action:
-			if self._frozen_config.myopts.get("--with-bdeps", "n") == "y":
+			if self._dynamic_config.myparams.get("bdeps", "n") == "y":
 				# Pull in build time deps as requested, but marked them as
 				# "optional" since they are not strictly required. This allows
 				# more freedom in the merge order calculation for solving
@@ -1257,7 +1257,7 @@ class depgraph(object):
 			else:
 				ignore_build_time_deps = True
 
-		if removal_action and self._frozen_config.myopts.get("--with-bdeps", "y") == "n":
+		if removal_action and self._dynamic_config.myparams.get("bdeps", "y") == "n":
 			ignore_build_time_deps = True
 
 		if removal_action:
@@ -3854,6 +3854,9 @@ class depgraph(object):
 			self._select_package = self._select_pkg_from_installed
 		else:
 			self._select_package = self._select_pkg_from_graph
+			# Make the graph as complete as possible by traversing build-time
+			# dependencies if they happen to be installed already.
+			self._dynamic_config.myparams["bdeps"] = "y"
 		already_deep = self._dynamic_config.myparams.get("deep") is True
 		if not already_deep:
 			self._dynamic_config.myparams["deep"] = True



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-01 23:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-01 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     dd794a5e94fa846975b440824534aeffd629f60b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May  1 23:27:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May  1 23:27:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd794a5e

trigger_rebuilds: handle circular deps

---
 pym/_emerge/depgraph.py |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4753bd2..5c39497 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -235,16 +235,42 @@ class _rebuild_config(object):
 		runtime_deps = {}
 		leaf_nodes = deque(graph.leaf_nodes())
 
+		def ignore_non_runtime(priority):
+			return not priority.runtime
+
+		def ignore_non_buildtime(priority):
+			return not priority.buildtime
+
 		# Trigger rebuilds bottom-up (starting with the leaves) so that parents
 		# will always know which children are being rebuilt.
-		while leaf_nodes:
+		while not graph.empty():
+			if not leaf_nodes:
+				# We're interested in intersection of buildtime and runtime,
+				# so ignore edges that do not contain both.
+				leaf_nodes.extend(graph.leaf_nodes(
+					ignore_priority=ignore_non_runtime))
+				if not leaf_nodes:
+					leaf_nodes.extend(graph.leaf_nodes(
+						ignore_priority=ignore_non_buildtime))
+					if not leaf_nodes:
+						# We'll have to drop an edge that is both
+						# buildtime and runtime. This should be
+						# quite rare.
+						leaf_nodes.append(graph.order[-1])
+
 			node = leaf_nodes.popleft()
+			if node not in graph:
+				# This can be triggered by circular dependencies.
+				continue
 			slot_atom = node.slot_atom
 
 			# Remove our leaf node from the graph, keeping track of deps.
 			parents = graph.nodes[node][1].items()
 			graph.remove(node)
 			for parent, priorities in parents:
+				if parent == node:
+					# Ignore a direct cycle.
+					continue
 				for priority in priorities:
 					if priority.buildtime:
 						build_deps.setdefault(parent, {})[slot_atom] = node



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-02  1:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-02  1:44 UTC (permalink / raw
  To: gentoo-commits

commit:     b33d96f3f60a494ff528a3bd0671a3d0fa6682e8
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: Mon May  2 01:42:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b33d96f3

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 5c39497..2401541 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2465,6 +2465,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):
 		"""
@@ -4394,65 +4427,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):
 		"""
@@ -4669,29 +4681,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-02  3:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-02  3:10 UTC (permalink / raw
  To: gentoo-commits

commit:     60564a32c71ce9362e9329c7fd87783699c2c4b4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May  2 03:09:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May  2 03:09:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60564a32

depgraph: queue ignored deps for later traversal

This will fix an issue with some build-time deps being ignored by
--complete-graph in cases when --with-bdeps is not enabled. It
should help --rebuild to find more rebuilds in this case.

---
 pym/_emerge/depgraph.py |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2401541..80d701c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -374,6 +374,7 @@ class _dynamic_depgraph_config(object):
 
 		self._autounmask = depgraph._frozen_config.myopts.get('--autounmask', 'n') == True
 		self._success_without_autounmask = False
+		self._traverse_ignored_deps = False
 
 		for myroot in depgraph._frozen_config.trees:
 			self.sets[myroot] = _depgraph_sets()
@@ -898,8 +899,9 @@ class depgraph(object):
 
 		self._rebuild.add(dep_pkg, dep)
 
-		if (not dep.collapsed_priority.ignored and
-			not self._add_pkg(dep_pkg, dep)):
+		ignore = dep.collapsed_priority.ignored and \
+			not self._dynamic_config._traverse_ignored_deps
+		if not ignore and not self._add_pkg(dep_pkg, dep):
 			return 0
 		return 1
 
@@ -1300,7 +1302,7 @@ class depgraph(object):
 		deps = (
 			(depend_root, edepend["DEPEND"],
 				self._priority(buildtime=True,
-				optional=pkg.built,
+				optional=(pkg.built or ignore_build_time_deps),
 				ignored=ignore_build_time_deps),
 				pkg.built or ignore_build_time_deps),
 			(myroot, edepend["RDEPEND"],
@@ -1479,11 +1481,17 @@ class depgraph(object):
 					self._dynamic_config._ignored_deps.append(dep)
 
 			if not ignored:
-				if not self._add_dep(dep,
-					allow_unsatisfied=allow_unsatisfied):
-					return 0
-				if is_virt and dep.child is not None:
-					traversed_virt_pkgs.add(dep.child)
+				if dep_priority.ignored:
+					if is_virt and dep.child is not None:
+						traversed_virt_pkgs.add(dep.child)
+					dep.child = None
+					self._dynamic_config._ignored_deps.append(dep)
+				else:
+					if not self._add_dep(dep,
+						allow_unsatisfied=allow_unsatisfied):
+						return 0
+					if is_virt and dep.child is not None:
+						traversed_virt_pkgs.add(dep.child)
 
 		selected_atoms.pop(pkg)
 
@@ -1565,11 +1573,17 @@ class depgraph(object):
 						self._dynamic_config._ignored_deps.append(dep)
 
 				if not ignored:
-					if not self._add_dep(dep,
-						allow_unsatisfied=allow_unsatisfied):
-						return 0
-					if is_virt and dep.child is not None:
-						traversed_virt_pkgs.add(dep.child)
+					if dep_priority.ignored:
+						if is_virt and dep.child is not None:
+							traversed_virt_pkgs.add(dep.child)
+						dep.child = None
+						self._dynamic_config._ignored_deps.append(dep)
+					else:
+						if not self._add_dep(dep,
+							allow_unsatisfied=allow_unsatisfied):
+							return 0
+						if is_virt and dep.child is not None:
+							traversed_virt_pkgs.add(dep.child)
 
 		if debug:
 			writemsg_level("Exiting... %s\n" % (pkg,),
@@ -3916,6 +3930,7 @@ class depgraph(object):
 			# Make the graph as complete as possible by traversing build-time
 			# dependencies if they happen to be installed already.
 			self._dynamic_config.myparams["bdeps"] = "y"
+			self._dynamic_config._traverse_ignored_deps = True
 		already_deep = self._dynamic_config.myparams.get("deep") is True
 		if not already_deep:
 			self._dynamic_config.myparams["deep"] = True



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-02 19:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-02 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     5f9dedaa14bbb704e055f2fa616821b79f9c6914
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: Mon May  2 19:34:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5f9dedaa

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 5183b27..dd1b5e8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1375,6 +1375,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 or dep_priority.ignored:
+			# 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-02 20:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-02 20:00 UTC (permalink / raw
  To: gentoo-commits

commit:     1afde255d556a904148e3ee77c5e82589161ccc5
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: Mon May  2 19:54:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1afde255

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 dd1b5e8..8a76863 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2996,8 +2996,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-04 17:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-04 17:24 UTC (permalink / raw
  To: gentoo-commits

commit:     af430c8b439cf67079b54fa3b18312e0a6afce8d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  4 17:20:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 17:20:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af430c8b

add_pkg_dep_string: respect traverse_ignored_deps

I don't think this makes any difference now, but it clarifies how
traverse_ignored_deps should behave.

---
 pym/_emerge/depgraph.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ebfbdd4..9dcc5b9 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1543,7 +1543,8 @@ class depgraph(object):
 					self._dynamic_config._ignored_deps.append(dep)
 
 			if not ignored:
-				if dep_priority.ignored:
+				if dep_priority.ignored and \
+					not self._dynamic_config._traverse_ignored_deps:
 					if is_virt and dep.child is not None:
 						traversed_virt_pkgs.add(dep.child)
 					dep.child = None
@@ -1573,7 +1574,8 @@ class depgraph(object):
 					(virt_pkg.cpv, [str(x) for x in atoms]),
 					noiselevel=-1, level=logging.DEBUG)
 
-			if not dep_priority.ignored:
+			if not dep_priority.ignored or \
+				self._dynamic_config._traverse_ignored_deps:
 				if not self._add_pkg(virt_pkg, virt_dep):
 					return 0
 
@@ -1635,7 +1637,8 @@ class depgraph(object):
 						self._dynamic_config._ignored_deps.append(dep)
 
 				if not ignored:
-					if dep_priority.ignored:
+					if dep_priority.ignored and \
+						not self._dynamic_config._traverse_ignored_deps:
 						if is_virt and dep.child is not None:
 							traversed_virt_pkgs.add(dep.child)
 						dep.child = None



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-04 18:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-04 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     dbb89fde73049da97fdbfa157618977317440db5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  4 18:18:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 18:18:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dbb89fde

add_pkg_deps: use dep priority to ignore blockers

---
 pym/_emerge/depgraph.py |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9dcc5b9..dd65a45 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1351,20 +1351,17 @@ class depgraph(object):
 			(depend_root, edepend["DEPEND"],
 				self._priority(buildtime=True,
 				optional=(pkg.built or ignore_build_time_deps),
-				ignored=ignore_build_time_deps),
-				pkg.built or ignore_build_time_deps),
+				ignored=ignore_build_time_deps)),
 			(myroot, edepend["RDEPEND"],
-				self._priority(runtime=True),
-				False),
+				self._priority(runtime=True)),
 			(myroot, edepend["PDEPEND"],
-				self._priority(runtime_post=True),
-				False)
+				self._priority(runtime_post=True))
 		)
 
 		debug = "--debug" in self._frozen_config.myopts
 		strict = mytype != "installed"
 
-		for dep_root, dep_string, dep_priority, ignore_blockers in deps:
+		for dep_root, dep_string, dep_priority in deps:
 				if not dep_string:
 					continue
 				if debug:
@@ -1415,14 +1412,14 @@ class depgraph(object):
 
 				if not self._add_pkg_dep_string(
 					pkg, dep_root, dep_priority, dep_string,
-					allow_unsatisfied, ignore_blockers=ignore_blockers):
+					allow_unsatisfied):
 					return 0
 
 		self._dynamic_config._traversed_pkg_deps.add(pkg)
 		return 1
 
 	def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string,
-		allow_unsatisfied, ignore_blockers=False):
+		allow_unsatisfied):
 		_autounmask_backup = self._dynamic_config._autounmask
 		if dep_priority.optional or dep_priority.ignored:
 			# Temporarily disable autounmask for deps that
@@ -1431,12 +1428,12 @@ class depgraph(object):
 		try:
 			return self._wrapped_add_pkg_dep_string(
 				pkg, dep_root, dep_priority, dep_string,
-				allow_unsatisfied, ignore_blockers=ignore_blockers)
+				allow_unsatisfied)
 		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):
+		dep_string, allow_unsatisfied):
 		depth = pkg.depth + 1
 		deep = self._dynamic_config.myparams.get("deep", 0)
 		recurse_satisfied = deep is True or depth <= deep
@@ -1483,7 +1480,8 @@ class depgraph(object):
 			is_virt = hasattr(atom, '_orig_atom')
 			atom = getattr(atom, '_orig_atom', atom)
 
-			if ignore_blockers and atom.blocker:
+			if atom.blocker and \
+				(dep_priority.optional or dep_priority.ignored):
 				# For --with-bdeps, ignore build-time only blockers
 				# that originate from built packages.
 				continue



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-04 21:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-04 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     021da7d19f9da25329880096fccf1cc556a011e2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  4 21:40:11 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 21:40:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=021da7d1

add_pkg_deps: removal action discard DEPEND early

---
 pym/_emerge/depgraph.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index dd65a45..52b92e2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1334,6 +1334,9 @@ class depgraph(object):
 				ignore_build_time_deps = True
 
 		if removal_action and self._dynamic_config.myparams.get("bdeps", "y") == "n":
+			# Removal actions never traverse ignored buildtime
+			# dependencies, so it's safe to discard them early.
+			edepend["DEPEND"] = ""
 			ignore_build_time_deps = True
 
 		if removal_action:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-05 15:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-05 15:56 UTC (permalink / raw
  To: gentoo-commits

commit:     4602463a7d577c8c4534f2a675182e02ba93e570
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 15:58:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4602463a

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 52b92e2..47c0232 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3075,9 +3075,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-05 17:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-05 17:20 UTC (permalink / raw
  To: gentoo-commits

commit:     2fc0237f7ecda61abebd46bb7dc9f173bbed8868
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 17:21:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2fc0237f

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 47c0232..1f80d0c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4573,8 +4573,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.
@@ -4596,31 +4594,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.values())
+		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():
@@ -6427,7 +6421,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-07  3:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-07  3:28 UTC (permalink / raw
  To: gentoo-commits

commit:     547d22391e7162fe79a793d7662b3d6d60327796
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: Sat May  7 03:28:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=547d2239

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 92db36e..38afe7d 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-08  4:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-08  4:53 UTC (permalink / raw
  To: gentoo-commits

commit:     a81460175a441897282b0540cefff8060f2b92dc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May  8 04:16:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May  8 04:35:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a8146017

Scheduler: add queue for ebuild-locks

Use a separate queue for ebuild-locks when the merge
queue allows more than 1 job (due to parallel-install),
since the portage.locks module does not behave as desired
if we try to lock the same file multiple times
concurrently from the same process.

---
 pym/_emerge/Scheduler.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 182ad87..6c21c71 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -95,7 +95,7 @@ class Scheduler(PollScheduler):
 		__slots__ = ("log_file", "schedule")
 
 	_task_queues_class = slot_dict_class(
-		("merge", "jobs", "fetch", "unpack"), prefix="")
+		("merge", "jobs", "ebuild_locks", "fetch", "unpack"), prefix="")
 
 	class _build_opts_class(SlotObject):
 		__slots__ = ("buildpkg", "buildpkgonly",
@@ -565,7 +565,16 @@ class Scheduler(PollScheduler):
 		Schedule a setup phase on the merge queue, in order to
 		serialize unsandboxed access to the live filesystem.
 		"""
-		self._task_queues.merge.add(setup_phase)
+		if self._task_queues.merge.max_jobs > 1 and \
+			"ebuild-locks" in self.settings.features:
+			# Use a separate queue for ebuild-locks when the merge
+			# queue allows more than 1 job (due to parallel-install),
+			# since the portage.locks module does not behave as desired
+			# if we try to lock the same file multiple times
+			# concurrently from the same process.
+			self._task_queues.ebuild_locks.add(setup_phase)
+		else:
+			self._task_queues.merge.add(setup_phase)
 		self._schedule()
 
 	def _schedule_unpack(self, unpack_phase):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-08  5:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-08  5:58 UTC (permalink / raw
  To: gentoo-commits

commit:     8928df70eab1c7863d6ff0639418b6d25eb77c1e
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 05:58:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8928df70

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 6c21c71..fbf2d2d 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
@@ -1644,14 +1646,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()
@@ -1670,7 +1677,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-08  6:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-08  6:25 UTC (permalink / raw
  To: gentoo-commits

commit:     09cb0079ee6da6fef3eea1043f3e75e89ec954d7
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 06:24:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=09cb0079

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 fa490c2..ff092ad 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -119,20 +119,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-08 18:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-08 18:27 UTC (permalink / raw
  To: gentoo-commits

commit:     98b0a31bf0c3cc9dce6788eae4beee04ce354791
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:24:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=98b0a31b

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 1f80d0c..83d6e9b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4606,7 +4606,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[
@@ -6421,7 +6421,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-08 19:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-08 19:05 UTC (permalink / raw
  To: gentoo-commits

commit:     d9f3f0bb9112b60b38fef6d9cd73eb4f0beb8950
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:05:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d9f3f0bb

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 fbf2d2d..74d888a 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-09  6:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-09  6:09 UTC (permalink / raw
  To: gentoo-commits

commit:     1a693adbc6ea559e92f88268c0d5b3d54c0f7c06
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: Mon May  9 06:08:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a693adb

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-09  6:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-09  6:28 UTC (permalink / raw
  To: gentoo-commits

commit:     cd54d00ab3035525e500512bdeb49e1c15585342
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: Mon May  9 06:27:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cd54d00a

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 9bc3aaf..007984e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3016,10 +3016,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-09 22:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-09 22:34 UTC (permalink / raw
  To: gentoo-commits

commit:     2e530322dad9747cd85e7a1d9cf5326a99af4979
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: Mon May  9 22:34:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2e530322

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 83d6e9b..80a7d6c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6048,6 +6048,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-10  1:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-10  1:03 UTC (permalink / raw
  To: gentoo-commits

commit:     57b3d395aa582e798f008240ebd635fd0f269bed
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: Tue May 10 01:03:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=57b3d395

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 |   44 +-------------------------------------------
 1 files changed, 1 insertions(+), 43 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 80a7d6c..7b1940b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6069,9 +6069,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 = []
@@ -6111,7 +6108,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):
@@ -6175,45 +6172,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"),
-				allow_repo=True)
-			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),
-					allow_repo=True)
-			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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-10  5:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-10  5:11 UTC (permalink / raw
  To: gentoo-commits

commit:     d124a775634706eb954fa70116de8367f165d1d5
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: Tue May 10 05:11:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d124a775

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 7b1940b..22a603e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -551,14 +551,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-10 23:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-10 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     93e7c03d9a09ec61931bb4e8f4fdf4e4083ac19c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 10 23:54:55 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 10 23:54:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=93e7c03d

depgraph: traverse ignored DEPEND if "complete"

---
 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 f7ea686..6c79819 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1343,8 +1343,11 @@ class depgraph(object):
 					ignore_build_time_deps = True
 
 		# If rebuild mode is not enabled, it's safe to discard ignored
-		# build-time dependencies.
-		if ignore_build_time_deps and not self._rebuild.rebuild:
+		# build-time dependencies. However, keep them if "complete" mode
+		# is enabled, since they make the graph more complete.
+		if ignore_build_time_deps and \
+			not self._rebuild.rebuild and \
+			"complete" not in self._dynamic_config.myparams:
 			edepend["DEPEND"] = ""
 
 		deps = (



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-10 23:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-10 23:53 UTC (permalink / raw
  To: gentoo-commits

commit:     44675153854fe54fbd3c148fab2661df80fbf7ab
Author:     David James <davidjames <AT> chromium <DOT> org>
AuthorDate: Tue May 10 20:41:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 10 23:47:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=44675153

Strip build-time dependencies when they're ignored and we're not in --rebuild mode.

This should improve depgraph calculation performance.

TEST=Ran test suite.
BUG=chromium-os:15144

Change-Id: I9e06817201d7a17ae9b44b424d01c1a2bd89210a

---
 pym/_emerge/depgraph.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 22a603e..f7ea686 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1342,6 +1342,11 @@ class depgraph(object):
 				elif root_deps == "rdeps":
 					ignore_build_time_deps = True
 
+		# If rebuild mode is not enabled, it's safe to discard ignored
+		# build-time dependencies.
+		if ignore_build_time_deps and not self._rebuild.rebuild:
+			edepend["DEPEND"] = ""
+
 		deps = (
 			(depend_root, edepend["DEPEND"],
 				self._priority(buildtime=True,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-11  4:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-11  4:07 UTC (permalink / raw
  To: gentoo-commits

commit:     bd78d51c715b711a5d496d68bb48421b777bf609
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: Wed May 11 04:03:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bd78d51c

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 6c79819..b8089ae 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6051,7 +6051,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
@@ -6062,6 +6064,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-11 20:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-11 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     326513cd5d7c3e9299e374f0b10e87c82dc2bdb0
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: Wed May 11 20:24:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=326513cd

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-11 23:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-11 23:49 UTC (permalink / raw
  To: gentoo-commits

commit:     60c086dcb69472bfcea3cb61ffd87bd796d46671
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: Wed May 11 23:50:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60c086dc

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 21d7f47..ff76fc6 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -105,7 +105,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-14 21:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-14 21:01 UTC (permalink / raw
  To: gentoo-commits

commit:     a531c670849d81edd15ba3e3ae820cbfe063db68
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: Sat May 14 21:01:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a531c670

--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 3169d19..16cb7fc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5543,10 +5543,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))
@@ -5556,12 +5584,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():
@@ -5570,14 +5604,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-15  5:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-15  5:21 UTC (permalink / raw
  To: gentoo-commits

commit:     80145998591fc0dc51ab4a96a279fed40a04345a
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: Sun May 15 05:21:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80145998

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 38afe7d..ee0fc4e 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-15  8:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-15  8:03 UTC (permalink / raw
  To: gentoo-commits

commit:     f3f88c6a3695755aafa3765219fa323fe46679d6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 15 08:03:14 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 15 08:03:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f3f88c6a

EbuildPhase: AsynchronousLock for ebuild-locks

---
 pym/_emerge/EbuildPhase.py |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index ff76fc6..0b4afe7 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -5,13 +5,12 @@ import gzip
 import sys
 import tempfile
 
+from _emerge.AsynchronousLock import AsynchronousLock
 from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
 from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
 from _emerge.EbuildProcess import EbuildProcess
 from _emerge.CompositeTask import CompositeTask
 from portage.util import writemsg
-from portage.locks import lockdir
-from portage.locks import unlockdir
 from portage.xml.metadata import MetaDataXML
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
@@ -121,6 +120,25 @@ class EbuildPhase(CompositeTask):
 			self.wait()
 			return
 
+		self._start_lock()
+
+	def _start_lock(self):
+		if (self.phase in self._locked_phases and
+			"ebuild-locks" in self.settings.features):
+			eroot = self.settings["EROOT"]
+			lock_path = os.path.join(eroot, portage.VDB_PATH + "-ebuild")
+			if os.access(os.path.dirname(lock_path), os.W_OK):
+				self._ebuild_lock = AsynchronousLock(path=lock_path,
+					scheduler=self.scheduler)
+				self._start_task(self._ebuild_lock, self._lock_exit)
+				return
+
+		self._start_ebuild()
+
+	def _lock_exit(self, ebuild_lock):
+		if self._default_exit(ebuild_lock) != os.EX_OK:
+			self.wait()
+			return
 		self._start_ebuild()
 
 	def _start_ebuild(self):
@@ -144,18 +162,12 @@ class EbuildPhase(CompositeTask):
 			phase=self.phase, scheduler=self.scheduler,
 			settings=self.settings)
 
-		if (self.phase in self._locked_phases and
-			"ebuild-locks" in self.settings.features):
-			eroot = self.settings["EROOT"]
-			lock_path = os.path.join(eroot, portage.VDB_PATH + "-ebuild")
-			if os.access(os.path.dirname(lock_path), os.W_OK):
-				self._ebuild_lock = lockdir(lock_path)
 		self._start_task(ebuild_process, self._ebuild_exit)
 
 	def _ebuild_exit(self, ebuild_process):
 
 		if self._ebuild_lock is not None:
-			unlockdir(self._ebuild_lock)
+			self._ebuild_lock.unlock()
 			self._ebuild_lock = None
 
 		fail = False



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-15  8:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-15  8:14 UTC (permalink / raw
  To: gentoo-commits

commit:     102006ae93b32fc20f6c9324e2e90252277ee5b1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 15 08:14:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 15 08:14:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=102006ae

EbuildPhase: fix locking for setup phase

---
 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 0b4afe7..db1d59e 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -113,7 +113,7 @@ class EbuildPhase(CompositeTask):
 			# If the environment.bz2 doesn't exist, then ebuild.sh will
 			# source the ebuild as a fallback.
 
-		self._start_ebuild()
+		self._start_lock()
 
 	def _env_extractor_exit(self, env_extractor):
 		if self._default_exit(env_extractor) != os.EX_OK:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-15  9:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-15  9:02 UTC (permalink / raw
  To: gentoo-commits

commit:     33a3a2d9cdc44e07aaece8fdf08a3d3bde6e5d82
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 15 09:02:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 15 09:02:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=33a3a2d9

EbuildMerge: inherit from CompositeTask

---
 pym/_emerge/Binpkg.py      |    3 +--
 pym/_emerge/EbuildBuild.py |    3 +--
 pym/_emerge/EbuildMerge.py |   20 ++++++++++----------
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index bc6b85d..1ed5c1f 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -315,12 +315,11 @@ class Binpkg(CompositeTask):
 		settings["PORTAGE_BINPKG_FILE"] = self._pkg_path
 		settings.backup_changes("PORTAGE_BINPKG_FILE")
 
-		merge = EbuildMerge(find_blockers=self.find_blockers,
+		task = EbuildMerge(find_blockers=self.find_blockers,
 			ldpath_mtimes=self.ldpath_mtimes, logger=self.logger,
 			pkg=self.pkg, pkg_count=self.pkg_count,
 			pkg_path=self._pkg_path, scheduler=self.scheduler,
 			settings=settings, tree=self._tree, world_atom=self.world_atom)
-		task = merge.create_task()
 		task.addExitListener(self._install_exit)
 		return task
 

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 1de8fbf..a678ede 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -330,7 +330,7 @@ class EbuildBuild(CompositeTask):
 		ebuild_path = self._ebuild_path
 		tree = self._tree
 
-		merge = EbuildMerge(find_blockers=self.find_blockers,
+		task = EbuildMerge(find_blockers=self.find_blockers,
 			ldpath_mtimes=ldpath_mtimes, logger=logger, pkg=pkg,
 			pkg_count=pkg_count, pkg_path=ebuild_path,
 			scheduler=self.scheduler,
@@ -343,7 +343,6 @@ class EbuildBuild(CompositeTask):
 			(pkg_count.curval, pkg_count.maxval, pkg.cpv)
 		logger.log(msg, short_msg=short_msg)
 
-		task = merge.create_task()
 		task.addExitListener(self._install_exit)
 		return task
 

diff --git a/pym/_emerge/EbuildMerge.py b/pym/_emerge/EbuildMerge.py
index 78711b7..28d17f9 100644
--- a/pym/_emerge/EbuildMerge.py
+++ b/pym/_emerge/EbuildMerge.py
@@ -1,26 +1,24 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from _emerge.SlotObject import SlotObject
-import portage
+from _emerge.CompositeTask import CompositeTask
 from portage import os
 from portage.dbapi._MergeProcess import MergeProcess
 from portage.dbapi.vartree import dblink
 
-class EbuildMerge(SlotObject):
+class EbuildMerge(CompositeTask):
 
 	__slots__ = ("find_blockers", "logger", "ldpath_mtimes",
 		"pkg", "pkg_count", "pkg_path", "pretend",
-		"scheduler", "settings", "tree", "world_atom")
+		"settings", "tree", "world_atom")
 
-	def create_task(self):
+	def _start(self):
 		root_config = self.pkg.root_config
 		settings = self.settings
 		mycat = settings["CATEGORY"]
 		mypkg = settings["PF"]
 		pkgloc = settings["D"]
 		infloc = os.path.join(settings["PORTAGE_BUILDDIR"], "build-info")
-		myroot = root_config.root
 		myebuild = settings["EBUILD"]
 		mydbapi = root_config.trees[self.tree].dbapi
 		vartree = root_config.trees["vartree"]
@@ -33,11 +31,12 @@ class EbuildMerge(SlotObject):
 			background=background, blockers=self.find_blockers, pkgloc=pkgloc,
 			infloc=infloc, myebuild=myebuild, mydbapi=mydbapi,
 			prev_mtimes=self.ldpath_mtimes, logfile=logfile)
-		merge_task.addExitListener(self._log_exit)
-		return merge_task
 
-	def _log_exit(self, task):
-		if task.returncode != os.EX_OK:
+		self._start_task(merge_task, self._merge_exit)
+
+	def _merge_exit(self, merge_task):
+		if self._final_exit(merge_task) != os.EX_OK:
+			self.wait()
 			return
 
 		pkg = self.pkg
@@ -55,3 +54,4 @@ class EbuildMerge(SlotObject):
 		logger.log(" ::: completed emerge (%s of %s) %s to %s" % \
 			(pkg_count.curval, pkg_count.maxval, pkg.cpv, pkg.root))
 
+		self.wait()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-16  6:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-16  6:18 UTC (permalink / raw
  To: gentoo-commits

commit:     0ee4c2b7195e03c828dc4f1ef85825509a5fe77a
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: Mon May 16 06:17:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0ee4c2b7

_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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-16  6:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-16  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     4ca3a0de43b6a7093f97330a31a76320db53f3f7
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: Mon May 16 06:54:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4ca3a0de

_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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-16  7:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-16  7:10 UTC (permalink / raw
  To: gentoo-commits

commit:     aeaa86486d9ea5a799c49bf8baa9a24a87ccb4de
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: Mon May 16 07:10:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aeaa8648

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-16  7:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-16  7:21 UTC (permalink / raw
  To: gentoo-commits

commit:     e26008ef6eea54c04d3fe62a0e657e4a4581025a
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: Mon May 16 07:21:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e26008ef

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-16 19:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-16 19:31 UTC (permalink / raw
  To: gentoo-commits

commit:     1c16fe8e3740e6b9e1e1562731a0c4b5a000fd92
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon May 16 19:21:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 16 19:27:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1c16fe8e

--autounmask-write: respect --ask

---
 pym/_emerge/depgraph.py |  100 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 64 insertions(+), 36 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5004e6c..2a6d1b1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -57,6 +57,7 @@ from _emerge.SetArg import SetArg
 from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
 from _emerge.UnmergeDepPriority import UnmergeDepPriority
 from _emerge.UseFlagDisplay import pkg_use_display
+from _emerge.userquery import userquery
 
 from _emerge.resolver.backtracking import Backtracker, BacktrackParameter
 from _emerge.resolver.slot_collision import slot_conflict_handler
@@ -5538,6 +5539,8 @@ class depgraph(object):
 
 		autounmask_write = self._frozen_config.myopts.get("--autounmask-write", "n") == True
 		pretend = "--pretend" in self._frozen_config.myopts
+		ask = "--ask" in self._frozen_config.myopts
+		enter_invalid = '--ask-enter-invalid' in self._frozen_config.myopts
 
 		def check_if_latest(pkg):
 			is_latest = True
@@ -5710,6 +5713,30 @@ class depgraph(object):
 
 			write_to_file = not problems
 
+		for root in roots:
+			abs_user_config = os.path.join(root, USER_CONFIG_PATH)
+			if len(roots) > 1:
+				writemsg_stdout("\nFor %s:\n" % abs_user_config, noiselevel=-1)
+
+			if root in unstable_keyword_msg:
+				writemsg_stdout("\nThe following " + colorize("BAD", "keyword changes") + \
+					" are necessary to proceed:\n", noiselevel=-1)
+				writemsg_stdout("".join(unstable_keyword_msg[root]), noiselevel=-1)
+
+			if root in p_mask_change_msg:
+				writemsg_stdout("\nThe following " + colorize("BAD", "mask changes") + \
+					" are necessary to proceed:\n", noiselevel=-1)
+				writemsg_stdout("".join(p_mask_change_msg[root]), noiselevel=-1)
+
+			if root in use_changes_msg:
+				writemsg_stdout("\nThe following " + colorize("BAD", "USE changes") + \
+					" are necessary to proceed:\n", noiselevel=-1)
+				writemsg_stdout("".join(use_changes_msg[root]), noiselevel=-1)
+
+			if root in license_msg:
+				writemsg_stdout("\nThe following " + colorize("BAD", "license changes") + \
+					" are necessary to proceed:\n", noiselevel=-1)
+				writemsg_stdout("".join(license_msg[root]), noiselevel=-1)
 
 		protect_obj = {}
 		if write_to_file:
@@ -5719,48 +5746,49 @@ class depgraph(object):
 					shlex_split(settings.get("CONFIG_PROTECT", "")),
 					shlex_split(settings.get("CONFIG_PROTECT_MASK", "")))
 
-		def write_changes(root, change_type, changes, file_to_write_to):
-			writemsg_stdout("\nThe following " + colorize("BAD", "%s changes" % change_type) + \
-				" are necessary to proceed:\n", noiselevel=-1)
-			writemsg_stdout("".join(changes), noiselevel=-1)
-			if write_to_file:
+		def write_changes(root, changes, file_to_write_to):
+			try:
+				file_contents = codecs.open(
+					_unicode_encode(file_to_write_to,
+					encoding=_encodings['fs'], errors='strict'),
+					mode='r', encoding=_encodings['content'],
+					errors='replace').readlines()
+			except IOError as e:
+				problems.append("!!! Failed to read '%s': %s\n" % (file_to_write_to, e))
+			else:
+				file_contents.extend(changes)
+				if protect_obj[root].isprotected(file_to_write_to):
+					file_to_write_to = new_protect_filename(file_to_write_to)
 				try:
-					file_contents = codecs.open(
-						_unicode_encode(file_to_write_to,
-						encoding=_encodings['fs'], errors='strict'),
-						mode='r', encoding=_encodings['content'],
-						errors='replace').readlines()
-				except IOError as e:
-					problems.append("!!! Failed to read '%s': %s\n" % (file_to_write_to, e))
-				else:
-					file_contents.extend(changes)
-					if protect_obj[root].isprotected(file_to_write_to):
-						file_to_write_to = new_protect_filename(file_to_write_to)
-					try:
-						write_atomic(file_to_write_to, "".join(file_contents))
-					except PortageException:
-						problems.append("!!! Failed to write '%s'\n" % file_to_write_to)
+					write_atomic(file_to_write_to, "".join(file_contents))
+				except PortageException:
+					problems.append("!!! Failed to write '%s'\n" % file_to_write_to)
 
-		for root in roots:
-			abs_user_config = os.path.join(root, USER_CONFIG_PATH)
-			if len(roots) > 1:
-				writemsg_stdout("\nFor %s:\n" % abs_user_config, noiselevel=-1)
+		if write_to_file and ask:
+			prompt = "\nWould you like to add these " + \
+				"changes to your config files?"
+			if userquery(prompt, enter_invalid) == 'No':
+				write_to_file = False
 
-			if root in unstable_keyword_msg:
-				write_changes(root, "keyword", unstable_keyword_msg[root],
-					file_to_write_to.get((abs_user_config, "package.keywords")))
+		if write_to_file:
+			for root in roots:
+				abs_user_config = os.path.join(root, USER_CONFIG_PATH)
 
-			if root in p_mask_change_msg:
-				write_changes(root, "mask", p_mask_change_msg[root],
-					file_to_write_to.get((abs_user_config, "package.unmask")))
+				if root in unstable_keyword_msg:
+					write_changes(root, unstable_keyword_msg[root],
+						file_to_write_to.get((abs_user_config, "package.keywords")))
 
-			if root in use_changes_msg:
-				write_changes(root, "USE", use_changes_msg[root],
-					file_to_write_to.get((abs_user_config, "package.use")))
+				if root in p_mask_change_msg:
+					write_changes(root, p_mask_change_msg[root],
+						file_to_write_to.get((abs_user_config, "package.unmask")))
 
-			if root in license_msg:
-				write_changes(root, "license", license_msg[root],
-					file_to_write_to.get((abs_user_config, "package.license")))
+				if root in use_changes_msg:
+					write_changes(root, use_changes_msg[root],
+						file_to_write_to.get((abs_user_config, "package.use")))
+
+				if root in license_msg:
+					write_changes(root, license_msg[root],
+						file_to_write_to.get((abs_user_config, "package.license")))
 
 		if problems:
 			writemsg_stdout("\nThe following problems occurred while writing autounmask changes:\n", \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-17  6:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-17  6:11 UTC (permalink / raw
  To: gentoo-commits

commit:     b29beea0ef190c8dad0e2742e89d34d1212ab9e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 06:10:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 17 06:10:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b29beea0

--autounmask-write: handle config file recursion

---
 pym/_emerge/depgraph.py |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 1de147a..9e97415 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -8,6 +8,7 @@ import difflib
 import gc
 import logging
 import re
+import stat
 import sys
 import textwrap
 from collections import deque
@@ -5663,25 +5664,36 @@ class depgraph(object):
 			"""
 			Searches /etc/portage for an appropriate file to append changes to.
 			If the file_name is a file it is returned, if it is a directory, the
-			last file in it is returned.
+			last file in it is returned. Order of traversal is the identical to
+			portage.util.grablines(recursive=True).
 
 			file_name - String containing a file name like "package.use"
 			return value - String. Absolute path of file to write to. None if
 			no suitable file exists.
 			"""
 			file_path = os.path.join(abs_user_config, file_name)
-			if os.path.exists(file_path):
-				if os.path.isfile(file_path):
-					return file_path
-				elif os.path.isdir(file_path):
-					try:
-						files = sorted(f for f in os.listdir(file_path) \
-							if os.path.isfile(os.path.join(file_path, f)))
-						if len(files) != 0:
-							return os.path.join(file_path, files[-1])
-					except OSError:
-						pass
+			last_file_path = None
+			stack = [file_path]
+			while stack:
+				p = stack.pop()
+				try:
+					st = os.stat(p)
+				except OSError:
+					pass
+				else:
+					if stat.S_ISREG(st.st_mode):
+						last_file_path = p
+					elif stat.S_ISDIR(st.st_mode):
+						try:
+							contents = os.listdir(p)
+						except OSError:
+							pass
+						else:
+							contents.sort(reverse=True)
+							for child in contents:
+								stack.append(os.path.join(p, child))
 
+			return last_file_path
 
 		write_to_file = autounmask_write and not pretend
 		#Make sure we have a file to write to before doing any write.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-17  6:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-17  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     360050ed30e257d2e9c3a49f65b5a1c70a6f57cf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 06:29:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 17 06:29:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=360050ed

--autounmask-write: only prompt when necessary

---
 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 9e97415..3daaf44 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5776,7 +5776,7 @@ class depgraph(object):
 				except PortageException:
 					problems.append("!!! Failed to write '%s'\n" % file_to_write_to)
 
-		if write_to_file and ask:
+		if ask and write_to_file and file_to_write_to:
 			prompt = "\nWould you like to add these " + \
 				"changes to your config files?"
 			if userquery(prompt, enter_invalid) == 'No':



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-17  6:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-17  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     a6ea5746a7837e555a0a590a232f8ecdaf03fd89
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 06:54:52 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 17 06:54:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a6ea5746

--autounmask-write: handle non-existent file

---
 pym/_emerge/depgraph.py |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3daaf44..9f3c1ac 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5,6 +5,7 @@ from __future__ import print_function
 
 import codecs
 import difflib
+import errno
 import gc
 import logging
 import re
@@ -5672,6 +5673,18 @@ class depgraph(object):
 			no suitable file exists.
 			"""
 			file_path = os.path.join(abs_user_config, file_name)
+
+			try:
+				os.lstat(file_path)
+			except OSError as e:
+				if e.errno == errno.ENOENT:
+					# The file doesn't exist, so we'll
+					# simply create it.
+					return file_path
+
+				# Disk or file system trouble?
+				return None
+
 			last_file_path = None
 			stack = [file_path]
 			while stack:
@@ -5759,6 +5772,7 @@ class depgraph(object):
 					shlex_split(settings.get("CONFIG_PROTECT_MASK", "")))
 
 		def write_changes(root, changes, file_to_write_to):
+			file_contents = None
 			try:
 				file_contents = codecs.open(
 					_unicode_encode(file_to_write_to,
@@ -5766,8 +5780,12 @@ class depgraph(object):
 					mode='r', encoding=_encodings['content'],
 					errors='replace').readlines()
 			except IOError as e:
-				problems.append("!!! Failed to read '%s': %s\n" % (file_to_write_to, e))
-			else:
+				if e.errno == errno.ENOENT:
+					file_contents = []
+				else:
+					problems.append("!!! Failed to read '%s': %s\n" % \
+						(file_to_write_to, e))
+			if file_contents is not None:
 				file_contents.extend(changes)
 				if protect_obj[root].isprotected(file_to_write_to):
 					file_to_write_to = new_protect_filename(file_to_write_to)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-17  7:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-17  7:10 UTC (permalink / raw
  To: gentoo-commits

commit:     da3cdf8a6ffd5cd69587291d75d19f1deb0e5976
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 07:10:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 17 07:10:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=da3cdf8a

--autounmask-write: use CONFIGROOT and EROOT

---
 pym/_emerge/depgraph.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9f3c1ac..a2b9534 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5714,7 +5714,9 @@ class depgraph(object):
 		problems = []
 		if write_to_file:
 			for root in roots:
-				abs_user_config = os.path.join(root, USER_CONFIG_PATH)
+				settings = self._frozen_config.roots[root].settings
+				abs_user_config = os.path.join(
+					settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
 
 				if root in unstable_keyword_msg:
 					file_to_write_to[(abs_user_config, "package.keywords")] = \
@@ -5739,7 +5741,10 @@ class depgraph(object):
 			write_to_file = not problems
 
 		for root in roots:
-			abs_user_config = os.path.join(root, USER_CONFIG_PATH)
+			settings = self._frozen_config.roots[root].settings
+			abs_user_config = os.path.join(
+				settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
+
 			if len(roots) > 1:
 				writemsg_stdout("\nFor %s:\n" % abs_user_config, noiselevel=-1)
 
@@ -5766,8 +5771,8 @@ class depgraph(object):
 		protect_obj = {}
 		if write_to_file:
 			for root in roots:
-				settings = self._frozen_config.pkgsettings[root]
-				protect_obj[root] = ConfigProtect(root, \
+				settings = self._frozen_config.roots[root].settings
+				protect_obj[root] = ConfigProtect(settings["EROOT"], \
 					shlex_split(settings.get("CONFIG_PROTECT", "")),
 					shlex_split(settings.get("CONFIG_PROTECT_MASK", "")))
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-17 19:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-17 19:44 UTC (permalink / raw
  To: gentoo-commits

commit:     8c1ef09c17168325e92483034767ef89c696e2d3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 19:43:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 17 19:43:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8c1ef09c

--autounmask-write: don't write hidden files

---
 pym/_emerge/depgraph.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a2b9534..609b4d5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -34,6 +34,7 @@ from portage.util import ConfigProtect, shlex_split, new_protect_filename
 from portage.util import cmp_sort_key, writemsg, writemsg_stdout
 from portage.util import writemsg_level, write_atomic
 from portage.util.digraph import digraph
+from portage.util.listdir import _ignorecvs_dirs
 from portage.versions import catpkgsplit
 
 from _emerge.AtomArg import AtomArg
@@ -5697,6 +5698,8 @@ class depgraph(object):
 					if stat.S_ISREG(st.st_mode):
 						last_file_path = p
 					elif stat.S_ISDIR(st.st_mode):
+						if os.path.basename(p) in _ignorecvs_dirs:
+							continue
 						try:
 							contents = os.listdir(p)
 						except OSError:
@@ -5704,6 +5707,9 @@ class depgraph(object):
 						else:
 							contents.sort(reverse=True)
 							for child in contents:
+								if child.startswith(".") or \
+									child.endswith("~"):
+									continue
 								stack.append(os.path.join(p, child))
 
 			return last_file_path



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-17 21:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-17 21:32 UTC (permalink / raw
  To: gentoo-commits

commit:     927966f77a5a9b94462e9a0c23be4e7b56207f58
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: Tue May 17 21:32:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=927966f7

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 cac1d55..36522ca 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -31,10 +31,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-18  0:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-18  0:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c746e1246f6977c78b00b068e824e2066e66f0f1
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: Wed May 18 00:54:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c746e124

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 609b4d5..9fb0cee 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5551,23 +5551,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-18  1:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-18  1:31 UTC (permalink / raw
  To: gentoo-commits

commit:     6186114119ca8b94a51504bfc551ebe4b5cf1098
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: Wed May 18 01:31:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=61861141

depgraph._resolve: use temp set for autounmask

---
 pym/_emerge/depgraph.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9fb0cee..4824a48 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2291,18 +2291,22 @@ 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_p_mask_changes) 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
 			self._dynamic_config._success_without_autounmask = True
 			return False, myfavorites
 
+		digraph_set = None
+
 		if self._rebuild.trigger_rebuilds():
 			backtrack_infos = self._dynamic_config._backtrack_infos
 			config = backtrack_infos.setdefault("config", {})



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-18  1:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-18  1:50 UTC (permalink / raw
  To: gentoo-commits

commit:     eead9bd14c71c6c0acca81b4cd2bf1bc2bf8644d
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: Wed May 18 01:49:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eead9bd1

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 4824a48..15a5df8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5567,7 +5567,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-18  2:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-18  2:16 UTC (permalink / raw
  To: gentoo-commits

commit:     7d103598c0c7bec5451146d75f419b156e39de2f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 18 02:15:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 18 02:15:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d103598

--autounmask-write: use CONFIGROOT more

---
 pym/_emerge/depgraph.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 15a5df8..e1557a1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5818,7 +5818,9 @@ class depgraph(object):
 
 		if write_to_file:
 			for root in roots:
-				abs_user_config = os.path.join(root, USER_CONFIG_PATH)
+				settings = self._frozen_config.roots[root].settings
+				abs_user_config = os.path.join(
+					settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
 
 				if root in unstable_keyword_msg:
 					write_changes(root, unstable_keyword_msg[root],



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-18  4:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-18  4:01 UTC (permalink / raw
  To: gentoo-commits

commit:     ae4bdcee45f060b28707fca15ad72e896708740a
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: Wed May 18 04:00:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ae4bdcee

_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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-18  4:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-18  4:37 UTC (permalink / raw
  To: gentoo-commits

commit:     5f65c2294df592a6a4e0f0fff0bedec49ed3491a
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: Wed May 18 04:37:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5f65c229

_pkg_visibility_check: if in graph then visible

---
 pym/_emerge/depgraph.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e1557a1..4789a0c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3324,6 +3324,15 @@ class depgraph(object):
 		if pkg.visible:
 			return 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
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-20  4:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-20  4:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8e0189a2af9e5e746070c9401be04381a91a3760
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: Fri May 20 04:52:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8e0189a2

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 |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 2dfcc85..12fa537 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -81,6 +81,15 @@ class Package(Task):
 			else:
 				self.operation = "merge"
 
+		# For installed (and binary) packages we don't care for the repo
+		# when it comes to hashing, because there can only be one cpv.
+		# So overwrite the repo_key with type_name.
+		repo_key = self.metadata.get('repository')
+		if self.type_name != 'ebuild':
+			repo_key = self.type_name
+		self._hash_key = \
+			(self.type_name, self.root, self.cpv, self.operation, repo_key)
+
 	def _validate_deps(self):
 		"""
 		Validate deps. This does not trigger USE calculation since that
@@ -266,7 +275,6 @@ class Package(Task):
 			self.cpv, self.metadata)
 		return pmask is not None
 
-
 	def _metadata_exception(self, k, e):
 
 		# For unicode safety with python-2.x we need to avoid
@@ -453,16 +461,6 @@ class Package(Task):
 			return missing_iuse
 
 	def _get_hash_key(self):
-		hash_key = getattr(self, "_hash_key", None)
-		if hash_key is None:
-			# For installed (and binary) packages we don't care for the repo
-			# when it comes to hashing, because there can only be one cpv.
-			# So overwrite the repo_key with type_name.
-			repo_key = self.metadata.get('repository')
-			if self.type_name != 'ebuild':
-				repo_key = self.type_name
-			self._hash_key = \
-				(self.type_name, self.root, self.cpv, self.operation, repo_key)
 		return self._hash_key
 
 	def __len__(self):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-20  6:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-20  6:24 UTC (permalink / raw
  To: gentoo-commits

commit:     d217a5112378a7eaf2b5d1fa04600b3da409bbee
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: Fri May 20 06:23:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d217a511

Task: remove unnecessary _get_hash_key() method

---
 pym/_emerge/Blocker.py |   11 ++---------
 pym/_emerge/Package.py |    5 +----
 pym/_emerge/Task.py    |   24 +++++++++---------------
 3 files changed, 12 insertions(+), 28 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 12fa537..067d628 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -460,9 +460,6 @@ class Package(Task):
 					missing_iuse.append(flag)
 			return missing_iuse
 
-	def _get_hash_key(self):
-		return self._hash_key
-
 	def __len__(self):
 		return 4
 
@@ -471,7 +468,7 @@ class Package(Task):
 		This is used to generate mtimedb resume mergelist entries, so we
 		limit it to 4 items for backward compatibility.
 		"""
-		return iter(self._get_hash_key()[:4])
+		return iter(self._hash_key[:4])
 
 	def __lt__(self, other):
 		if other.cp != self.cp:

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-20  6:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-20  6:32 UTC (permalink / raw
  To: gentoo-commits

commit:     bd479b8600af2b972969784f19fe124ff528b6f8
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: Fri May 20 06:31:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bd479b86

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 067d628..6847a32 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -89,6 +89,7 @@ class Package(Task):
 			repo_key = self.type_name
 		self._hash_key = \
 			(self.type_name, self.root, self.cpv, self.operation, repo_key)
+		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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-20 20:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-20 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     fc199d55f5c293c4cef43b4fdd6a560e97f272d8
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: Fri May 20 20:40:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc199d55

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-20 21:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-20 21:58 UTC (permalink / raw
  To: gentoo-commits

commit:     acddb2ec3ccb332b048eb1ebedba63d555fa46a0
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: Fri May 20 21:56:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=acddb2ec

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 215203a..809eda1 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-20 22:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-20 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     12d62375b3593805a483d3fac0e6b23e16694e8e
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: Fri May 20 22:01:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12d62375

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 809eda1..9bc2c2b 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-21  8:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-21  8:40 UTC (permalink / raw
  To: gentoo-commits

commit:     aefaa5910129b31ec33e2dc02654e79e0611c351
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: Sat May 21 08:40:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aefaa591

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-22  0:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-22  0:48 UTC (permalink / raw
  To: gentoo-commits

commit:     d4bf8dc02293cfc81c19f39b12b5e180a5e12645
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: Sun May 22 00:46:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d4bf8dc0

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 252a81e..3c2256a 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", "ignored")
+	__slots__ = ("satisfied", "optional", "ignored")
 
 	def __int__(self):
 		"""

diff --git a/pym/_emerge/DepPrioritySatisfiedRange.py b/pym/_emerge/DepPrioritySatisfiedRange.py
index 7fa2f09..edb29df 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):
@@ -85,7 +71,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 = (
@@ -94,7 +80,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 3ef47f8..d09ee87 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1036,18 +1036,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-22 18:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-22 18:54 UTC (permalink / raw
  To: gentoo-commits

commit:     d0a8b0bdfeeb406f459ee460f0df3b1b3360ddf1
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: Sun May 22 18:53:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d0a8b0bd

Package: add new _gen_hash_key method

---
 pym/_emerge/FakeVartree.py |    6 +++-
 pym/_emerge/Package.py     |   45 ++++++++++++++++++++++++++++++++++++++-----
 pym/_emerge/Scheduler.py   |   24 +++-------------------
 pym/_emerge/depgraph.py    |   22 +++++---------------
 4 files changed, 53 insertions(+), 44 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index ff092ad..3e81130 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -153,11 +153,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", "installed")
+			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 6847a32..cb476d6 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -81,15 +81,48 @@ class Package(Task):
 			else:
 				self.operation = "merge"
 
+		self._hash_key = Package._gen_hash_key(cpv=self.cpv,
+			installed=self.installed, onlydeps=self.onlydeps,
+			operation=self.operation, repo_name=repo,
+			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")
+
 		# For installed (and binary) packages we don't care for the repo
 		# when it comes to hashing, because there can only be one cpv.
 		# So overwrite the repo_key with type_name.
-		repo_key = self.metadata.get('repository')
-		if self.type_name != 'ebuild':
-			repo_key = self.type_name
-		self._hash_key = \
-			(self.type_name, self.root, self.cpv, self.operation, repo_key)
-		self._hash_value = hash(self._hash_key)
+		if type_name is None:
+			raise TypeError("type_name argument is required")
+		elif type_name == "ebuild":
+			if repo_name is None:
+				raise AssertionError(
+					"Package._gen_hash_key() " + \
+					"called without 'repo_name' argument")
+			repo_key = repo_name
+		else:
+			# For installed (and binary) packages we don't care for the repo
+			# when it comes to hashing, because there can only be one cpv.
+			# So overwrite the repo_key with type_name.
+			repo_key = type_name
+
+		return (type_name, root, cpv, operation, repo_key)
 
 	def _validate_deps(self):
 		"""

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 74d888a..b10439a 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -2016,27 +2016,11 @@ class Scheduler(PollScheduler):
 		corrupt).
 		"""
 
-		if type_name != "ebuild":
-			# For installed (and binary) packages we don't care for the repo
-			# when it comes to hashing, because there can only be one cpv.
-			# So overwrite the repo_key with type_name.
-			repo_key = type_name
-			myrepo = None
-		elif myrepo is None:
-			raise AssertionError(
-				"Scheduler._pkg() called without 'myrepo' argument")
-		else:
-			repo_key = myrepo
-
-		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, repo_key))
+		pkg = self._pkg_cache.get(Package._gen_hash_key(cpv=cpv,
+			type_name=type_name, repo_name=myrepo, 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 d09ee87..0bd3512 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4130,30 +4130,20 @@ class depgraph(object):
 		failures for some reason (package does not exist or is
 		corrupt).
 		"""
-		if type_name != "ebuild":
-			# For installed (and binary) packages we don't care for the repo
-			# when it comes to hashing, because there can only be one cpv.
-			# So overwrite the repo_key with type_name.
-			repo_key = type_name
-			myrepo = None
-		elif myrepo is None:
-			raise AssertionError(
-				"depgraph._pkg() called without 'myrepo' argument")
-		else:
-			repo_key = myrepo
 
-		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, repo_key))
+			Package._gen_hash_key(cpv=cpv, type_name=type_name,
+			repo_name=myrepo, 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', repo_key))
+				Package._gen_hash_key(cpv=cpv, type_name=type_name,
+				repo_name=myrepo, 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-22 21:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-22 21:22 UTC (permalink / raw
  To: gentoo-commits

commit:     dd444ef33752aa268a78f425211e74fa2f2706c9
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: Sun May 22 21:20:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd444ef3

_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 0bd3512..caf150a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4175,7 +4175,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:
@@ -4186,9 +4187,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-23 21:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-23 21:21 UTC (permalink / raw
  To: gentoo-commits

commit:     342d33e12301708623454743da3aa0455f890c89
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: Mon May 23 21:21:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=342d33e1

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-23 22:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-23 22:12 UTC (permalink / raw
  To: gentoo-commits

commit:     716f374e32a8a1f7e12b851dc0c0a91eaaa46a13
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: Mon May 23 22:12:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=716f374e

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-24  5:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-24  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     e5e2368544098b999ae60412c70f96dab3ad9d4c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 24 05:54:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 24 05:54:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e5e23685

PackageUninstall: log more output

---
 pym/_emerge/PackageUninstall.py |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index 0829f50..41409ba 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -43,11 +43,21 @@ class PackageUninstall(CompositeTask):
 			# and pkg_postrm phases from executing.
 			pass
 
+		self._builddir_lock = EbuildBuildDir(
+			scheduler=self.scheduler, settings=self.settings)
+		self._builddir_lock.lock()
+
+		portage.prepare_build_dirs(
+			settings=self.settings, cleanup=True)
+
+		# Output only gets logged if it comes after prepare_build_dirs()
+		# which initializes PORTAGE_LOG_FILE.
 		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._builddir_lock.unlock()
 			self.returncode = retval
 			self.wait()
 			return
@@ -57,14 +67,6 @@ class PackageUninstall(CompositeTask):
 		self._emergelog("=== Unmerging... (%s)" % (self.pkg.cpv,))
 
 		cat, pf = portage.catsplit(self.pkg.cpv)
-
-		self._builddir_lock = EbuildBuildDir(
-			scheduler=self.scheduler, settings=self.settings)
-		self._builddir_lock.lock()
-
-		portage.prepare_build_dirs(
-			settings=self.settings, cleanup=True)
-
 		unmerge_task = MergeProcess(
 			mycat=cat, mypkg=pf, settings=self.settings,
 			treetype="vartree", vartree=self.pkg.root_config.trees["vartree"],
@@ -97,4 +99,5 @@ class PackageUninstall(CompositeTask):
 				portage.util.writemsg_level(msg,
 					level=level, noiselevel=noiselevel)
 		else:
-			self.scheduler.output(msg, level=level, noiselevel=noiselevel)
+			self.scheduler.output(msg, log_path=log_path,
+				level=level, noiselevel=noiselevel)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  0:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  0:30 UTC (permalink / raw
  To: gentoo-commits

commit:     53daf8dec6740d6c04e4dd76dd36d1cc19093c27
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 00:29:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 25 00:29:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=53daf8de

PackageUninstall: remove extra cat/pf var init

Also, add to comments about ebuild-locks.

---
 pym/_emerge/PackageUninstall.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index 41409ba..aebf55e 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -18,7 +18,8 @@ class PackageUninstall(CompositeTask):
 	it is essential for the ebuild-locks code to execute in a
 	subprocess, since the portage.locks module does not behave
 	as desired if we try to lock the same file multiple times
-	concurrently from the same process.
+	concurrently from the same process for ebuild-locks phases
+	such as pkg_setup, pkg_prerm, and pkg_postrm.
 	"""
 
 	__slots__ = ("world_atom", "ldpath_mtimes", "opts",
@@ -66,7 +67,6 @@ class PackageUninstall(CompositeTask):
 			noiselevel=-1)
 		self._emergelog("=== Unmerging... (%s)" % (self.pkg.cpv,))
 
-		cat, pf = portage.catsplit(self.pkg.cpv)
 		unmerge_task = MergeProcess(
 			mycat=cat, mypkg=pf, settings=self.settings,
 			treetype="vartree", vartree=self.pkg.root_config.trees["vartree"],



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  0:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  0:45 UTC (permalink / raw
  To: gentoo-commits

commit:     fe1022a42fcbfd28c8eab09fe029462a68a62846
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: Wed May 25 00:45:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe1022a4

PackageUninstall: return early if pkg is missing

---
 pym/_emerge/PackageUninstall.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index aebf55e..eb6a947 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -27,9 +27,16 @@ class PackageUninstall(CompositeTask):
 
 	def _start(self):
 
-		self.settings.setcpv(self.pkg)
 		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)
 		cat, pf = portage.catsplit(self.pkg.cpv)
 		myebuildpath = os.path.join(dbdir, pf + ".ebuild")
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  2:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  2:53 UTC (permalink / raw
  To: gentoo-commits

commit:     20498936b79906dfcb31a84cfd9e97ee20c94147
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: Wed May 25 02:52:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=20498936

depgraph: detect deps broken by autounmask

This will fix bug #368429.

---
 pym/_emerge/depgraph.py |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3463925..fec2377 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2740,15 +2740,18 @@ 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,),
 			allow_repo=True)
+		atom_set_with_use = InternalPackageSet(initial_atoms=(atom,),
+			allow_repo=True)
 		xinfo = '"%s"' % atom.unevaluated_atom
 		if arg:
 			xinfo='"%s"' % arg
@@ -2823,6 +2826,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 " + \
@@ -2855,6 +2860,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:
@@ -6342,6 +6353,13 @@ 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
@@ -6349,6 +6367,15 @@ class depgraph(object):
 	def success_without_autounmask(self):
 		return self._dynamic_config._success_without_autounmask
 
+	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_infos(self):
 		return self._dynamic_config._backtrack_infos
 			
@@ -6640,6 +6667,15 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 			allow_backtracking=False,
 			backtrack_parameters=backtracker.get_best_run())
 		success, favorites = mydepgraph.select_files(myfiles)
+		if not success and mydepgraph.autounmask_breakage_detected():
+			if "--debug" in myopts:
+				writemsg_level(
+					"\n\nautounmask breakage detectedn\n",
+					noiselevel=-1, level=logging.DEBUG)
+			myopts["--autounmask"] = "n"
+			mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
+				frozen_config=frozen_config, allow_backtracking=False)
+			success, favorites = mydepgraph.select_files(myfiles)
 
 	return (success, mydepgraph, favorites)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  3:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  3:11 UTC (permalink / raw
  To: gentoo-commits

commit:     b883f09d47cf107224946c49bdb57aeb1d76ad92
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 03:10:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 25 03:10:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b883f09d

Fix a typo in last commit's debug message.

---
 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 fec2377..341b3a6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6670,7 +6670,7 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 		if not success and mydepgraph.autounmask_breakage_detected():
 			if "--debug" in myopts:
 				writemsg_level(
-					"\n\nautounmask breakage detectedn\n",
+					"\n\nautounmask breakage detected\n\n",
 					noiselevel=-1, level=logging.DEBUG)
 			myopts["--autounmask"] = "n"
 			mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  3:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  3:58 UTC (permalink / raw
  To: gentoo-commits

commit:     faa536f437c445c3d2eb06c791b1492101474cc9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 03:57:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 25 03:57:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=faa536f4

FakeVartree: preserve EAPI of installed package

If the corresponding unbuilt ebuild has a different EAPI than the
installed instance, then we want to preserve the EAPI meatadata from
the installed instance.

---
 pym/_emerge/FakeVartree.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 3e81130..51683ca 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -92,7 +92,8 @@ class FakeVartree(vartree):
 			repo = _gen_valid_repo(repo)
 			live_metadata = dict(zip(self._portdb_keys,
 				self._portdb.aux_get(pkg, self._portdb_keys, myrepo=repo)))
-			if not portage.eapi_is_supported(live_metadata["EAPI"]):
+			if not portage.eapi_is_supported(live_metadata["EAPI"]) or \
+				self._aux_get(pkg, ["EAPI"])[0] != live_metadata["EAPI"]:
 				raise KeyError(pkg)
 			self.dbapi.aux_update(pkg, live_metadata)
 		except (KeyError, portage.exception.PortageException):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  6:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  6:26 UTC (permalink / raw
  To: gentoo-commits

commit:     88ab3aed122734578dc4939403c9393d8afbf6ae
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 06:25:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 25 06:25:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88ab3aed

FakeVartree: tweak _aux_get_wrapper EAPI handling

---
 pym/_emerge/FakeVartree.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 51683ca..abdbf73 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -86,6 +86,9 @@ 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, = self._aux_get(pkg, ["EAPI"])
 		try:
 			# Use the live ebuild metadata if possible.
 			repo = self._aux_get(pkg, ["repository"])[0]
@@ -93,7 +96,7 @@ class FakeVartree(vartree):
 			live_metadata = dict(zip(self._portdb_keys,
 				self._portdb.aux_get(pkg, self._portdb_keys, myrepo=repo)))
 			if not portage.eapi_is_supported(live_metadata["EAPI"]) or \
-				self._aux_get(pkg, ["EAPI"])[0] != live_metadata["EAPI"]:
+				installed_eapi != live_metadata["EAPI"]:
 				raise KeyError(pkg)
 			self.dbapi.aux_update(pkg, live_metadata)
 		except (KeyError, portage.exception.PortageException):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-25  6:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-25  6:33 UTC (permalink / raw
  To: gentoo-commits

commit:     4b6b6dbed2ef61dfdb1cb5420e15c2de4561a992
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 06:33:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 25 06:33:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b6b6dbe

FakeVartree: tweak _aux_get_wrapper repo handling

---
 pym/_emerge/FakeVartree.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index abdbf73..8ed458d 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -88,10 +88,9 @@ class FakeVartree(vartree):
 		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, = self._aux_get(pkg, ["EAPI"])
+		installed_eapi, repo = self._aux_get(pkg, ["EAPI", "repository"])
 		try:
 			# Use the live ebuild metadata if possible.
-			repo = self._aux_get(pkg, ["repository"])[0]
 			repo = _gen_valid_repo(repo)
 			live_metadata = dict(zip(self._portdb_keys,
 				self._portdb.aux_get(pkg, self._portdb_keys, myrepo=repo)))



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26  0:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26  0:31 UTC (permalink / raw
  To: gentoo-commits

commit:     84c3c39ce28b8211b3d1ad2eeb1f5813aff857e8
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 00:30:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84c3c39c

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 341b3a6..d7ddd1a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3902,11 +3902,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
@@ -3922,7 +3926,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26  1:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26  1:08 UTC (permalink / raw
  To: gentoo-commits

commit:     d810f9a0b160a91fae059a5c32c1b673fe7be3be
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 01:04:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d810f9a0

FakeVartree: use live meta if installed EAPI ok

This will fix bug #368725.

---
 pym/_emerge/FakeVartree.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 8ed458d..a11966f 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -94,8 +94,16 @@ class FakeVartree(vartree):
 			repo = _gen_valid_repo(repo)
 			live_metadata = dict(zip(self._portdb_keys,
 				self._portdb.aux_get(pkg, self._portdb_keys, myrepo=repo)))
-			if not portage.eapi_is_supported(live_metadata["EAPI"]) or \
-				installed_eapi != 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26  6:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26  6:41 UTC (permalink / raw
  To: gentoo-commits

commit:     aa8ff193675224cd110c3c489e561e8e8e30eab3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 06:40:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 06:40:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aa8ff193

depgraph: always check for autounmask breakage

The 2.1.9 branch already does the same thing since commit
65736474c0d70cb10ff1290b3787b61d8a502aed.

---
 pym/_emerge/depgraph.py |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d7ddd1a..3dc68ff 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6673,15 +6673,16 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 			allow_backtracking=False,
 			backtrack_parameters=backtracker.get_best_run())
 		success, favorites = mydepgraph.select_files(myfiles)
-		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=False)
-			success, favorites = mydepgraph.select_files(myfiles)
+
+	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=False)
+		success, favorites = mydepgraph.select_files(myfiles)
 
 	return (success, mydepgraph, favorites)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26 12:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26 12:22 UTC (permalink / raw
  To: gentoo-commits

commit:     04889ffd43dcaed047811ba4800a2e600b0a775a
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:22:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04889ffd

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 dc0f913..4819749 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26 12:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26 12:22 UTC (permalink / raw
  To: gentoo-commits

commit:     5740eae9309347914a23acab9d918d308a4a6b8f
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:00:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5740eae9

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 0021f23..dc0f913 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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26 13:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26 13:02 UTC (permalink / raw
  To: gentoo-commits

commit:     f543057498211db7b40335a65dd13d179bf86149
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:02:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f5430574

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-26 22:15 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-26 22:15 UTC (permalink / raw
  To: gentoo-commits

commit:     e0c79d23399998114284e9f6245e812b8df57474
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:14:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e0c79d23

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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-27  0:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-27  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     38082c206a5fcdbd01bf01cb181ece0c5a19cf3b
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:38:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=38082c20

_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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-27  1:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-27  1:23 UTC (permalink / raw
  To: gentoo-commits

commit:     0105b96356fc9af05af33e9ef4b2d0a662501cec
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:26:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0105b963

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 3dc68ff..8ad0547 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2825,9 +2825,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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-27  3:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-27  3:29 UTC (permalink / raw
  To: gentoo-commits

commit:     49a246a11edff3fdcaebe756ac3432b35b613ec6
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:28:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=49a246a1

_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] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-27 22:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-27 22:56 UTC (permalink / raw
  To: gentoo-commits

commit:     d8c868bbf2f2ffc1b2890e7c4d57f03621ac9007
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 22:53:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 27 22:53:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d8c868bb

depclean: warn for each unmatched argument

This output is similar to that produced by unmerge().

---
 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 9bc2c2b..f6b6928 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -563,7 +563,10 @@ def action_depclean(settings, trees, ldpath_mtimes,
 		for x in args_set:
 			if vardb.match(x):
 				matched_packages = True
-				break
+			else:
+				writemsg_level("--- Couldn't find '%s' to %s.\n" % \
+					(x.replace("null/", ""), action),
+					level=logging.WARN, noiselevel=-1)
 		if not matched_packages:
 			writemsg_level(">>> No packages selected for removal by %s\n" % \
 				action)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-05-27 23:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-05-27 23:17 UTC (permalink / raw
  To: gentoo-commits

commit:     445f1ae80fa64950f1058a62fd4aab1becc80709
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 23:17:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 27 23:17:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=445f1ae8

backtrack_depgraph: display_problems for each run

---
 pym/_emerge/depgraph.py |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8ad0547..de75eb1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6631,6 +6631,8 @@ def backtrack_depgraph(settings, trees, myopts, myparams,
 
 def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, spinner):
 
+	debug = "--debug" in myopts
+	mydepgraph = None
 	max_retries = myopts.get('--backtrack', 10)
 	max_depth = max(1, (max_retries + 1) / 2)
 	allow_backtracking = max_retries > 0
@@ -6641,6 +6643,13 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 		myopts, spinner)
 
 	while backtracker:
+
+		if debug and mydepgraph is not None:
+			writemsg_level(
+				"\n\nbacktracking try %s \n\n" % \
+				backtracked, noiselevel=-1, level=logging.DEBUG)
+			mydepgraph.display_problems()
+
 		backtrack_parameters = backtracker.get()
 
 		mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
@@ -6663,10 +6672,11 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 
 	if not (success or mydepgraph.success_without_autounmask()) and backtracked:
 
-		if "--debug" in myopts:
+		if debug:
 			writemsg_level(
 				"\n\nbacktracking aborted after %s tries\n\n" % \
 				backtracked, noiselevel=-1, level=logging.DEBUG)
+			mydepgraph.display_problems()
 
 		mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
 			frozen_config=frozen_config,
@@ -6675,10 +6685,11 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp
 		success, favorites = mydepgraph.select_files(myfiles)
 
 	if not success and mydepgraph.autounmask_breakage_detected():
-		if "--debug" in myopts:
+		if debug:
 			writemsg_level(
 				"\n\nautounmask breakage detected\n\n",
 				noiselevel=-1, level=logging.DEBUG)
+			mydepgraph.display_problems()
 		myopts["--autounmask"] = "n"
 		mydepgraph = depgraph(settings, trees, myopts, myparams, spinner,
 			frozen_config=frozen_config, allow_backtracking=False)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-03  3:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-03  3:31 UTC (permalink / raw
  To: gentoo-commits

commit:     bbe046fb2a74929db656b313234db3e691f3dc74
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  3 03:31:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 03:31:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbe046fb

add_pkg_dep_string: remove unused root_slot var

---
 pym/_emerge/depgraph.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 98cc88d..5314b5e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1488,7 +1488,6 @@ class depgraph(object):
 
 			mypriority = dep_priority.copy()
 			if not atom.blocker:
-				root_slot = (pkg.root, pkg.slot_atom)
 				inst_pkgs = [inst_pkg for inst_pkg in vardb.match_pkgs(atom)
 					if not reinstall_atoms.findAtomForPackage(inst_pkg,
 							modified_use=self._pkg_use_enabled(inst_pkg))]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-03  3:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-03  3:52 UTC (permalink / raw
  To: gentoo-commits

commit:     336f02148b0a90e1933d7ca68a32f3bd5e9433d6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  3 03:47:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 03:47:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=336f0214

add_pkg_dep_string: fix reversed inst_pkgs order

This code was intended to iterate over packages in descending order,
but match_pkgs() returns them in ascending order, so we need to
reverse it.

---
 pym/_emerge/depgraph.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5314b5e..b71d364 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1488,7 +1488,8 @@ class depgraph(object):
 
 			mypriority = dep_priority.copy()
 			if not atom.blocker:
-				inst_pkgs = [inst_pkg for inst_pkg in vardb.match_pkgs(atom)
+				inst_pkgs = [inst_pkg for inst_pkg in
+					reversed(vardb.match_pkgs(atom))
 					if not reinstall_atoms.findAtomForPackage(inst_pkg,
 							modified_use=self._pkg_use_enabled(inst_pkg))]
 				if inst_pkgs:
@@ -1574,7 +1575,8 @@ class depgraph(object):
 			if not dep_priority.ignored or \
 				self._dynamic_config._traverse_ignored_deps:
 
-				inst_pkgs = [inst_pkg for inst_pkg in vardb.match_pkgs(virt_dep.atom)
+				inst_pkgs = [inst_pkg for inst_pkg in
+					reversed(vardb.match_pkgs(virt_dep.atom))
 					if not reinstall_atoms.findAtomForPackage(inst_pkg,
 							modified_use=self._pkg_use_enabled(inst_pkg))]
 				if inst_pkgs:
@@ -1603,7 +1605,8 @@ class depgraph(object):
 				# This is a GLEP 37 virtual, so its deps are all runtime.
 				mypriority = self._priority(runtime=True)
 				if not atom.blocker:
-					inst_pkgs = [inst_pkg for inst_pkg in vardb.match_pkgs(atom)
+					inst_pkgs = [inst_pkg for inst_pkg in
+						reversed(vardb.match_pkgs(atom))
 						if not reinstall_atoms.findAtomForPackage(inst_pkg,
 								modified_use=self._pkg_use_enabled(inst_pkg))]
 					if inst_pkgs:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-03 22:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-03 22:38 UTC (permalink / raw
  To: gentoo-commits

commit:     d21811eec723ffc6acb1daf0e2d7b19bf3af6978
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  3 22:27:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 22:27:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d21811ee

--autounmask: show note suggesting how to disable

Now that --autounmask is enabled by default, people are dealing with
local masks that trigger unsatisfied dependencies often complain about
--autounmask behavior being inappropriate for their situation.
Therefore, show a helpful note when the autounmask code is triggered
and --quiet is not enabled:

  NOTE: This --autounmask behavior can be disabled by setting
        EMERGE_DEFAULT_OPTS="--autounmask=n" in make.conf.

---
 pym/_emerge/depgraph.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b60fd19..0b4be4f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5587,6 +5587,7 @@ class depgraph(object):
 		"""
 
 		autounmask_write = self._frozen_config.myopts.get("--autounmask-write", "n") == True
+		quiet = "--quiet" in self._frozen_config.myopts
 		pretend = "--pretend" in self._frozen_config.myopts
 		ask = "--ask" in self._frozen_config.myopts
 		enter_invalid = '--ask-enter-invalid' in self._frozen_config.myopts
@@ -5857,6 +5858,21 @@ class depgraph(object):
 				except PortageException:
 					problems.append("!!! Failed to write '%s'\n" % file_to_write_to)
 
+		if not quiet and \
+			(unstable_keyword_msg or \
+			p_mask_change_msg or \
+			use_changes_msg or \
+			license_msg):
+			msg = [
+				"",
+				"NOTE: This --autounmask behavior can be disabled by setting",
+				"      EMERGE_DEFAULT_OPTS=\"--autounmask=n\" in make.conf."
+			]
+			for line in msg:
+				if line:
+					line = colorize("INFORM", line)
+				writemsg_stdout(line + "\n", noiselevel=-1)
+
 		if ask and write_to_file and file_to_write_to:
 			prompt = "\nWould you like to add these " + \
 				"changes to your config files?"



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-03 23:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-03 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     7425033c9da717ef2c48e7435bcce248531f9df6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  3 23:03:40 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 23:03:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7425033c

--ask: prompt for --pretend mode when necessary

---
 pym/_emerge/main.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 11d8ca1..ea3282a 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -45,6 +45,7 @@ from _emerge.emergelog import emergelog
 from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
 from _emerge.is_valid_package_atom import is_valid_package_atom
 from _emerge.stdout_spinner import stdout_spinner
+from _emerge.userquery import userquery
 
 if sys.hexversion >= 0x3000000:
 	long = int
@@ -1729,10 +1730,13 @@ def emerge_main(args=None):
 				# access is required but the user is not in the portage group.
 				from portage.data import portage_group_warning
 				if "--ask" in myopts:
+					writemsg_stdout("This action requires %s access...\n" % \
+						(access_desc,), noiselevel=-1)
+					if userquery("Would you like to add --pretend to options?",
+						"--ask-enter-invalid" in myopts) == "No":
+						return 1
 					myopts["--pretend"] = True
 					del myopts["--ask"]
-					print(("%s access is required... " + \
-						"adding --pretend to options\n") % access_desc)
 					if portage.secpass < 1 and not need_superuser:
 						portage_group_warning()
 				else:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-04  2:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-04  2:13 UTC (permalink / raw
  To: gentoo-commits

commit:     93db38b4bddc4e2775f9d2f8222137c5778b934b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 02:11:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 02:11:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=93db38b4

emergelog: only enable when called by emerge

We disable emergelog by default, since it's called from dblink.merge()
and we don't want that to trigger log writes unless it's really called
via emerge.

---
 pym/_emerge/emergelog.py |    5 ++++-
 pym/_emerge/main.py      |   16 +++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index f30356e..87e46e2 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -13,8 +13,11 @@ from portage import _unicode_encode
 from portage.data import secpass
 from portage.output import xtermTitle
 
+# emergelog is disabled by default, since it's called from
+# dblink.merge() we don't want that to trigger log writes
+# unless it's really called via emerge.
+_disable = True
 _emerge_log_dir = '/var/log'
-_disable = False
 
 def emergelog(xterm_titles, mystr, short_msg=None):
 

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index ea3282a..7b9ab61 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1746,6 +1746,9 @@ def emerge_main(args=None):
 						portage_group_warning()
 					return 1
 
+	# Disable emergelog for everything except build or unmerge operations.
+	# This helps minimize parallel emerge.log entries that can confuse log
+	# parsers like genlop.
 	disable_emergelog = False
 	for x in ("--pretend", "--fetchonly", "--fetch-all-uri"):
 		if x in myopts:
@@ -1753,14 +1756,10 @@ def emerge_main(args=None):
 			break
 	if myaction in ("search", "info"):
 		disable_emergelog = True
-	if disable_emergelog:
-		""" Disable emergelog for everything except build or unmerge
-		operations.  This helps minimize parallel emerge.log entries that can
-		confuse log parsers.  We especially want it disabled during
-		parallel-fetch, which uses --resume --fetchonly."""
-		_emerge.emergelog._disable = True
 
-	else:
+	_emerge.emergelog._disable = disable_emergelog
+
+	if not disable_emergelog:
 		if 'EMERGE_LOG_DIR' in settings:
 			try:
 				# At least the parent needs to exist for the lock file.
@@ -1771,8 +1770,7 @@ def emerge_main(args=None):
 					(settings['EMERGE_LOG_DIR'], e),
 					noiselevel=-1, level=logging.ERROR)
 			else:
-				global _emerge_log_dir
-				_emerge_log_dir = settings['EMERGE_LOG_DIR']
+				_emerge.emergelog._emerge_log_dir = settings["EMERGE_LOG_DIR"]
 
 	if not "--pretend" in myopts:
 		emergelog(xterm_titles, "Started emerge on: "+\



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-04  2:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-04  2:31 UTC (permalink / raw
  To: gentoo-commits

commit:     79df84ecdc66097a8ac18e42f97f615d5f8ed2d0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 02:31:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 02:31:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=79df84ec

emergelog: tweak _disabled comment

---
 pym/_emerge/emergelog.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index 87e46e2..9cac3b2 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -13,8 +13,8 @@ from portage import _unicode_encode
 from portage.data import secpass
 from portage.output import xtermTitle
 
-# emergelog is disabled by default, since it's called from
-# dblink.merge() we don't want that to trigger log writes
+# We disable emergelog by default, since it's called from
+# dblink.merge() and we don't want that to trigger log writes
 # unless it's really called via emerge.
 _disable = True
 _emerge_log_dir = '/var/log'



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-04  2:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-04  2:38 UTC (permalink / raw
  To: gentoo-commits

commit:     61ee292b5976be4a7f0495cc1a5f4df75357bd03
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 02:37:45 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 02:37:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=61ee292b

autounmask: include comments from package.mask

This will fix bug #369985.

---
 pym/_emerge/depgraph.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 0b4be4f..64fe9c9 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5662,7 +5662,20 @@ class depgraph(object):
 						reason.unmask_hint.key == 'p_mask':
 						keyword = reason.unmask_hint.value
 
+						comment, filename = portage.getmaskingreason(
+							pkg.cpv, metadata=pkg.metadata,
+							settings=pkgsettings,
+							portdb=pkg.root_config.trees["porttree"].dbapi,
+							return_location=True)
+
 						p_mask_change_msg[root].append(self._get_dep_chain_as_comment(pkg))
+						if filename:
+							p_mask_change_msg[root].append("# %s:\n" % filename)
+						if comment:
+							comment = [line for line in
+								comment.splitlines() if line]
+							for line in comment:
+								p_mask_change_msg[root].append("%s\n" % line)
 						if is_latest:
 							p_mask_change_msg[root].append(">=%s\n" % pkg.cpv)
 						elif is_latest_in_slot:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-04  3:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-04  3:49 UTC (permalink / raw
  To: gentoo-commits

commit:     d8c6671a94107067b6a288e9209c0536817c7687
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 03:48:55 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 03:48:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d8c6671a

Binpkg: cleanup PORTAGE_BINPKG_FILE code

---
 pym/_emerge/Binpkg.py |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 1ed5c1f..84eda21 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -114,6 +114,9 @@ class Binpkg(CompositeTask):
 			pretend=self.opts.pretend, scheduler=self.scheduler)
 		pkg_path = fetcher.pkg_path
 		self._pkg_path = pkg_path
+		# This gives bashrc users an opportunity to do various things
+		# such as remove binary packages after they're installed.
+		self.settings["PORTAGE_BINPKG_FILE"] = pkg_path
 
 		if self.opts.getbinpkg and self._bintree.isremote(pkg.cpv):
 
@@ -264,16 +267,9 @@ class Binpkg(CompositeTask):
 			self.wait()
 			return
 
-		# This gives bashrc users an opportunity to do various things
-		# such as remove binary packages after they're installed.
-		settings = self.settings
-		settings.setcpv(self.pkg)
-		settings["PORTAGE_BINPKG_FILE"] = self._pkg_path
-		settings.backup_changes("PORTAGE_BINPKG_FILE")
-
 		setup_phase = EbuildPhase(background=self.background,
 			phase="setup", scheduler=self.scheduler,
-			settings=settings)
+			settings=self.settings)
 
 		setup_phase.addExitListener(self._setup_exit)
 		self._task_queued(setup_phase)
@@ -308,18 +304,12 @@ class Binpkg(CompositeTask):
 		self._build_dir.unlock()
 
 	def create_install_task(self):
-
-		# This gives bashrc users an opportunity to do various things
-		# such as remove binary packages after they're installed.
-		settings = self.settings
-		settings["PORTAGE_BINPKG_FILE"] = self._pkg_path
-		settings.backup_changes("PORTAGE_BINPKG_FILE")
-
 		task = EbuildMerge(find_blockers=self.find_blockers,
 			ldpath_mtimes=self.ldpath_mtimes, logger=self.logger,
 			pkg=self.pkg, pkg_count=self.pkg_count,
 			pkg_path=self._pkg_path, scheduler=self.scheduler,
-			settings=settings, tree=self._tree, world_atom=self.world_atom)
+			settings=self.settings, tree=self._tree,
+			world_atom=self.world_atom)
 		task.addExitListener(self._install_exit)
 		return task
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-04 23:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-04 23:32 UTC (permalink / raw
  To: gentoo-commits

commit:     881f72488477cc57c4702cf699446c5dd1163a79
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 13:18:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 13:18:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=881f7248

--ask: show group warning before pretend prompt

---
 pym/_emerge/main.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 7b9ab61..21dea40 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1732,13 +1732,13 @@ def emerge_main(args=None):
 				if "--ask" in myopts:
 					writemsg_stdout("This action requires %s access...\n" % \
 						(access_desc,), noiselevel=-1)
+					if portage.secpass < 1 and not need_superuser:
+						portage_group_warning()
 					if userquery("Would you like to add --pretend to options?",
 						"--ask-enter-invalid" in myopts) == "No":
 						return 1
 					myopts["--pretend"] = True
 					del myopts["--ask"]
-					if portage.secpass < 1 and not need_superuser:
-						portage_group_warning()
 				else:
 					sys.stderr.write(("emerge: %s access is required\n") \
 						% access_desc)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-05 15:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-05 15:12 UTC (permalink / raw
  To: gentoo-commits

commit:     ee7bd00a6febac09bd97276e29bf7d1513ad2d84
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  5 15:12:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun  5 15:12:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ee7bd00a

MergeListItem: fix "unknown repo" display

The Package class uses an UNKNOWN_REPO constant so that MergeListItem
can distinguish this case.

---
 pym/_emerge/MergeListItem.py |    2 +-
 pym/_emerge/Package.py       |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index 7de48f9..2176bf6 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -64,7 +64,7 @@ class MergeListItem(CompositeTask):
 		if portdir_repo_name:
 			pkg_repo_name = pkg.repo
 			if pkg_repo_name != portdir_repo_name:
-				if not pkg_repo_name:
+				if pkg_repo_name == pkg.UNKNOWN_REPO:
 					pkg_repo_name = "unknown repo"
 				msg += " from %s" % pkg_repo_name
 

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index cb476d6..593e0d3 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -38,6 +38,7 @@ class Package(Task):
 
 	_dep_keys = ('DEPEND', 'PDEPEND', 'RDEPEND',)
 	_use_conditional_misc_keys = ('LICENSE', 'PROPERTIES', 'RESTRICT')
+	UNKNOWN_REPO = "__unknown__"
 
 	def __init__(self, **kwargs):
 		Task.__init__(self, **kwargs)
@@ -69,7 +70,7 @@ class Package(Task):
 			self.inherited = frozenset()
 		repo = _gen_valid_repo(self.metadata.get('repository', ''))
 		if not repo:
-			repo = '__unknown__'
+			repo = self.UNKNOWN_REPO
 		self.metadata['repository'] = repo
 
 		self._validate_deps()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-05 16:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-05 16:34 UTC (permalink / raw
  To: gentoo-commits

commit:     f584253e0d67417108641361354c619970a724c5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  5 16:31:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun  5 16:31:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f584253e

create_world_atom: fix slot/repo atom logic

---
 pym/_emerge/create_world_atom.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/create_world_atom.py b/pym/_emerge/create_world_atom.py
index d0141f7..fa7cffc 100644
--- a/pym/_emerge/create_world_atom.py
+++ b/pym/_emerge/create_world_atom.py
@@ -31,7 +31,7 @@ def create_world_atom(pkg, args_set, root_config):
 			for cpv in vardb.match(cp))
 		slotted = len(available_slots) > 1 or \
 			(len(available_slots) == 1 and "0" not in available_slots)
-	if slotted and arg_atom != cp:
+	if slotted and arg_atom.without_repo != cp:
 		# If the user gave a specific atom, store it as a
 		# slot atom in the world file.
 		slot_atom = pkg.slot_atom



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-06  2:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-06  2:24 UTC (permalink / raw
  To: gentoo-commits

commit:     e717c4429dc00950a8e5840ecce8b4b6fce2d059
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  6 02:24:29 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun  6 02:24:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e717c442

Scheduler: init _fetch_log in constructor

This ensures that we account for EMERGE_LOG_DIR.

---
 pym/_emerge/Scheduler.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index bdc13aa..c3752c5 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -34,6 +34,7 @@ from portage.package.ebuild.digestcheck import digestcheck
 from portage.package.ebuild.digestgen import digestgen
 from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
 
+import _emerge
 from _emerge.BinpkgFetcher import BinpkgFetcher
 from _emerge.BinpkgPrefetcher import BinpkgPrefetcher
 from _emerge.BinpkgVerifier import BinpkgVerifier
@@ -46,7 +47,7 @@ from _emerge.DepPriority import DepPriority
 from _emerge.depgraph import depgraph, resume_depgraph
 from _emerge.EbuildFetcher import EbuildFetcher
 from _emerge.EbuildPhase import EbuildPhase
-from _emerge.emergelog import emergelog, _emerge_log_dir
+from _emerge.emergelog import emergelog
 from _emerge.FakeVartree import FakeVartree
 from _emerge._find_deep_system_runtime_deps import _find_deep_system_runtime_deps
 from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
@@ -83,8 +84,6 @@ class Scheduler(PollScheduler):
 	_bad_resume_opts = set(["--ask", "--changelog",
 		"--resume", "--skipfirst"])
 
-	_fetch_log = os.path.join(_emerge_log_dir, 'emerge-fetch.log')
-
 	class _iface_class(SlotObject):
 		__slots__ = ("fetch",
 			"output", "register", "schedule",
@@ -216,6 +215,8 @@ class Scheduler(PollScheduler):
 		for root in self.trees:
 			self._config_pool[root] = []
 
+		self._fetch_log = os.path.join(_emerge.emergelog._emerge_log_dir,
+			'emerge-fetch.log')
 		fetch_iface = self._fetch_iface_class(log_file=self._fetch_log,
 			schedule=self._schedule_fetch)
 		self._sched_iface = self._iface_class(



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-08 17:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-08 17:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c36d3ea4dec51781f0a1a3f45c3d2565e9ca2f95
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  8 17:05:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  8 17:05:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c36d3ea4

autounmask-write: support package.accept_keywords

---
 pym/_emerge/depgraph.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b9a394e..39179a4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5786,8 +5786,13 @@ class depgraph(object):
 					settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
 
 				if root in unstable_keyword_msg:
+					if os.path.exists(os.path.join(abs_user_config,
+						"package.accept_keywords")):
+						filename = "package.accept_keywords"
+					else:
+						filename = "package.keywords"
 					file_to_write_to[(abs_user_config, "package.keywords")] = \
-						find_config_file(abs_user_config, "package.keywords")
+						find_config_file(abs_user_config, filename)
 
 				if root in p_mask_change_msg:
 					file_to_write_to[(abs_user_config, "package.unmask")] = \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-08 17:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-08 17:31 UTC (permalink / raw
  To: gentoo-commits

commit:     4cab203adf5ab95d8a0cfa986a1da6c9f2b82809
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  8 17:30:43 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  8 17:30:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4cab203a

autounmask-write: prefer package.accept_keywords

---
 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 b024b88..074e287 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5788,8 +5788,8 @@ class depgraph(object):
 					settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
 
 				if root in unstable_keyword_msg:
-					if os.path.exists(os.path.join(abs_user_config,
-						"package.accept_keywords")):
+					if not os.path.exists(os.path.join(abs_user_config,
+						"package.keywords")):
 						filename = "package.accept_keywords"
 					else:
 						filename = "package.keywords"



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-08 20:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-08 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ac01d2898ece4589cdaa971382cc1dc17261ed58
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  8 20:24:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  8 20:24:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ac01d289

unmerge: show virtual in system unmerge warning

This is intended to clarify the messages shown in bug #370295, so that
it's obvious when a package is a member of the system set due to it
being a virtual provider.

---
 pym/_emerge/unmerge.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 38f3515..3db3a8b 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -61,10 +61,13 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 			vdb_lock = True
 
 		realsyslist = []
+		sys_virt_map = {}
 		for x in sets["system"].getAtoms():
 			for atom in expand_new_virt(vartree.dbapi, x):
 				if not atom.blocker:
 					realsyslist.append(atom)
+					if atom.cp != x.cp:
+						sys_virt_map[atom.cp] = x.cp
 
 		syslist = []
 		for x in realsyslist:
@@ -442,8 +445,13 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 			#avoid cluttering the preview printout with stuff that isn't getting unmerged
 			continue
 		if not (pkgmap[x]["protected"] or pkgmap[x]["omitted"]) and cp in syslist:
+			virt_cp = sys_virt_map.get(cp)
+			if virt_cp is None:
+				cp_info = "'%s'" % (cp,)
+			else:
+				cp_info = "'%s' (%s)" % (cp, virt_cp)
 			writemsg_level(colorize("BAD","\n\n!!! " + \
-				"'%s' is part of your system profile.\n" % cp),
+				"%s is part of your system profile.\n" % (cp_info,)),
 				level=logging.WARNING, noiselevel=-1)
 			writemsg_level(colorize("WARN","!!! Unmerging it may " + \
 				"be damaging to your system.\n\n"),



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-09 12:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-09 12:57 UTC (permalink / raw
  To: gentoo-commits

commit:     c067704f25f8ef74e53d16a333067767b69e06dd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 12:56:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 12:56:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c067704f

_show_unsatisfied_dep: fix logic for EAPI mask

This will fix bug #370465.

---
 pym/_emerge/depgraph.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 074e287..413e067 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2804,8 +2804,8 @@ class depgraph(object):
 
 					metadata, mreasons  = get_mask_info(root_config, cpv, pkgsettings, db, pkg_type, \
 						built, installed, db_keys, myrepo=repo, _pkg_use_enabled=self._pkg_use_enabled)
-
-					if metadata is not None:
+					if metadata is not None and \
+						portage.eapi_is_supported(metadata["EAPI"]):
 						if not repo:
 							repo = metadata.get('repository')
 						pkg = self._pkg(cpv, pkg_type, root_config,
@@ -6875,8 +6875,13 @@ def show_masked_packages(masked_packages):
 		if output_cpv in shown_cpvs:
 			continue
 		shown_cpvs.add(output_cpv)
+		eapi_masked = metadata is not None and \
+			not portage.eapi_is_supported(metadata["EAPI"])
+		if eapi_masked:
+			have_eapi_mask = True
 		comment, filename = None, None
-		if "package.mask" in mreasons:
+		if not eapi_masked and \
+			"package.mask" in mreasons:
 			comment, filename = \
 				portage.getmaskingreason(
 				cpv, metadata=metadata,
@@ -6884,9 +6889,7 @@ def show_masked_packages(masked_packages):
 				portdb=root_config.trees["porttree"].dbapi,
 				return_location=True)
 		missing_licenses = []
-		if metadata:
-			if not portage.eapi_is_supported(metadata["EAPI"]):
-				have_eapi_mask = True
+		if not eapi_masked and metadata is not None:
 			try:
 				missing_licenses = \
 					pkgsettings._getMissingLicenses(



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-09 13:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-09 13:14 UTC (permalink / raw
  To: gentoo-commits

commit:     993030fa80fd1dc415d9cab5fb9c05de05690818
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 13:03:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 13:13:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=993030fa

show_masked_packages: EAPI metadata safety

When masked by EAPI, metadata is mostly useless since it doesn't
contain essential things like SLOT.

---
 pym/_emerge/depgraph.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 413e067..a00837f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6879,6 +6879,9 @@ def show_masked_packages(masked_packages):
 			not portage.eapi_is_supported(metadata["EAPI"])
 		if eapi_masked:
 			have_eapi_mask = True
+			# When masked by EAPI, metadata is mostly useless since
+			# it doesn't contain essential things like SLOT.
+			metadata = None
 		comment, filename = None, None
 		if not eapi_masked and \
 			"package.mask" in mreasons:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-09 16:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-09 16:09 UTC (permalink / raw
  To: gentoo-commits

commit:     88f5bf84e2fd23125910b2ecaffc035971445696
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 16:07:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 16:07:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88f5bf84

SubProcess: make returncode like Popen

---
 pym/_emerge/SubProcess.py |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 115af80..da2b301 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -124,14 +124,18 @@ class SubProcess(AbstractPollTask):
 			self._files = None
 
 	def _set_returncode(self, wait_retval):
+		"""
+		Set the returncode in a manner compatible with
+		subprocess.Popen.returncode: A negative value -N indicates
+		that the child was terminated by signal N (Unix only).
+		"""
 
-		retval = wait_retval[1]
+		pid, status = wait_retval
 
-		if retval != os.EX_OK:
-			if retval & 0xff:
-				retval = (retval & 0xff) << 8
-			else:
-				retval = retval >> 8
+		if os.WIFSIGNALED(status):
+			retval = - os.WTERMSIG(status)
+		else:
+			retval = os.WEXITSTATUS(status)
 
 		self.returncode = retval
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-09 16:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-09 16:21 UTC (permalink / raw
  To: gentoo-commits

commit:     ab6d03f3813318f9ba49e75a52d42972e14cdcc7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 16:19:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 16:19:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab6d03f3

AbstractEbuildProcess: handle kill by signal

This will fix bug #368817.

---
 pym/_emerge/AbstractEbuildProcess.py |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 39c613b..4348788 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -181,6 +181,11 @@ class AbstractEbuildProcess(SpawnProcess):
 		return not ('sesandbox' in self.settings.features \
 			and self.settings.selinux_enabled()) or os.isatty(slave_fd)
 
+	def _killed_by_signal(self, signum):
+		msg = _("The ebuild phase '%s' has been "
+		"killed by signal %s.") % (self.phase, signum)
+		self._eerror(textwrap.wrap(msg, 72))
+
 	def _unexpected_exit(self):
 
 		phase = self.phase
@@ -243,14 +248,23 @@ class AbstractEbuildProcess(SpawnProcess):
 			if self._exit_command.exitcode is not None:
 				self.returncode = self._exit_command.exitcode
 			else:
-				self.returncode = 1
-				if not self.cancelled:
-					self._unexpected_exit()
+				if self.returncode < 0:
+					if not self.cancelled:
+						self._killed_by_signal(-self.returncode)
+				else:
+					self.returncode = 1
+					if not self.cancelled:
+						self._unexpected_exit()
 			if self._build_dir is not None:
 				self._build_dir.unlock()
 				self._build_dir = None
 		elif not self.cancelled:
 			exit_file = self.settings.get('PORTAGE_EBUILD_EXIT_FILE')
 			if exit_file and not os.path.exists(exit_file):
-				self.returncode = 1
-				self._unexpected_exit()
+				if self.returncode < 0:
+					if not self.cancelled:
+						self._killed_by_signal(-self.returncode)
+				else:
+					self.returncode = 1
+					if not self.cancelled:
+						self._unexpected_exit()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-09 18:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-09 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     501eef33b5ac990ae4b164a27e635be34cb9d14d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 18:19:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 18:19:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=501eef33

SubProcess: fix status for _set_returncode caller

These callers don't intend to make WIFSIGNALED return True, so they
need to shift their codes 8 bits to the left. This ensures that
commit 88f5bf84e2fd23125910b2ecaffc035971445696 behaves as intended.

---
 pym/_emerge/AbstractEbuildProcess.py |    2 +-
 pym/_emerge/BinpkgFetcher.py         |    2 +-
 pym/_emerge/EbuildFetcher.py         |    6 +++---
 pym/_emerge/EbuildMetadataPhase.py   |    4 ++--
 pym/_emerge/SubProcess.py            |    4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 4348788..0d1d991 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -57,7 +57,7 @@ class AbstractEbuildProcess(SpawnProcess):
 			"since PORTAGE_BUILDIR does not exist: '%s'") % \
 			(self.phase, self.settings['PORTAGE_BUILDDIR'])
 			self._eerror(textwrap.wrap(msg, 72))
-			self._set_returncode((self.pid, 1))
+			self._set_returncode((self.pid, 1 << 8))
 			self.wait()
 			return
 

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 12544d1..6c1dde9 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -65,7 +65,7 @@ class BinpkgFetcher(SpawnProcess):
 
 		if pretend:
 			portage.writemsg_stdout("\n%s\n" % uri, noiselevel=-1)
-			self._set_returncode((self.pid, os.EX_OK))
+			self._set_returncode((self.pid, os.EX_OK << 8))
 			self.wait()
 			return
 

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 0ea8dc7..c9a107d 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -38,13 +38,13 @@ class EbuildFetcher(SpawnProcess):
 				(self.pkg.cpv, e)
 			msg_lines.append(msg)
 			self._eerror(msg_lines)
-			self._set_returncode((self.pid, 1))
+			self._set_returncode((self.pid, 1 << 8))
 			self.wait()
 			return
 
 		if not uri_map:
 			# Nothing to fetch.
-			self._set_returncode((self.pid, os.EX_OK))
+			self._set_returncode((self.pid, os.EX_OK << 8))
 			self.wait()
 			return
 
@@ -59,7 +59,7 @@ class EbuildFetcher(SpawnProcess):
 		if self.prefetch and \
 			self._prefetch_size_ok(uri_map, settings, ebuild_path):
 			self.config_pool.deallocate(settings)
-			self._set_returncode((self.pid, os.EX_OK))
+			self._set_returncode((self.pid, os.EX_OK << 8))
 			self.wait()
 			return
 

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 5925ec4..284622d 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -46,7 +46,7 @@ class EbuildMetadataPhase(SubProcess):
 			if not portage.eapi_is_supported(eapi):
 				self.metadata_callback(self.cpv, self.ebuild_path,
 					self.repo_path, {'EAPI' : eapi}, self.ebuild_mtime)
-				self._set_returncode((self.pid, os.EX_OK))
+				self._set_returncode((self.pid, os.EX_OK << 8))
 				self.wait()
 				return
 
@@ -98,7 +98,7 @@ class EbuildMetadataPhase(SubProcess):
 		if isinstance(retval, int):
 			# doebuild failed before spawning
 			self._unregister()
-			self._set_returncode((self.pid, retval))
+			self._set_returncode((self.pid, retval << 8))
 			self.wait()
 			return
 

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index da2b301..b99cf0b 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -87,7 +87,7 @@ class SubProcess(AbstractPollTask):
 			if e.errno != errno.ECHILD:
 				raise
 			del e
-			self._set_returncode((self.pid, 1))
+			self._set_returncode((self.pid, 1 << 8))
 		else:
 			if wait_retval[0] != 0:
 				self._set_returncode(wait_retval)
@@ -98,7 +98,7 @@ class SubProcess(AbstractPollTask):
 					if e.errno != errno.ECHILD:
 						raise
 					del e
-					self._set_returncode((self.pid, 1))
+					self._set_returncode((self.pid, 1 << 8))
 				else:
 					self._set_returncode(wait_retval)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-10 23:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-10 23:30 UTC (permalink / raw
  To: gentoo-commits

commit:     603569311daee6e2460051f46728a05cbae66880
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 10 23:24:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 23:24:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60356931

depgraph._serialize_tasks: fix libperl/perl order

In some cases, the asap_nodes code caused selection of a large runtime
cycle that was obviously sub-optimal. Now such cases are detected and
avoided.

---
 pym/_emerge/depgraph.py |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a00837f..8e06aff 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5025,11 +5025,23 @@ class depgraph(object):
 						if selected_nodes:
 							break
 
-					if prefer_asap and asap_nodes and not selected_nodes:
-						# We failed to find any asap nodes to merge, so ignore
-						# them for the next iteration.
-						prefer_asap = False
-						continue
+					if prefer_asap and asap_nodes:
+						if not selected_nodes:
+							# We failed to find any asap nodes to merge,
+							# so ignore them for the next iteration.
+							prefer_asap = False
+							continue
+						# Make sure that we haven't selected a large runtime
+						# cycle that is obviously sub-optimal. This will be
+						# obvious if any of selected_nodes is a leaf node
+						# when medium_soft deps are ignored.
+						for node in selected_nodes:
+							if not mygraph.child_nodes(node, ignore_priority =
+								DepPriorityNormalRange.ignore_medium_soft):
+								prefer_asap = False
+								break
+						if not prefer_asap:
+							continue
 
 			if selected_nodes and ignore_priority is not None:
 				# Try to merge ignored medium_soft deps as soon as possible



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  0:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  0:43 UTC (permalink / raw
  To: gentoo-commits

commit:     74e5877db92e59883c8e2e9622b60c5e8fcf401e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 00:42:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 00:42:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=74e5877d

show_unsatisfied_blockers: don't omit any pkgs

It can be essential to see all the packages here, so don't omit any.
If the list is long, people can simply use a pager.

---
 pym/_emerge/depgraph.py |   27 ++++++++++-----------------
 1 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8e06aff..fab10eb 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5537,29 +5537,26 @@ class depgraph(object):
 			msg = []
 			msg.append("\n")
 			indent = "  "
-			# Max number of parents shown, to avoid flooding the display.
-			max_parents = 3
 			for pkg, parent_atoms in conflict_pkgs.items():
 
-				pruned_list = set()
-
 				# Prefer packages that are not directly involved in a conflict.
+				# It can be essential to see all the packages here, so don't
+				# omit any. If the list is long, people can simply use a pager.
+				preferred_parents = set()
 				for parent_atom in parent_atoms:
-					if len(pruned_list) >= max_parents:
-						break
 					parent, atom = parent_atom
 					if parent not in conflict_pkgs:
-						pruned_list.add(parent_atom)
+						preferred_parents.add(parent_atom)
 
-				for parent_atom in parent_atoms:
-					if len(pruned_list) >= max_parents:
-						break
-					pruned_list.add(parent_atom)
+				ordered_list = list(preferred_parents)
+				if len(parent_atoms) > len(ordered_list):
+					for parent_atom in parent_atoms:
+						if parent_atom not in preferred_parents:
+							ordered_list.append(parent_atom)
 
-				omitted_parents = len(parent_atoms) - len(pruned_list)
 				msg.append(indent + "%s pulled in by\n" % pkg)
 
-				for parent_atom in pruned_list:
+				for parent_atom in ordered_list:
 					parent, atom = parent_atom
 					msg.append(2*indent)
 					if isinstance(parent,
@@ -5573,10 +5570,6 @@ class depgraph(object):
 						msg.append("%s required by %s" % (atom, parent))
 					msg.append("\n")
 
-				if omitted_parents:
-					msg.append(2*indent)
-					msg.append("(and %d more)\n" % omitted_parents)
-
 				msg.append("\n")
 
 			writemsg("".join(msg), noiselevel=-1)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  2:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  2:45 UTC (permalink / raw
  To: gentoo-commits

commit:     d2403147d289aa34c27b16762e81c362d643b555
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 02:45:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 02:45:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2403147

depgraph._serialize_tasks: tweak last commit

This code is only intended when more than one node is selected.

---
 pym/_emerge/depgraph.py |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fab10eb..13152a7 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5035,13 +5035,15 @@ class depgraph(object):
 						# cycle that is obviously sub-optimal. This will be
 						# obvious if any of selected_nodes is a leaf node
 						# when medium_soft deps are ignored.
-						for node in selected_nodes:
-							if not mygraph.child_nodes(node, ignore_priority =
-								DepPriorityNormalRange.ignore_medium_soft):
-								prefer_asap = False
-								break
-						if not prefer_asap:
-							continue
+						if len(selected_nodes) > 1:
+							for node in selected_nodes:
+								if not mygraph.child_nodes(node,
+									ignore_priority =
+									DepPriorityNormalRange.ignore_medium_soft):
+									prefer_asap = False
+									break
+							if not prefer_asap:
+								continue
 
 			if selected_nodes and ignore_priority is not None:
 				# Try to merge ignored medium_soft deps as soon as possible



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  2:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  2:58 UTC (permalink / raw
  To: gentoo-commits

commit:     c1ea850b40d48ac1610e203f517b008e6461865f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 02:58:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 02:58:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c1ea850b

depgraph._serialize_tasks: tweak last commit more

---
 pym/_emerge/depgraph.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 13152a7..baa40c4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5033,10 +5033,10 @@ class depgraph(object):
 							continue
 						# Make sure that we haven't selected a large runtime
 						# cycle that is obviously sub-optimal. This will be
-						# obvious if any of selected_nodes is a leaf node
-						# when medium_soft deps are ignored.
+						# obvious if any of the non-asap selected_nodes is
+						# a leaf node when medium_soft deps are ignored.
 						if len(selected_nodes) > 1:
-							for node in selected_nodes:
+							for node in selected_nodes.difference(asap_nodes):
 								if not mygraph.child_nodes(node,
 									ignore_priority =
 									DepPriorityNormalRange.ignore_medium_soft):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  3:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  3:59 UTC (permalink / raw
  To: gentoo-commits

commit:     075ce106b3ae1e55cc810b4c946deea83bcb4a8e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 03:58:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 03:58:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=075ce106

depgraph._serialize_tasks: move libperl/perl code

This ensures that all asap_nodes are explored before setting
prefer_asap to False.

---
 pym/_emerge/depgraph.py |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index baa40c4..ca86904 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5019,7 +5019,23 @@ class depgraph(object):
 							selected_nodes = set()
 							if gather_deps(ignore_priority,
 								mergeable_nodes, selected_nodes, node):
-								break
+								# When selecting asap_nodes, we need to ensure
+								# that we don't selected a large runtime cycle
+								# that is obviously sub-optimal. This will be
+								# obvious if any of the non-asap selected_nodes
+								# is a leaf node when medium_soft deps are
+								# ignored.
+								if prefer_asap and asap_nodes and \
+									len(selected_nodes) > 1:
+									for node in selected_nodes.difference(
+										asap_nodes):
+										if not mygraph.child_nodes(node,
+											ignore_priority =
+											DepPriorityNormalRange.ignore_medium_soft):
+											selected_nodes = None
+											break
+								if selected_nodes:
+									break
 							else:
 								selected_nodes = None
 						if selected_nodes:
@@ -5031,19 +5047,6 @@ class depgraph(object):
 							# so ignore them for the next iteration.
 							prefer_asap = False
 							continue
-						# Make sure that we haven't selected a large runtime
-						# cycle that is obviously sub-optimal. This will be
-						# obvious if any of the non-asap selected_nodes is
-						# a leaf node when medium_soft deps are ignored.
-						if len(selected_nodes) > 1:
-							for node in selected_nodes.difference(asap_nodes):
-								if not mygraph.child_nodes(node,
-									ignore_priority =
-									DepPriorityNormalRange.ignore_medium_soft):
-									prefer_asap = False
-									break
-							if not prefer_asap:
-								continue
 
 			if selected_nodes and ignore_priority is not None:
 				# Try to merge ignored medium_soft deps as soon as possible



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  5:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  5:23 UTC (permalink / raw
  To: gentoo-commits

commit:     9390abed8b1a7dfa47c1ee0e25d83202afccda83
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 05:21:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 05:21:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9390abed

depgraph._serialize_tasks: revert formatting diff

---
 pym/_emerge/depgraph.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ca86904..5ad19e8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5041,12 +5041,11 @@ class depgraph(object):
 						if selected_nodes:
 							break
 
-					if prefer_asap and asap_nodes:
-						if not selected_nodes:
-							# We failed to find any asap nodes to merge,
-							# so ignore them for the next iteration.
-							prefer_asap = False
-							continue
+					if prefer_asap and asap_nodes and not selected_nodes:
+						# We failed to find any asap nodes to merge, so ignore
+						# them for the next iteration.
+						prefer_asap = False
+						continue
 
 			if selected_nodes and ignore_priority is not None:
 				# Try to merge ignored medium_soft deps as soon as possible



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  6:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  6:26 UTC (permalink / raw
  To: gentoo-commits

commit:     7ec9999cd3c06f66655091be465471973b52b1dd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 06:25:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 06:25:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7ec9999c

serialize_tasks: minimize nodes in runtime cycles

When gathering the nodes belonging to a runtime cycle, we want to
minimize the number of nodes gathered, since this tends to produce
a more optimal merge order. Ignoring all medium_soft deps serves
this purpose.

---
 pym/_emerge/depgraph.py |   60 +++++++++++++++++++++++-----------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5ad19e8..5dda222 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5010,36 +5010,36 @@ class depgraph(object):
 					mergeable_nodes = set(nodes)
 					if prefer_asap and asap_nodes:
 						nodes = asap_nodes
-					for i in range(priority_range.SOFT,
-						priority_range.MEDIUM_SOFT + 1):
-						ignore_priority = priority_range.ignore_priority[i]
-						for node in nodes:
-							if not mygraph.parent_nodes(node):
-								continue
-							selected_nodes = set()
-							if gather_deps(ignore_priority,
-								mergeable_nodes, selected_nodes, node):
-								# When selecting asap_nodes, we need to ensure
-								# that we don't selected a large runtime cycle
-								# that is obviously sub-optimal. This will be
-								# obvious if any of the non-asap selected_nodes
-								# is a leaf node when medium_soft deps are
-								# ignored.
-								if prefer_asap and asap_nodes and \
-									len(selected_nodes) > 1:
-									for node in selected_nodes.difference(
-										asap_nodes):
-										if not mygraph.child_nodes(node,
-											ignore_priority =
-											DepPriorityNormalRange.ignore_medium_soft):
-											selected_nodes = None
-											break
-								if selected_nodes:
-									break
-							else:
-								selected_nodes = None
-						if selected_nodes:
-							break
+					# When gathering the nodes belonging to a runtime cycle,
+					# we want to minimize the number of nodes gathered, since
+					# this tends to produce a more optimal merge order.
+					# Ignoring all medium_soft deps serves this purpose.
+					ignore_priority = priority_range.ignore_medium_soft
+					for node in nodes:
+						if not mygraph.parent_nodes(node):
+							continue
+						selected_nodes = set()
+						if gather_deps(ignore_priority,
+							mergeable_nodes, selected_nodes, node):
+							# When selecting asap_nodes, we need to ensure
+							# that we don't selected a large runtime cycle
+							# that is obviously sub-optimal. This will be
+							# obvious if any of the non-asap selected_nodes
+							# is a leaf node when medium_soft deps are
+							# ignored.
+							if prefer_asap and asap_nodes and \
+								len(selected_nodes) > 1:
+								for node in selected_nodes.difference(
+									asap_nodes):
+									if not mygraph.child_nodes(node,
+										ignore_priority =
+										DepPriorityNormalRange.ignore_medium_soft):
+										selected_nodes = None
+										break
+							if selected_nodes:
+								break
+						else:
+							selected_nodes = None
 
 					if prefer_asap and asap_nodes and not selected_nodes:
 						# We failed to find any asap nodes to merge, so ignore



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11  9:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11  9:06 UTC (permalink / raw
  To: gentoo-commits

commit:     adde8a45e2f82adcc12cb146ccc65774d5783bf2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 09:05:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 09:05:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=adde8a45

serialize_tasks: minimize runtime cycles more

---
 pym/_emerge/depgraph.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5dda222..854fa63 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5015,6 +5015,7 @@ class depgraph(object):
 					# this tends to produce a more optimal merge order.
 					# Ignoring all medium_soft deps serves this purpose.
 					ignore_priority = priority_range.ignore_medium_soft
+					smallest_cycle = None
 					for node in nodes:
 						if not mygraph.parent_nodes(node):
 							continue
@@ -5037,9 +5038,11 @@ class depgraph(object):
 										selected_nodes = None
 										break
 							if selected_nodes:
-								break
-						else:
-							selected_nodes = None
+								if smallest_cycle is None or \
+									len(selected_nodes) < len(smallest_cycle):
+									smallest_cycle = selected_nodes
+
+					selected_nodes = smallest_cycle
 
 					if prefer_asap and asap_nodes and not selected_nodes:
 						# We failed to find any asap nodes to merge, so ignore



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11 15:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11 15:52 UTC (permalink / raw
  To: gentoo-commits

commit:     da1556b818de2829fc72700a15a12424ccf32f16
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 15:51:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 15:51:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=da1556b8

serialize_tasks: asap ignore medium_soft earlier

This allows us to avoid the less efficient runtime cycle pathway for
cases in which an asap node is a leaf if medium_soft deps are ignored.
Ths should increase efficiency without changing behavior.

---
 pym/_emerge/depgraph.py |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 854fa63..37dde2d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4940,12 +4940,18 @@ class depgraph(object):
 				# the parent to have been removed from the graph already.
 				asap_nodes = [node for node in asap_nodes \
 					if mygraph.contains(node)]
-				for node in asap_nodes:
-					if not mygraph.child_nodes(node,
-						ignore_priority=priority_range.ignore_soft):
-						selected_nodes = [node]
-						asap_nodes.remove(node)
+				for i in range(priority_range.SOFT,
+					priority_range.MEDIUM_SOFT + 1):
+					ignore_priority = priority_range.ignore_priority[i]
+					for node in asap_nodes:
+						if not mygraph.child_nodes(node,
+							ignore_priority=ignore_priority):
+							selected_nodes = [node]
+							asap_nodes.remove(node)
+							break
+					if selected_nodes:
 						break
+
 			if not selected_nodes and \
 				not (prefer_asap and asap_nodes):
 				for i in range(priority_range.NONE,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11 16:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-11 16:27 UTC (permalink / raw
  To: gentoo-commits

commit:     3e5b65a93e92a4cdb1c5e32c1ae8cf3c605b8391
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 16:26:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 16:26:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3e5b65a9

serialize_tasks: debug output for runtime cycles

---
 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 37dde2d..41924b4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4698,7 +4698,9 @@ class depgraph(object):
 
 	def _serialize_tasks(self):
 
-		if "--debug" in self._frozen_config.myopts:
+		debug = "--debug" in self._frozen_config.myopts
+
+		if debug:
 			writemsg("\ndigraph:\n\n", noiselevel=-1)
 			self._dynamic_config.digraph.debug_print()
 			writemsg("\n", noiselevel=-1)
@@ -5050,6 +5052,15 @@ class depgraph(object):
 
 					selected_nodes = smallest_cycle
 
+					if selected_nodes and debug:
+						writemsg("\nruntime cycle digraph (%s nodes):\n\n" %
+							(len(selected_nodes),), noiselevel=-1)
+						cycle_digraph = mygraph.copy()
+						cycle_digraph.difference_update([x for x in
+							cycle_digraph if x not in selected_nodes])
+						cycle_digraph.debug_print()
+						writemsg("\n", noiselevel=-1)
+
 					if prefer_asap and asap_nodes and not selected_nodes:
 						# We failed to find any asap nodes to merge, so ignore
 						# them for the next iteration.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-11 19:11 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-06-11 19:11 UTC (permalink / raw
  To: gentoo-commits

commit:     5e5b5c28dec6e9112f85adf0e2aaa00089010e62
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sat Jun 11 19:12:09 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 19:12:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e5b5c28

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 41924b4..3b47c35 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5031,7 +5031,7 @@ class depgraph(object):
 						if gather_deps(ignore_priority,
 							mergeable_nodes, selected_nodes, node):
 							# When selecting asap_nodes, we need to ensure
-							# that we don't selected a large runtime cycle
+							# that we haven't selected a large runtime cycle
 							# that is obviously sub-optimal. This will be
 							# obvious if any of the non-asap selected_nodes
 							# is a leaf node when medium_soft deps are



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-13 13:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-13 13:02 UTC (permalink / raw
  To: gentoo-commits

commit:     19c9f21ecddc2ed7092e91a57fe219e3082aa18c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 13:01:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 13:01:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19c9f21e

Scheduler: make --fetchonly skip pkg_pretend

---
 pym/_emerge/Scheduler.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index c3752c5..b88e2c2 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1048,9 +1048,10 @@ class Scheduler(PollScheduler):
 		if rval != os.EX_OK and not keep_going:
 			return rval
 
-		rval = self._run_pkg_pretend()
-		if rval != os.EX_OK:
-			return rval
+		if not fetchonly:
+			rval = self._run_pkg_pretend()
+			if rval != os.EX_OK:
+				return rval
 
 		while True:
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-13 21:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-13 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     a40c1905e53d3af20df6d4f940e1235551a6840e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 21:50:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 21:50:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a40c1905

pkg_use_enabled: return early for built pkgs

Built/installed packages have frozen USE settings, so there's no sense
in considering them for autounmask USE config changes. They'll simply
be rejected by select_package, and an unbuilt ebuild will be selected
instead. This will fix bug 371423 by avoiding unnecessary use_reduce
calls on the deps of installed packages.

---
 pym/_emerge/depgraph.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9ce199b..da48f2a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3440,6 +3440,8 @@ class depgraph(object):
 		Example: target_use = { "foo": True, "bar": False }
 		The flags target_use must be in the pkg's IUSE.
 		"""
+		if pkg.built:
+			return pkg.use.enabled
 		needed_use_config_change = self._dynamic_config._needed_use_config_changes.get(pkg)
 
 		if target_use is None:
@@ -3739,7 +3741,7 @@ class depgraph(object):
 					if atom.use:
 
 						matched_pkgs_ignore_use.append(pkg)
-						if allow_use_changes:
+						if allow_use_changes and not pkg.built:
 							target_use = {}
 							for flag in atom.use.enabled:
 								target_use[flag] = True



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-16 15:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-16 15:37 UTC (permalink / raw
  To: gentoo-commits

commit:     3f159f67ceee78e7219d23bec41139df2f160b94
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 16 15:35:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 15:35:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f159f67

expand_set_args: add root SetArg nodes to graph

This prevents get_dep_chain from triggering a KeyError some cases as
reported in bug #371767.

---
 pym/_emerge/depgraph.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index da48f2a..773a256 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -846,6 +846,11 @@ class depgraph(object):
 				if arg in traversed_set_args:
 					continue
 				traversed_set_args.add(arg)
+
+				if add_to_digraph:
+					self._dynamic_config.digraph.add(arg, None,
+						priority=BlockerDepPriority.instance)
+
 				yield arg
 
 				# Traverse nested sets and add them to the stack



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-17 22:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-17 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     cbe44d92ff13b8a22f5b4215b73078ce600c6bf4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 17 21:58:37 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 17 21:58:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cbe44d92

misspell-suggestions: filter the input cp

Obviously, we don't want to consider the input cp as a possible
suggestion, as reported in bug 372033.

---
 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 773a256..80409b0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3110,6 +3110,8 @@ class depgraph(object):
 				all_cp.update(portdb.cp_all())
 				if "--usepkg" in self._frozen_config.myopts:
 					all_cp.update(bindb.cp_all())
+				# discard dir containing no ebuilds
+				all_cp.discard(cp)
 
 				orig_cp_map = {}
 				for cp_orig in all_cp:
@@ -3120,8 +3122,12 @@ class depgraph(object):
 					matches = difflib.get_close_matches(cp, all_cp)
 				else:
 					pkg_to_cp = {}
-					for other_cp in all_cp:
+					for other_cp in list(all_cp):
 						other_pkg = portage.catsplit(other_cp)[1]
+						if other_pkg == pkg:
+							# discard dir containing no ebuilds
+							all_cp.discard(other_cp)
+							continue
 						pkg_to_cp.setdefault(other_pkg, set()).add(other_cp)
 					pkg_matches = difflib.get_close_matches(pkg, pkg_to_cp)
 					matches = []



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-27  6:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-27  6:54 UTC (permalink / raw
  To: gentoo-commits

commit:     7587568f3133d12ef68b633328954cb838fcaafe
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 27 06:53:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 27 06:53:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7587568f

Package.use: share identical frozenset instances

---
 pym/_emerge/Package.py |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 7a25638..20c72b4 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -392,6 +392,9 @@ class Package(Task):
 		__slots__ = ("enabled", "_expand", "_expand_hidden",
 			"_force", "_pkg", "_mask")
 
+		# Share identical frozenset instances when available.
+		_frozensets = {}
+
 		def __init__(self, pkg, use_str):
 			self._pkg = pkg
 			self._expand = None
@@ -410,12 +413,17 @@ class Package(Task):
 
 		def _init_force_mask(self):
 			pkgsettings = self._pkg._get_pkgsettings()
-			self._expand = frozenset(
+			frozensets = self._frozensets
+			s = frozenset(
 				pkgsettings.get("USE_EXPAND", "").lower().split())
-			self._expand_hidden = frozenset(
+			self._expand = frozensets.setdefault(s, s)
+			s = frozenset(
 				pkgsettings.get("USE_EXPAND_HIDDEN", "").lower().split())
-			self._force = pkgsettings.useforce
-			self._mask = pkgsettings.usemask
+			self._expand_hidden = frozensets.setdefault(s, s)
+			s = pkgsettings.useforce
+			self._force = frozensets.setdefault(s, s)
+			s = pkgsettings.usemask
+			self._mask = frozensets.setdefault(s, s)
 
 		@property
 		def expand(self):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-27 19:34 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-06-27 19:34 UTC (permalink / raw
  To: gentoo-commits

commit:     8ff8b0aad08d1381aeb410807881b46ba4bc7135
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Jun 27 19:33:17 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Jun 27 19:33:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8ff8b0aa

pkg_use_display(): Use use.expand and use.expand_hidden attributes.

---
 pym/_emerge/UseFlagDisplay.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/UseFlagDisplay.py b/pym/_emerge/UseFlagDisplay.py
index 5cf82ec..7c7958d 100644
--- a/pym/_emerge/UseFlagDisplay.py
+++ b/pym/_emerge/UseFlagDisplay.py
@@ -60,10 +60,8 @@ class UseFlagDisplay(object):
 
 def pkg_use_display(pkg, opts):
 	settings = pkg.root_config.settings
-	use_expand = settings.get('USE_EXPAND', '').split()
-	use_expand.sort()
-	use_expand_hidden = set(
-		settings.get('USE_EXPAND_HIDDEN', '').upper().split())
+	use_expand = pkg.use.expand
+	use_expand_hidden = pkg.use.expand_hidden
 	alphabetical_use = '--alphabetical' in opts
 	forced_flags = set(chain(pkg.use.force,
 		pkg.use.mask))



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-06-30 13:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-06-30 13:11 UTC (permalink / raw
  To: gentoo-commits

commit:     19d71ef90609303586323e4a5c17dc0005838d8c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 13:10:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 13:10:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19d71ef9

UseFlagDisplay: fix USE_EXPAND_HIDDEN breakage

---
 pym/_emerge/UseFlagDisplay.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/UseFlagDisplay.py b/pym/_emerge/UseFlagDisplay.py
index 7c7958d..380f86d 100644
--- a/pym/_emerge/UseFlagDisplay.py
+++ b/pym/_emerge/UseFlagDisplay.py
@@ -100,7 +100,7 @@ def pkg_use_display(pkg, opts):
 
 	flag_displays = []
 	for varname in var_order:
-		if varname in use_expand_hidden:
+		if varname.lower() in use_expand_hidden:
 			continue
 		flags = []
 		for f in use_enabled.get(varname, []):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-03 11:09 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-07-03 11:09 UTC (permalink / raw
  To: gentoo-commits

commit:     0bfefb75ffbf3dd6267a2fa72253d28e7dc8b1c2
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jul  3 11:09:08 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 11:09:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0bfefb75

Show repository in error message about missing USE flags.

---
 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 c22215b..388c168 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3070,7 +3070,7 @@ class depgraph(object):
 			writemsg_stdout("\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+".\n", noiselevel=-1)
 			writemsg_stdout("!!! One of the following packages is required to complete your request:\n", noiselevel=-1)
 			for pkg, mreasons in show_missing_use:
-				writemsg_stdout("- "+pkg.cpv+" ("+", ".join(mreasons)+")\n", noiselevel=-1)
+				writemsg_stdout("- "+pkg.cpv+_repo_separator+pkg.repo+" ("+", ".join(mreasons)+")\n", noiselevel=-1)
 
 		elif masked_packages:
 			writemsg_stdout("\n!!! " + \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-08 10:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-08 10:09 UTC (permalink / raw
  To: gentoo-commits

commit:     585f0df6dba9bdea3884af84dc9c471014eed5ff
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 10:06:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 10:06:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=585f0df6

Qualify "missed update" message as WARNING.

---
 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 388c168..bc4d538 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -656,8 +656,8 @@ class depgraph(object):
 			return
 
 		msg = []
-		msg.append("\n!!! One or more updates have been skipped due to " + \
-			"a dependency conflict:\n\n")
+		msg.append("\nWARNING: One or more updates have been " + \
+			"skipped due to a dependency conflict:\n\n")
 
 		indent = "  "
 		for pkg, parent_atoms in missed_updates:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-08 16:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-08 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     a630e065339abdd76038da568000773bc56f1c97
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 16:16:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 16:16:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a630e065

getportageversion: omit implicit -r0 for libc

---
 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 8601929..e57fd93 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2823,7 +2823,10 @@ def getportageversion(portdir, target_root, profile, chost, vardb):
 			libclist.update(vardb.match(atom))
 	if libclist:
 		for cpv in sorted(libclist):
-			libcver.append("-".join(portage.catpkgsplit(cpv)[1:]))
+			libc_split = portage.catpkgsplit(cpv)[1:]
+			if libc_split[-1] == "r0":
+				libc_split[:-1]
+			libcver.append("-".join(libc_split))
 	else:
 		libcver = ["unavailable"]
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-09 20:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-09 20:13 UTC (permalink / raw
  To: gentoo-commits

commit:     3189ba035110795212c49db501a62b5007df4e18
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  9 20:12:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul  9 20:12:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3189ba03

depgraph: include pkg.repo in debug output

---
 pym/_emerge/depgraph.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index bc4d538..899d04e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3901,8 +3901,9 @@ class depgraph(object):
 
 		if "--debug" in self._frozen_config.myopts:
 			for pkg in matched_packages:
-				portage.writemsg("%s %s\n" % \
-					((pkg.type_name + ":").rjust(10), pkg.cpv), noiselevel=-1)
+				portage.writemsg("%s %s%s%s\n" % \
+					((pkg.type_name + ":").rjust(10),
+					pkg.cpv, _repo_separator, pkg.repo), noiselevel=-1)
 
 		# Filter out any old-style virtual matches if they are
 		# mixed with new-style virtual matches.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-10  3:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-10  3:25 UTC (permalink / raw
  To: gentoo-commits

commit:     895823111601bb73204daf5cdaf86d401d91983c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 03:24:49 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 03:24:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=89582311

depgraph: reject USE conditionals in arguments

---
 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 64ed50e..2a5848c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2082,6 +2082,14 @@ class depgraph(object):
 					else:
 						atom = null_atom
 
+				if atom.use and atom.use.conditional:
+					writemsg(
+						("\n\n!!! '%s' contains a conditional " + \
+						"which is not allowed.\n") % (x,), noiselevel=-1)
+					writemsg("!!! Please check ebuild(5) for full details.\n")
+					self._dynamic_config._skip_restart = True
+					return (0,[])
+
 				args.append(AtomArg(arg=x, atom=atom,
 					root_config=root_config))
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-10 12:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-10 12:23 UTC (permalink / raw
  To: gentoo-commits

commit:     84d7468855226af62e7e156967b4211cc5782fd6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 12:23:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 12:23:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84d74688

depgraph: more debug output for _add_pkg

This should make it easier to debug cases like bug 374423,
among others.

---
 pym/_emerge/UseFlagDisplay.py |    7 ++++-
 pym/_emerge/depgraph.py       |   54 +++++++++++++++++++++++++++++-----------
 2 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/UseFlagDisplay.py b/pym/_emerge/UseFlagDisplay.py
index 380f86d..3daca19 100644
--- a/pym/_emerge/UseFlagDisplay.py
+++ b/pym/_emerge/UseFlagDisplay.py
@@ -58,14 +58,17 @@ class UseFlagDisplay(object):
 	sort_separated = cmp_sort_key(_cmp_separated)
 	del _cmp_separated
 
-def pkg_use_display(pkg, opts):
+def pkg_use_display(pkg, opts, modified_use=None):
 	settings = pkg.root_config.settings
 	use_expand = pkg.use.expand
 	use_expand_hidden = pkg.use.expand_hidden
 	alphabetical_use = '--alphabetical' in opts
 	forced_flags = set(chain(pkg.use.force,
 		pkg.use.mask))
-	use = set(pkg.use.enabled)
+	if modified_use is None:
+		use = set(pkg.use.enabled)
+	else:
+		use = set(modified_use)
 	use.discard(settings.get('ARCH'))
 	use_expand_flags = set()
 	use_enabled = {}

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2a5848c..d5971d1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -976,6 +976,11 @@ class depgraph(object):
 		return (existing_node, matches)
 
 	def _add_pkg(self, pkg, dep):
+		"""
+		Adds a package to the depgraph, queues dependencies, and handles
+		slot conflicts.
+		"""
+		debug = "--debug" in self._frozen_config.myopts
 		myparent = None
 		priority = None
 		depth = 0
@@ -987,17 +992,28 @@ class depgraph(object):
 			depth = dep.depth
 		if priority is None:
 			priority = DepPriority()
-		"""
-		Fills the digraph with nodes comprised of packages to merge.
-		mybigkey is the package spec of the package to merge.
-		myparent is the package depending on mybigkey ( or None )
-		addme = Should we add this package to the digraph or are we just looking at it's deps?
-			Think --onlydeps, we need to ignore packages in that case.
-		#stuff to add:
-		#SLOT-aware emerge
-		#IUSE-aware emerge -> USE DEP aware depgraph
-		#"no downgrade" emerge
-		"""
+
+		if debug:
+			writemsg_level(
+				"\n%s%s %s\n" % ("Child:".ljust(15), pkg,
+				pkg_use_display(pkg, self._frozen_config.myopts,
+				modified_use=self._pkg_use_enabled(pkg))),
+				level=logging.DEBUG, noiselevel=-1)
+			if isinstance(myparent,
+				(PackageArg, AtomArg)):
+				# For PackageArg and AtomArg types, it's
+				# redundant to display the atom attribute.
+				writemsg_level(
+					"%s%s\n" % ("Parent Dep:".ljust(15), myparent),
+					level=logging.DEBUG, noiselevel=-1)
+			else:
+				# Display the specific atom from SetArg or
+				# Package types.
+				writemsg_level(
+					"%s%s required by %s\n" %
+					("Parent Dep:".ljust(15), dep.atom, myparent),
+					level=logging.DEBUG, noiselevel=-1)
+
 		# Ensure that the dependencies of the same package
 		# are never processed more than once.
 		previously_added = pkg in self._dynamic_config.digraph
@@ -1190,6 +1206,14 @@ class depgraph(object):
 					self._add_slot_conflict(pkg)
 					slot_collision = True
 
+					if debug:
+						writemsg_level(
+							"%s%s %s\n" % ("Slot Conflict:".ljust(15),
+							existing_node, pkg_use_display(existing_node,
+							self._frozen_config.myopts,
+							modified_use=self._pkg_use_enabled(existing_node))),
+							level=logging.DEBUG, noiselevel=-1)
+
 			if slot_collision:
 				# Now add this node to the graph so that self.display()
 				# can show use flags and --tree portage.output.  This node is
@@ -1573,7 +1597,7 @@ class depgraph(object):
 				continue
 
 			if debug:
-				writemsg_level("Candidates: %s: %s\n" % \
+				writemsg_level("\nCandidates: %s: %s\n" % \
 					(virt_pkg.cpv, [str(x) for x in atoms]),
 					noiselevel=-1, level=logging.DEBUG)
 
@@ -1670,7 +1694,7 @@ class depgraph(object):
 							traversed_virt_pkgs.add(dep.child)
 
 		if debug:
-			writemsg_level("Exiting... %s\n" % (pkg,),
+			writemsg_level("\nExiting... %s\n" % (pkg,),
 				noiselevel=-1, level=logging.DEBUG)
 
 		return 1
@@ -2226,8 +2250,8 @@ class depgraph(object):
 							return 0, myfavorites
 						continue
 					if debug:
-						portage.writemsg("      Arg: %s\n     Atom: %s\n" % \
-							(arg, atom), noiselevel=-1)
+						writemsg_level("\n      Arg: %s\n     Atom: %s\n" %
+							(arg, atom), noiselevel=-1, level=logging.DEBUG)
 					pkg, existing_node = self._select_package(
 						myroot, atom, onlydeps=onlydeps)
 					if not pkg:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-11 14:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-11 14:12 UTC (permalink / raw
  To: gentoo-commits

commit:     774ab66e9cc55f749052d690421765647c9c9c9c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 14:08:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 14:08:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=774ab66e

is_valid_package_atom: fix circular import

Due to a quirk in python import behavior, this only failed
nondeterministically. However, the new preinst sanity test in the
portage-9999 ebuild tends to trigger it more often for some people.

---
 pym/_emerge/depgraph.py              |   13 ++-----------
 pym/_emerge/is_valid_package_atom.py |   18 +++++++++++++-----
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d0b8fb7..a4b04f6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7,7 +7,6 @@ import difflib
 import errno
 import io
 import logging
-import re
 import stat
 import sys
 import textwrap
@@ -49,7 +48,8 @@ from _emerge.DepPriorityNormalRange import DepPriorityNormalRange
 from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange
 from _emerge.FakeVartree import FakeVartree
 from _emerge._find_deep_system_runtime_deps import _find_deep_system_runtime_deps
-from _emerge.is_valid_package_atom import is_valid_package_atom
+from _emerge.is_valid_package_atom import insert_category_into_atom, \
+	is_valid_package_atom
 from _emerge.Package import Package
 from _emerge.PackageArg import PackageArg
 from _emerge.PackageVirtualDbapi import PackageVirtualDbapi
@@ -6690,15 +6690,6 @@ def ambiguous_package_name(arg, atoms, root_config, spinner, myopts):
 	writemsg("!!! The short ebuild name \"%s\" is ambiguous. Please specify\n" % arg, noiselevel=-1)
 	writemsg("!!! one of the above fully-qualified ebuild names instead.\n\n", noiselevel=-1)
 
-def insert_category_into_atom(atom, category):
-	alphanum = re.search(r'\w', atom)
-	if alphanum:
-		ret = atom[:alphanum.start()] + "%s/" % category + \
-			atom[alphanum.start():]
-	else:
-		ret = None
-	return ret
-
 def _spinner_start(spinner, myopts):
 	if spinner is None:
 		return

diff --git a/pym/_emerge/is_valid_package_atom.py b/pym/_emerge/is_valid_package_atom.py
index d33cf45..7cb2a5b 100644
--- a/pym/_emerge/is_valid_package_atom.py
+++ b/pym/_emerge/is_valid_package_atom.py
@@ -1,13 +1,21 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import re
-import portage
-import _emerge.depgraph
+from portage.dep import isvalidatom
+
+def insert_category_into_atom(atom, category):
+	alphanum = re.search(r'\w', atom)
+	if alphanum:
+		ret = atom[:alphanum.start()] + "%s/" % category + \
+			atom[alphanum.start():]
+	else:
+		ret = None
+	return ret
 
 def is_valid_package_atom(x, allow_repo=False):
 	if "/" not in x:
-		x2 = _emerge.depgraph.insert_category_into_atom(x, 'cat')
+		x2 = insert_category_into_atom(x, 'cat')
 		if x2 != None:
 			x = x2
-	return portage.isvalidatom(x, allow_blockers=False, allow_repo=allow_repo)
+	return isvalidatom(x, allow_blockers=False, allow_repo=allow_repo)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-11 15:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-11 15:35 UTC (permalink / raw
  To: gentoo-commits

commit:     02c20ea840829e48c072015eb6d5d89ce3caca1d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 15:35:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 15:35:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=02c20ea8

Log maintainer info for pretend and nofetch.

Also, suppress this maintainer info from going to stdout since it's
intended for the log and it doesn't necessarily need to be visible
elsewhere. This will fix bug #374809.

---
 pym/_emerge/EbuildPhase.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 954c033..64d33a8 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -61,7 +61,7 @@ class EbuildPhase(CompositeTask):
 				except OSError:
 					pass
 
-		if self.phase == 'setup':
+		if self.phase in ('nofetch', 'pretend', 'setup'):
 
 			use = self.settings.get('PORTAGE_BUILT_USE')
 			if use is None:
@@ -97,7 +97,11 @@ class EbuildPhase(CompositeTask):
 					relevant_features.append(x)
 			if relevant_features:
 				msg.append("FEATURES:   %s" % " ".join(relevant_features))
-			self._elog('einfo', msg)
+
+			# Force background=True for this header since it's intended
+			# for the log and it doesn't necessarily need to be visible
+			# elsewhere.
+			self._elog('einfo', msg, background=True)
 
 		if self.phase == 'package':
 			if 'PORTAGE_BINPKG_TMPFILE' not in self.settings:
@@ -326,7 +330,9 @@ class EbuildPhase(CompositeTask):
 		self.returncode = 1
 		self.wait()
 
-	def _elog(self, elog_funcname, lines):
+	def _elog(self, elog_funcname, lines, background=None):
+		if background is None:
+			background = self.background
 		out = StringIO()
 		phase = self.phase
 		elog_func = getattr(elog_messages, elog_funcname)
@@ -344,4 +350,5 @@ class EbuildPhase(CompositeTask):
 			log_path = None
 			if self.settings.get("PORTAGE_BACKGROUND") != "subprocess":
 				log_path = self.settings.get("PORTAGE_LOG_FILE")
-			self.scheduler.output(msg, log_path=log_path)
+			self.scheduler.output(msg, log_path=log_path,
+				background=background)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-11 17:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-11 17:18 UTC (permalink / raw
  To: gentoo-commits

commit:     5d8804712e9f49308f17f7fbb889edb048fa6c3a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 17:17:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 17:17:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5d880471

resume_depgraph: fix breakage from reposyntax

This is a major regression that has been triggering lots of complaints
about emerge --keep-going.

---
 pym/_emerge/depgraph.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a4b04f6..549ce7f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6879,10 +6879,12 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 						unsatisfied_parents[parent_node] = parent_node
 						unsatisfied_stack.append(parent_node)
 
+			unsatisfied_tuples = set(tuple(pkg)
+				for pkg in unsatisfied_parents)
 			pruned_mergelist = []
 			for x in mergelist:
 				if isinstance(x, list) and \
-					tuple(x) not in unsatisfied_parents:
+					tuple(x) not in unsatisfied_tuples:
 					pruned_mergelist.append(x)
 
 			# If the mergelist doesn't shrink then this loop is infinite.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-11 21:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-11 21:59 UTC (permalink / raw
  To: gentoo-commits

commit:     428053ee44e4a14b3c74dc8e541bcb062b31a799
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 21:58:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 21:58:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=428053ee

autounmask-write: create /etc/portage if needed

---
 pym/_emerge/depgraph.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 549ce7f..8219a77 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -30,6 +30,7 @@ from portage._sets import SETPREFIX
 from portage._sets.base import InternalPackageSet
 from portage.util import ConfigProtect, shlex_split, new_protect_filename
 from portage.util import cmp_sort_key, writemsg, writemsg_stdout
+from portage.util import ensure_dirs
 from portage.util import writemsg_level, write_atomic
 from portage.util.digraph import digraph
 from portage.util.listdir import _ignorecvs_dirs
@@ -5982,11 +5983,12 @@ class depgraph(object):
 			if userquery(prompt, enter_invalid) == 'No':
 				write_to_file = False
 
-		if write_to_file:
+		if write_to_file and file_to_write_to:
 			for root in roots:
 				settings = self._frozen_config.roots[root].settings
 				abs_user_config = os.path.join(
 					settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
+				ensure_dirs(abs_user_config)
 
 				if root in unstable_keyword_msg:
 					write_changes(root, unstable_keyword_msg[root],



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-12 19:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-12 19:16 UTC (permalink / raw
  To: gentoo-commits

commit:     f3429167e69a1da2a9c90ad8d62a0080710760a9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 19:15:44 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 19:15:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f3429167

unmerge: reject USE conditionals in arguments

---
 pym/_emerge/actions.py |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e57fd93..62dadee 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2535,8 +2535,7 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 			(ignore_missing_eq and is_valid_package_atom('=' + x)):
 
 			try:
-				valid_atoms.append(
-					dep_expand(x, mydb=vardb, settings=settings))
+				atom = dep_expand(x, mydb=vardb, settings=settings)
 			except portage.exception.AmbiguousPackageName as e:
 				msg = "The short ebuild name \"" + x + \
 					"\" is ambiguous.  Please specify " + \
@@ -2550,6 +2549,17 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 						level=logging.ERROR, noiselevel=-1)
 				writemsg_level("\n", level=logging.ERROR, noiselevel=-1)
 				return 1
+			else:
+				if atom.use and atom.use.conditional:
+					writemsg_level(
+						("\n\n!!! '%s' contains a conditional " + \
+						"which is not allowed.\n") % (x,),
+						level=logging.ERROR, noiselevel=-1)
+					writemsg_level(
+						"!!! Please check ebuild(5) for full details.\n",
+						level=logging.ERROR)
+					return 1
+				valid_atoms.append(atom)
 
 		elif x.startswith(os.sep):
 			if not x.startswith(root):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-12 19:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-12 19:27 UTC (permalink / raw
  To: gentoo-commits

commit:     c12225b59b6ba336a05b5e0b07bd3b51b9d2f012
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 19:26:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 19:26:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c12225b5

resume_depgraph: be careful with parent_node type

---
 pym/_emerge/depgraph.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8219a77..a5923dd 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6881,8 +6881,9 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 						unsatisfied_parents[parent_node] = parent_node
 						unsatisfied_stack.append(parent_node)
 
-			unsatisfied_tuples = set(tuple(pkg)
-				for pkg in unsatisfied_parents)
+			unsatisfied_tuples = frozenset(tuple(parent_node)
+				for parent_node in unsatisfied_parents
+				if isinstance(parent_node, Package))
 			pruned_mergelist = []
 			for x in mergelist:
 				if isinstance(x, list) and \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-12 21:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-12 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     8858673395e91ae825f39c2390eb0935f753d3f3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 21:50:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 21:50:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=88586733

emergelog: remove unneeded seek for append mode

---
 pym/_emerge/emergelog.py |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index a195c6f..bc4d9d3 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -48,9 +48,6 @@ def emergelog(xterm_titles, mystr, short_msg=None):
 		mylock = None
 		try:
 			mylock = portage.locks.lockfile(mylogfile)
-			# seek because we may have gotten held up by the lock.
-			# if so, we may not be positioned at the end of the file.
-			mylogfile.seek(0, 2)
 			mylogfile.write(_unicode_decode(
 				str(time.time())[:10]+": "+mystr+"\n"))
 			mylogfile.flush()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-12 22:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-12 22:04 UTC (permalink / raw
  To: gentoo-commits

commit:     d8d1190a5dcf5301e7965c6d198b06ca0d5fc152
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 22:04:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 22:04:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d8d1190a

emergelog: use string format op for time.time()

---
 pym/_emerge/emergelog.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index bc4d9d3..d6ef1b4 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -20,15 +20,19 @@ from portage.output import xtermTitle
 _disable = True
 _emerge_log_dir = '/var/log'
 
+# Coerce to unicode, in order to prevent TypeError when writing
+# raw bytes to TextIOWrapper with python2.
+_log_fmt = _unicode_decode("%.0f: %s\n")
+
 def emergelog(xterm_titles, mystr, short_msg=None):
 
 	if _disable:
 		return
 
-	mystr = portage._unicode_decode(mystr)
+	mystr = _unicode_decode(mystr)
 
 	if short_msg is not None:
-		short_msg = portage._unicode_decode(short_msg)
+		short_msg = _unicode_decode(short_msg)
 
 	if xterm_titles and short_msg:
 		if "HOSTNAME" in os.environ:
@@ -48,8 +52,7 @@ def emergelog(xterm_titles, mystr, short_msg=None):
 		mylock = None
 		try:
 			mylock = portage.locks.lockfile(mylogfile)
-			mylogfile.write(_unicode_decode(
-				str(time.time())[:10]+": "+mystr+"\n"))
+			mylogfile.write(_log_fmt % (time.time(), mystr))
 			mylogfile.flush()
 		finally:
 			if mylock:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-16  6:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-16  6:16 UTC (permalink / raw
  To: gentoo-commits

commit:     f07f8386e945b48358c11c121960e4833c539752
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 06:16:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 06:16:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f07f8386

EbuildBuild: use fetch queue to cap fetch threads

This will fix bug #375331.

---
 pym/_emerge/EbuildBuild.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index a678ede..b6beb49 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -172,7 +172,11 @@ class EbuildBuild(CompositeTask):
 			logfile=self.settings.get('PORTAGE_LOG_FILE'),
 			pkg=self.pkg, scheduler=self.scheduler)
 
-		self._start_task(fetcher, self._fetch_exit)
+		# Allow the Scheduler's fetch queue to control the
+		# number of concurrent fetchers.
+		fetcher.addExitListener(self._fetch_exit)
+		self._task_queued(fetcher)
+		self.scheduler.fetch.schedule(fetcher)
 
 	def _fetch_exit(self, fetcher):
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-16  7:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-16  7:30 UTC (permalink / raw
  To: gentoo-commits

commit:     a3ebf8f370ed20bcf419395b786aae2daccb5074
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 07:30:05 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 07:30:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3ebf8f3

Scheduler: enable prefetch for first package

Since commit f07f8386e945b48358c11c121960e4833c539752, the first will
have to wait for later ones to fetch unless we start its prefetcher
first.

---
 pym/_emerge/Scheduler.py |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index ad276e9..135e37a 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -745,10 +745,7 @@ class Scheduler(PollScheduler):
 			prefetchers = self._prefetchers
 			getbinpkg = "--getbinpkg" in self.myopts
 
-			# In order to avoid "waiting for lock" messages
-			# at the beginning, which annoy users, never
-			# spawn a prefetcher for the first package.
-			for pkg in self._mergelist[1:]:
+			for pkg in self._mergelist:
 				# mergelist can contain solved Blocker instances
 				if not isinstance(pkg, Package) or pkg.operation == "uninstall":
 					continue



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-16 23:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-16 23:30 UTC (permalink / raw
  To: gentoo-commits

commit:     785fe0b42a66b1d137955a4b816b3c254a1b785d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 23:30:14 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 23:30:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=785fe0b4

EbuildBuild: skip the fetch queue when possible

Since commit f07f8386e945b48358c11c121960e4833c539752, it was possible
for EbuildBuild to wait on the fetch queue even in cases in which all
required files had been previously fetched. Now this case is optimized
to skip the fetch queue, as discribed in bug #375331, comment #2.

---
 pym/_emerge/EbuildBuild.py   |   25 ++++++++-
 pym/_emerge/EbuildFetcher.py |  120 ++++++++++++++++++++++++++++++++++++-----
 2 files changed, 129 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index b6beb49..1776d1e 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -166,12 +166,34 @@ class EbuildBuild(CompositeTask):
 		portage.prepare_build_dirs(self.pkg.root, self.settings, 1)
 
 		fetcher = EbuildFetcher(config_pool=self.config_pool,
+			ebuild_path=self._ebuild_path,
 			fetchall=self.opts.fetch_all_uri,
 			fetchonly=self.opts.fetchonly,
 			background=self.background,
 			logfile=self.settings.get('PORTAGE_LOG_FILE'),
 			pkg=self.pkg, scheduler=self.scheduler)
 
+		try:
+			already_fetched = fetcher.already_fetched(self.settings)
+		except portage.exception.InvalidDependString as e:
+			msg_lines = []
+			msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \
+				(self.pkg.cpv, e)
+			msg_lines.append(msg)
+			fetcher._eerror(msg_lines)
+			portage.elog.elog_process(self.pkg.cpv, self.settings)
+			self.returncode = 1
+			self._current_task = None
+			self._unlock_builddir()
+			self.wait()
+			return
+
+		if already_fetched:
+			# This case is optimized to skip the fetch queue.
+			fetcher = None
+			self._fetch_exit(fetcher)
+			return
+
 		# Allow the Scheduler's fetch queue to control the
 		# number of concurrent fetchers.
 		fetcher.addExitListener(self._fetch_exit)
@@ -180,7 +202,8 @@ class EbuildBuild(CompositeTask):
 
 	def _fetch_exit(self, fetcher):
 
-		if self._default_exit(fetcher) != os.EX_OK:
+		if fetcher is not None and \
+			self._default_exit(fetcher) != os.EX_OK:
 			self._fetch_failed()
 			return
 

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index c076288..0666787 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -14,24 +14,97 @@ from portage import _encodings
 from portage import _unicode_encode
 from portage import _unicode_decode
 from portage.elog.messages import eerror
-from portage.package.ebuild.fetch import fetch
+from portage.package.ebuild.fetch import _check_distfile, fetch
 from portage.util._pty import _create_pty_or_pipe
 
 class EbuildFetcher(SpawnProcess):
 
-	__slots__ = ("config_pool", "fetchonly", "fetchall", "pkg", "prefetch") + \
+	__slots__ = ("config_pool", "ebuild_path", "fetchonly", "fetchall",
+		"pkg", "prefetch") + \
 		("_digests", "_settings", "_uri_map")
 
+	def already_fetched(self, settings):
+		"""
+		Returns True if all files are already exist locally and have correct
+		digests, otherwise return False. When returning True, appropriate
+		digest checking messages are produced for display and/or logging.
+		When returning False, no messages are produced, since we assume
+		that a fetcher process will later be executed in order to produce
+		such messages. This will raise InvalidDependString if SRC_URI is
+		invalid.
+		"""
+
+		uri_map = self._get_uri_map()
+		if not uri_map:
+			return True
+
+		digests = self._get_digests()
+		distdir = settings["DISTDIR"]
+		allow_missing = "allow-missing-manifests" in settings.features
+
+		for filename in uri_map:
+			# Use stat rather than lstat since fetch() creates
+			# symlinks when PORTAGE_RO_DISTDIRS is used.
+			try:
+				st = os.stat(os.path.join(distdir, filename))
+			except OSError:
+				return False
+			if st.st_size == 0:
+				return False
+			expected_size = digests.get(filename, {}).get('size')
+			if expected_size is None:
+				continue
+			if st.st_size != expected_size:
+				return False
+
+		stdout_orig = sys.stdout
+		stderr_orig = sys.stderr
+		global_havecolor = portage.output.havecolor
+		out = io.StringIO()
+		eout = portage.output.EOutput()
+		eout.quiet = settings.get("PORTAGE_QUIET") == "1"
+		success = True
+		try:
+			sys.stdout = out
+			sys.stderr = out
+			if portage.output.havecolor:
+				portage.output.havecolor = not self.background
+
+			for filename in uri_map:
+				mydigests = digests.get(filename)
+				if mydigests is None:
+					if not allow_missing:
+						success = False
+						break
+					continue
+				ok, st = _check_distfile(os.path.join(distdir, filename),
+					mydigests, eout, show_errors=False)
+				if not ok:
+					success = False
+					break
+		finally:
+			sys.stdout = stdout_orig
+			sys.stderr = stderr_orig
+			portage.output.havecolor = global_havecolor
+
+		if success:
+			# When returning uncessessfully, no messages are produced, since
+			# we assume that a fetcher process will later be executed in order
+			# to produce such messages.
+			msg = out.getvalue()
+			if msg:
+				self.scheduler.output(msg, log_path=self.logfile)
+
+		return success
+
 	def _start(self):
 
 		root_config = self.pkg.root_config
 		portdb = root_config.trees["porttree"].dbapi
-		ebuild_path = portdb.findname(self.pkg.cpv, myrepo=self.pkg.repo)
-		if ebuild_path is None:
-			raise AssertionError("ebuild not found for '%s'" % self.pkg.cpv)
+		ebuild_path = self._get_ebuild_path()
 
 		try:
-			uri_map = self._get_uri_map(portdb, ebuild_path)
+			uri_map = self._get_uri_map()
 		except portage.exception.InvalidDependString as e:
 			msg_lines = []
 			msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \
@@ -48,9 +121,6 @@ class EbuildFetcher(SpawnProcess):
 			self.wait()
 			return
 
-		self._digests = portage.Manifest(
-			os.path.dirname(ebuild_path), None).getTypeDigests("DIST")
-
 		settings = self.config_pool.allocate()
 		settings.setcpv(self.pkg)
 		portage.doebuild_environment(ebuild_path, 'fetch',
@@ -75,7 +145,6 @@ class EbuildFetcher(SpawnProcess):
 			settings["NOCOLOR"] = nocolor
 
 		self._settings = settings
-		self._uri_map = uri_map
 		SpawnProcess._start(self)
 
 		# Free settings now since it's no longer needed in
@@ -110,7 +179,7 @@ class EbuildFetcher(SpawnProcess):
 		allow_missing = 'allow-missing-manifests' in self._settings.features
 		try:
 			if fetch(self._uri_map, self._settings, fetchonly=self.fetchonly,
-				digests=copy.deepcopy(self._digests),
+				digests=copy.deepcopy(self._get_digests()),
 				allow_missing_digests=allow_missing):
 				rval = os.EX_OK
 		except SystemExit:
@@ -122,16 +191,37 @@ class EbuildFetcher(SpawnProcess):
 			# finally blocks from earlier in the call stack. See bug #345289.
 			os._exit(rval)
 
-	def _get_uri_map(self, portdb, ebuild_path):
+	def _get_ebuild_path(self):
+		if self.ebuild_path is not None:
+			return self.ebuild_path
+		portdb = self.pkg.root_config.trees["porttree"].dbapi
+		self.ebuild_path = portdb.findname(self.pkg.cpv, myrepo=self.pkg.repo)
+		if self.ebuild_path is None:
+			raise AssertionError("ebuild not found for '%s'" % self.pkg.cpv)
+		return self.ebuild_path
+
+	def _get_digests(self):
+		if self._digests is not None:
+			return self._digests
+		self._digests = portage.Manifest(os.path.dirname(
+			self._get_ebuild_path()), None).getTypeDigests("DIST")
+		return self._digests
+
+	def _get_uri_map(self):
 		"""
 		This can raise InvalidDependString from portdbapi.getFetchMap().
 		"""
-		pkgdir = os.path.dirname(ebuild_path)
+		if self._uri_map is not None:
+			return self._uri_map
+		pkgdir = os.path.dirname(self._get_ebuild_path())
 		mytree = os.path.dirname(os.path.dirname(pkgdir))
 		use = None
 		if not self.fetchall:
 			use = self.pkg.use.enabled
-		return portdb.getFetchMap(self.pkg.cpv, useflags=use, mytree=mytree)
+		portdb = self.pkg.root_config.trees["porttree"].dbapi
+		self._uri_map = portdb.getFetchMap(self.pkg.cpv,
+			useflags=use, mytree=mytree)
+		return self._uri_map
 
 	def _prefetch_size_ok(self, uri_map, settings, ebuild_path):
 		distdir = settings["DISTDIR"]
@@ -148,7 +238,7 @@ class EbuildFetcher(SpawnProcess):
 				return False
 			sizes[filename] = st.st_size
 
-		digests = self._digests
+		digests = self._get_digests()
 		for filename, actual_size in sizes.items():
 			size = digests.get(filename, {}).get('size')
 			if size is None:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-17  0:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-17  0:05 UTC (permalink / raw
  To: gentoo-commits

commit:     25d00e7bc361a659a729d5165fe580afcbd39664
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 00:04:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 00:04:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25d00e7b

Binpkg: use fetch queue to cap fetch threads

This is analogous to commit f07f8386e945b48358c11c121960e4833c539752
for bug #375331, but for fetching from binhosts.

---
 pym/_emerge/Binpkg.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index b833419..bc6511e 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -126,7 +126,12 @@ class Binpkg(CompositeTask):
 			short_msg = "emerge: (%s of %s) %s Fetch" % \
 				(pkg_count.curval, pkg_count.maxval, pkg.cpv)
 			self.logger.log(msg, short_msg=short_msg)
-			self._start_task(fetcher, self._fetcher_exit)
+
+			# Allow the Scheduler's fetch queue to control the
+			# number of concurrent fetchers.
+			fetcher.addExitListener(self._fetcher_exit)
+			self._task_queued(fetcher)
+			self.scheduler.fetch.schedule(fetcher)
 			return
 
 		self._fetcher_exit(fetcher)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-17  0:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-17  0:10 UTC (permalink / raw
  To: gentoo-commits

commit:     8a3ac45d0d746b18ce6173a647518b4ddb617888
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 00:10:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 00:10:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8a3ac45d

Fix a typo in a comment.

---
 pym/_emerge/EbuildFetcher.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 0666787..403bb45 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -88,7 +88,7 @@ class EbuildFetcher(SpawnProcess):
 			portage.output.havecolor = global_havecolor
 
 		if success:
-			# When returning uncessessfully, no messages are produced, since
+			# When returning unsuccessfully, no messages are produced, since
 			# we assume that a fetcher process will later be executed in order
 			# to produce such messages.
 			msg = out.getvalue()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-17  0:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-17  0:33 UTC (permalink / raw
  To: gentoo-commits

commit:     5fd5fb57019bdf7ece0a0156e3feb4bda3da35a5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 00:32:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 00:32:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5fd5fb57

EbuildFetcher: handle FileNotFound

---
 pym/_emerge/EbuildFetcher.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 403bb45..32d1ccf 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -82,6 +82,9 @@ class EbuildFetcher(SpawnProcess):
 				if not ok:
 					success = False
 					break
+		except portage.exception.FileNotFound:
+			# A file disappeared unexpectedly.
+			return False
 		finally:
 			sys.stdout = stdout_orig
 			sys.stderr = stderr_orig



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-17  4:38 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-07-17  4:38 UTC (permalink / raw
  To: gentoo-commits

commit:     1040aaeaf2023717d99f40377583ca7453f60d33
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jul 17 04:35:26 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 04:35:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1040aaea

Fix a typo in a doc string.

---
 pym/_emerge/EbuildFetcher.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 32d1ccf..feb68d0 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -25,7 +25,7 @@ class EbuildFetcher(SpawnProcess):
 
 	def already_fetched(self, settings):
 		"""
-		Returns True if all files are already exist locally and have correct
+		Returns True if all files already exist locally and have correct
 		digests, otherwise return False. When returning True, appropriate
 		digest checking messages are produced for display and/or logging.
 		When returning False, no messages are produced, since we assume



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-17 18:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-17 18:16 UTC (permalink / raw
  To: gentoo-commits

commit:     ef58bc7573ddce5e3a5466eea50160b81de8edf4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 18:16:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 18:16:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ef58bc75

Scheduler: allow concurrent fetch with --jobs > 1

This reverts behavior from bug #375331 (commit
f07f8386e945b48358c11c121960e4833c539752) for cases in which --jobs is
greater than 1. We can add a separate --fetch-jobs option later, but
for now, this preserves previous behavior for --jobs > 1.

---
 pym/_emerge/Scheduler.py |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 135e37a..2574d3d 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -552,10 +552,19 @@ class Scheduler(PollScheduler):
 
 	def _schedule_fetch(self, fetcher):
 		"""
-		Schedule a fetcher on the fetch queue, in order to
-		serialize access to the fetch log.
+		Schedule a fetcher, in order to control the number of concurrent
+		fetchers. If self._max_jobs is greater than 1 then the fetch
+		queue is bypassed and the fetcher is started immediately,
+		otherwise it is added to the front of the parallel-fetch queue.
+		NOTE: The parallel-fetch queue is currently used to serialize
+		access to the parallel-fetch log, so changes in the log handling
+		would be required before it would be possible to enable
+		concurrent fetching within the parallel-fetch queue.
 		"""
-		self._task_queues.fetch.addFront(fetcher)
+		if self._max_jobs > 1:
+			fetcher.start()
+		else:
+			self._task_queues.fetch.addFront(fetcher)
 
 	def _schedule_setup(self, setup_phase):
 		"""



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-18  8:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-18  8:25 UTC (permalink / raw
  To: gentoo-commits

commit:     092803df76a6112279b06f05f75a95b3285a97ea
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 18 08:21:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 18 08:21:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=092803df

Scheduler: simplify _terminate_tasks

This should also fix bugs related to CompositeTask instances waiting
for queued tasks to start and not being properly terminated in this
case.

---
 pym/_emerge/Scheduler.py |   27 ++++++++-------------------
 1 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 2574d3d..1b3a034 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -229,7 +229,7 @@ class Scheduler(PollScheduler):
 
 		self._prefetchers = weakref.WeakValueDictionary()
 		self._pkg_queue = []
-		self._running_tasks = set()
+		self._running_tasks = {}
 		self._completed_tasks = set()
 
 		self._failed_pkgs = []
@@ -291,20 +291,9 @@ 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)
-		if self._merge_wait_queue:
-			for merge in self._merge_wait_queue:
-				self._running_tasks.remove(merge.merge.pkg)
-			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.
-			if isinstance(merge, PackageMerge):
-				self._running_tasks.remove(merge.merge.pkg)
+		while self._running_tasks:
+			task_id, task = self._running_tasks.popitem()
+			task.cancel()
 		for q in self._task_queues.values():
 			q.clear()
 
@@ -1311,6 +1300,7 @@ class Scheduler(PollScheduler):
 		self._merge_exit(task)
 
 	def _merge_exit(self, merge):
+		self._running_tasks.pop(id(merge), None)
 		self._do_merge_exit(merge)
 		self._deallocate_config(merge.merge.settings)
 		if merge.returncode == os.EX_OK and \
@@ -1321,7 +1311,6 @@ class Scheduler(PollScheduler):
 
 	def _do_merge_exit(self, merge):
 		pkg = merge.merge.pkg
-		self._running_tasks.remove(pkg)
 		if merge.returncode != os.EX_OK:
 			settings = merge.merge.settings
 			build_dir = settings.get("PORTAGE_BUILDDIR")
@@ -1366,15 +1355,16 @@ class Scheduler(PollScheduler):
 		mtimedb.commit()
 
 	def _build_exit(self, build):
+		self._running_tasks.pop(id(build), None)
 		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
-			self._running_tasks.remove(build.pkg)
 			self._deallocate_config(build.settings)
 		elif build.returncode == os.EX_OK:
 			self.curval += 1
 			merge = PackageMerge(merge=build)
+			self._running_tasks[id(merge)] = merge
 			if not build.build_opts.buildpkgonly and \
 				build.pkg in self._deep_system_deps:
 				# Since dependencies on system packages are frequently
@@ -1386,7 +1376,6 @@ class Scheduler(PollScheduler):
 				self._task_queues.merge.add(merge)
 				self._status_display.merges = len(self._task_queues.merge)
 		else:
-			self._running_tasks.remove(build.pkg)
 			settings = build.settings
 			build_dir = settings.get("PORTAGE_BUILDDIR")
 			build_log = settings.get("PORTAGE_LOG_FILE")
@@ -1672,7 +1661,7 @@ class Scheduler(PollScheduler):
 				self._pkg_count.curval += 1
 
 			task = self._task(pkg)
-			self._running_tasks.add(pkg)
+			self._running_tasks[id(task)] = task
 
 			if pkg.installed:
 				merge = PackageMerge(merge=task)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-19 19:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-19 19:53 UTC (permalink / raw
  To: gentoo-commits

commit:     6eb229c4148bbbb391f0e7df07bbab8af81cb544
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 19 19:52:29 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 19 19:52:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6eb229c4

EbuildBuild: pass ebuild_path to EbuildFetcher

This avoids a redundant pordbapi.findname() call.

---
 pym/_emerge/EbuildBuild.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 1776d1e..0144cfc 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -123,6 +123,7 @@ class EbuildBuild(CompositeTask):
 			else:
 				fetcher = EbuildFetcher(
 					config_pool=self.config_pool,
+					ebuild_path=self._ebuild_path,
 					fetchall=self.opts.fetch_all_uri,
 					fetchonly=self.opts.fetchonly,
 					background=False,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-19 20:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-19 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     252e2e1dd5b4ffe70bb1700c3f94da05fc30d2e3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 19 20:23:35 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 19 20:23:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=252e2e1d

Scheduler: fix _running_tasks for uninstalls

---
 pym/_emerge/Scheduler.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 1b3a034..d13e622 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1661,10 +1661,10 @@ class Scheduler(PollScheduler):
 				self._pkg_count.curval += 1
 
 			task = self._task(pkg)
-			self._running_tasks[id(task)] = task
 
 			if pkg.installed:
 				merge = PackageMerge(merge=task)
+				self._running_tasks[id(merge)] = merge
 				merge.addExitListener(self._merge_exit)
 				self._task_queues.merge.addFront(merge)
 
@@ -1672,6 +1672,7 @@ class Scheduler(PollScheduler):
 				self._jobs += 1
 				self._previous_job_start_time = time.time()
 				self._status_display.running = self._jobs
+				self._running_tasks[id(task)] = task
 				task.addExitListener(self._extract_exit)
 				self._task_queues.jobs.add(task)
 
@@ -1679,6 +1680,7 @@ class Scheduler(PollScheduler):
 				self._jobs += 1
 				self._previous_job_start_time = time.time()
 				self._status_display.running = self._jobs
+				self._running_tasks[id(task)] = task
 				task.addExitListener(self._build_exit)
 				self._task_queues.jobs.add(task)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-21 16:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-21 16:59 UTC (permalink / raw
  To: gentoo-commits

commit:     1fbff8957c6de3654f7901e2ed4a075b972d06dc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 16:56:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 16:56:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1fbff895

BinpkgFetcher: support selinux PORTAGE_FETCH_T

Thanks to Sven Vermeulen <sven.vermeulen <AT> siphos.be> for the initial
patch posted on bug #375835.

---
 pym/_emerge/BinpkgFetcher.py |    2 ++
 pym/_emerge/SpawnProcess.py  |   14 ++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 6c1dde9..baea4d6 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -100,6 +100,8 @@ class BinpkgFetcher(SpawnProcess):
 
 		self.args = fetch_args
 		self.env = fetch_env
+		if settings.selinux_enabled():
+			self._selinux_type = settings["PORTAGE_FETCH_T"]
 		SpawnProcess._start(self)
 
 	def _pipe(self, fd_pipes):

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index bc861e9..b72971c 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -8,6 +8,7 @@ import portage
 from portage import _encodings
 from portage import _unicode_encode
 from portage import os
+from portage.const import BASH_BINARY
 import fcntl
 import errno
 import gzip
@@ -25,7 +26,7 @@ class SpawnProcess(SubProcess):
 		"path_lookup", "pre_exec")
 
 	__slots__ = ("args",) + \
-		_spawn_kwarg_names
+		_spawn_kwarg_names + ("_selinux_type",)
 
 	_file_names = ("log", "process", "stdout")
 	_files_dict = slot_dict_class(_file_names, prefix="")
@@ -146,7 +147,16 @@ class SpawnProcess(SubProcess):
 		return os.pipe()
 
 	def _spawn(self, args, **kwargs):
-		return portage.process.spawn(args, **kwargs)
+		spawn_func = portage.process.spawn
+
+		if self._selinux_type is not None:
+			spawn_func = portage.selinux.spawn_wrapper(spawn_func,
+				self._selinux_type)
+			# bash is an allowed entrypoint, while most binaries are not
+			if args[0] != BASH_BINARY:
+				args = [BASH_BINARY, "-c", "exec \"$@\"", args[0]] + args
+
+		return spawn_func(args, **kwargs)
 
 	def _output_handler(self, fd, event):
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-07-25 20:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-07-25 20:55 UTC (permalink / raw
  To: gentoo-commits

commit:     3b5dede734e19aeedca11327e1e2b8443ec55f81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 25 20:54:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 25 20:54:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3b5dede7

depgraph: make --exclude handle contradictions

This makes contradictory things like `emerge -e @system --exclude gcc`
work as expected.

---
 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 9e3064d..70f9a99 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2289,7 +2289,10 @@ class depgraph(object):
 							# specified on the command line.
 							self._dynamic_config._pprovided_args.append((arg, atom))
 							continue
-					if pkg.installed and "selective" not in self._dynamic_config.myparams:
+					if pkg.installed and \
+						"selective" not in self._dynamic_config.myparams and \
+						not self._frozen_config.excluded_pkgs.findAtomForPackage(
+						pkg, modified_use=self._pkg_use_enabled(pkg)):
 						self._dynamic_config._unsatisfied_deps_for_display.append(
 							((myroot, atom), {"myparent" : arg}))
 						# Previous behavior was to bail out in this case, but
@@ -3331,6 +3334,9 @@ class depgraph(object):
 		"""
 		if "selective" not in self._dynamic_config.myparams and \
 			pkg.root == self._frozen_config.target_root:
+			if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
+				modified_use=self._pkg_use_enabled(pkg)):
+				return True
 			try:
 				next(self._iter_atoms_for_pkg(pkg))
 			except StopIteration:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-01 11:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-01 11:21 UTC (permalink / raw
  To: gentoo-commits

commit:     e7927bf7b80ac5b2b8cf53a9b6d300f47074a500
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 11:18:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  1 11:18:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e7927bf7

post_emerge: just return instead of sys.exit()

---
 pym/_emerge/main.py |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 28431c5..2830214 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -308,7 +308,6 @@ def post_emerge(myaction, myopts, myfiles,
 	Update News Items
 	Commit mtimeDB
 	Display preserved libs warnings
-	Exit Emerge
 
 	@param myaction: The action returned from parse_opts()
 	@type myaction: String
@@ -324,9 +323,6 @@ def post_emerge(myaction, myopts, myfiles,
 	@type mtimedb: MtimeDB class instance
 	@param retval: Emerge's return value
 	@type retval: Int
-	@rype: None
-	@returns:
-	1.  Calls sys.exit(retval)
 	"""
 
 	root_config = trees[target_root]["root_config"]
@@ -357,7 +353,7 @@ def post_emerge(myaction, myopts, myfiles,
 	if not vardbapi._pkgs_changed:
 		display_news_notification(root_config, myopts)
 		# If vdb state has not changed then there's nothing else to do.
-		sys.exit(retval)
+		return
 
 	vdb_path = os.path.join(root_config.settings['EROOT'], portage.VDB_PATH)
 	portage.util.ensure_dirs(vdb_path)
@@ -396,8 +392,6 @@ def post_emerge(myaction, myopts, myfiles,
 		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 " + \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-01 22:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-01 22:57 UTC (permalink / raw
  To: gentoo-commits

commit:     c72376156311ffa96a5d130bd8b0a207b3fc9ceb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 22:57:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  1 22:57:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c7237615

depgraph: fix duplicate zero pkg count display

---
 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 70f9a99..5b48aca 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5555,7 +5555,7 @@ class depgraph(object):
 
 	def _show_merge_list(self):
 		if self._dynamic_config._serialized_tasks_cache is not None and \
-			not (self._dynamic_config._displayed_list and \
+			not (self._dynamic_config._displayed_list is not None and \
 			(self._dynamic_config._displayed_list == self._dynamic_config._serialized_tasks_cache or \
 			self._dynamic_config._displayed_list == \
 				list(reversed(self._dynamic_config._serialized_tasks_cache)))):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-03  5:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-03  5:11 UTC (permalink / raw
  To: gentoo-commits

commit:     56099907f2fb5bbf8319baa961f97c9356995c09
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  3 05:10:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug  3 05:10:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=56099907

Scheduler: fix parallel-fetch order with --jobs=1

This avoids a case where the first prefetcher is discarded, causing
the second prefetcher to occupy the fetch queue before the first
fetcher has an opportunity to execute.

---
 pym/_emerge/Scheduler.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d13e622..6412d82 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -752,6 +752,13 @@ class Scheduler(PollScheduler):
 					self._task_queues.fetch.add(prefetcher)
 					prefetchers[pkg] = prefetcher
 
+			# Start the first prefetcher immediately so that self._task()
+			# won't discard it. This avoids a case where the first
+			# prefetcher is discarded, causing the second prefetcher to
+			# occupy the fetch queue before the first fetcher has an
+			# opportunity to execute.
+			self._task_queues.fetch.schedule()
+
 	def _create_prefetcher(self, pkg):
 		"""
 		@return: a prefetcher, or None if not applicable



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-09  6:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-09  6:03 UTC (permalink / raw
  To: gentoo-commits

commit:     596258fb36afbf6996e182c18aa35dc8803d07cd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  9 05:58:54 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug  9 05:58:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=596258fb

Package: remove unused profile.system mask type

---
 pym/_emerge/Package.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 0790946..9f1be12 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -271,7 +271,6 @@ class Package(Task):
 				return False
 
 			if 'package.mask' in masks or \
-				'profile.system' in masks or \
 				'LICENSE' in masks:
 				return False
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-11  3:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-11  3:27 UTC (permalink / raw
  To: gentoo-commits

commit:     72137f634878c4b0ef54287dd4a33fa2240a68f7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 11 03:27:45 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 11 03:27:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72137f63

resume_depgraph: prune all indirect unsatisfied

This should fix some cases of bug 378187.

---
 pym/_emerge/depgraph.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5b48aca..8b6125d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6869,12 +6869,12 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 					if not isinstance(parent_node, Package) \
 						or parent_node.operation not in ("merge", "nomerge"):
 						continue
-					unsatisfied = \
-						graph.child_nodes(parent_node,
-						ignore_priority=DepPrioritySatisfiedRange.ignore_soft)
-					if pkg in unsatisfied:
-						unsatisfied_parents[parent_node] = parent_node
-						unsatisfied_stack.append(parent_node)
+					# We need to traverse all priorities here, in order to
+					# ensure that a package with an unsatisfied depenedency
+					# won't get pulled in, even indirectly via a soft
+					# dependency.
+					unsatisfied_parents[parent_node] = parent_node
+					unsatisfied_stack.append(parent_node)
 
 			unsatisfied_tuples = frozenset(tuple(parent_node)
 				for parent_node in unsatisfied_parents



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-14 23:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-14 23:50 UTC (permalink / raw
  To: gentoo-commits

commit:     0c8d952b89afe44ff561b278188d5a22d91e9529
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 14 23:49:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug 14 23:49:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c8d952b

emerge --search: account for USE in fetch size

---
 pym/_emerge/search.py |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 35f0412..096b384 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.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
@@ -6,6 +6,8 @@ from __future__ import print_function
 import re
 import portage
 from portage import os
+from portage.dbapi.porttree import _parse_uri_map
+from portage.manifest import Manifest
 from portage.output import  bold, bold as white, darkgreen, green, red
 from portage.util import writemsg_stdout
 
@@ -261,11 +263,13 @@ class search(object):
 		msg.append("[ Applications found : " + \
 			bold(str(self.mlen)) + " ]\n\n")
 		vardb = self.vartree.dbapi
+		metadata_keys = set(Package.metadata_keys)
+		metadata_keys.update(["DESCRIPTION", "HOMEPAGE", "LICENSE", "SRC_URI"])
+		metadata_keys = tuple(metadata_keys)
 		for mtype in self.matches:
 			for match,masked in self.matches[mtype]:
 				full_package = None
 				if mtype == "pkg":
-					catpack = match
 					full_package = self._xmatch(
 						"bestmatch-visible", match)
 					if not full_package:
@@ -285,11 +289,16 @@ class search(object):
 							+ "\n\n")
 				if full_package:
 					try:
-						desc, homepage, license = self._aux_get(
-							full_package, ["DESCRIPTION","HOMEPAGE","LICENSE"])
+						metadata = dict(zip(metadata_keys,
+							self._aux_get(full_package, metadata_keys)))
 					except KeyError:
 						msg.append("emerge: search: aux_get() failed, skipping\n")
 						continue
+
+					desc = metadata["DESCRIPTION"]
+					homepage = metadata["HOMEPAGE"]
+					license = metadata["LICENSE"]
+
 					if masked:
 						msg.append(green("*") + "  " + \
 							white(match) + " " + red("[ Masked ]") + "\n")
@@ -304,12 +313,15 @@ class search(object):
 					mycpv = match + "-" + myversion
 					myebuild = self._findname(mycpv)
 					if myebuild:
+						pkg = Package(built=False, cpv=mycpv,
+							installed=False, metadata=metadata,
+							root_config=self.root_config, type_name="ebuild")
 						pkgdir = os.path.dirname(myebuild)
-						from portage import manifest
-						mf = manifest.Manifest(
+						mf = Manifest(
 							pkgdir, self.settings["DISTDIR"])
 						try:
-							uri_map = self._getFetchMap(mycpv)
+							uri_map = _parse_uri_map(mycpv, metadata,
+								use=pkg.use.enabled)
 						except portage.exception.InvalidDependString as e:
 							file_size_str = "Unknown (%s)" % (e,)
 							del e



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-16  5:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-16  5:38 UTC (permalink / raw
  To: gentoo-commits

commit:     415458868f42c677a1a6518c1e8d52b6597c751c
Author:     Mark Wagner <carnildo <AT> gmail <DOT> com>
AuthorDate: Tue Aug 16 05:38:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 16 05:38:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=41545886

Improve the invalid profile msg (bug 379327).

---
 pym/_emerge/main.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 2830214..84c4c58 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1466,10 +1466,10 @@ def profile_check(trees, myaction):
 			continue
 		# generate some profile related warning messages
 		validate_ebuild_environment(trees)
-		msg = "If you have just changed your profile configuration, you " + \
-			"should revert back to the previous configuration. Due to " + \
-			"your current profile being invalid, allowed actions are " + \
-			"limited to --help, --info, --sync, and --version."
+		msg = ("Your current profile is invalid. If you have just changed "
+			"your profile configuration, you should revert back to the "
+			"previous configuration. Allowed actions are limited to "
+			"--help, --info, --sync, and --version.")
 		writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
 			level=logging.ERROR, noiselevel=-1)
 		return 1



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-25 22:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-25 22:11 UTC (permalink / raw
  To: gentoo-commits

commit:     a509ffd891642b3353a6160ba04057272b48dc2c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 25 22:10:52 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 25 22:10:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a509ffd8

python3.2 fixes: ResourceWarning: unclosed file

---
 pym/_emerge/AsynchronousLock.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 637ba73..be498b8 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -209,9 +209,22 @@ class _LockProcess(AbstractPollTask):
 		os.close(in_pw)
 
 	def _proc_exit(self, proc):
+
+		if self._files is not None:
+			# Close pipe_out if it's still open, since it's useless
+			# after the process has exited. This helps to avoid
+			# "ResourceWarning: unclosed file" since Python 3.2.
+			try:
+				pipe_out = self._files.pop('pipe_out')
+			except KeyError:
+				pass
+			else:
+				pipe_out.close()
+
 		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



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-27 20:17 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-08-27 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     839327edd3653a83b454293c45616de32c944b01
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sat Aug 27 20:16:14 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sat Aug 27 20:16:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=839327ed

Fix "ResourceWarning: unclosed file" with Python 3.2.

---
 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 6115f21..a6dd98c 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -277,7 +277,7 @@ class Scheduler(PollScheduler):
 		if self._parallel_fetch:
 				# clear out existing fetch log if it exists
 				try:
-					open(self._fetch_log, 'w')
+					open(self._fetch_log, 'w').close()
 				except EnvironmentError:
 					pass
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-29  6:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-29  6:49 UTC (permalink / raw
  To: gentoo-commits

commit:     7e0ac7d2c92f3556623e4ff34bebffd80fe5f23a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 06:49:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 06:49:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7e0ac7d2

Send "Recording in world" msg to stdout.

---
 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 42cc659..e1c39bc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6194,7 +6194,8 @@ class depgraph(object):
 		all_added.extend(added_favorites)
 		all_added.sort()
 		for a in all_added:
-			writemsg(">>> Recording %s in \"world\" favorites file...\n" % \
+			writemsg_stdout(
+				">>> Recording %s in \"world\" favorites file...\n" % \
 				colorize("INFORM", str(a)), noiselevel=-1)
 		if all_added:
 			world_set.update(all_added)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-08-31  2:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-08-31  2:32 UTC (permalink / raw
  To: gentoo-commits

commit:     c47394cb28a841d5b7399f548c2507a85a158bdd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 31 02:31:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 31 02:31:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c47394cb

Respect package.env buildpkg FEATURES settings.

This will fix bug #318897.

---
 pym/_emerge/EbuildBuild.py |    2 +-
 pym/_emerge/actions.py     |    3 +++
 pym/_emerge/main.py        |    8 +++++---
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 0144cfc..2b0f412 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -225,7 +225,7 @@ class EbuildBuild(CompositeTask):
 				system_set.findAtomForPackage(pkg) and \
 				not opts.buildpkg
 
-		if opts.buildpkg or self._issyspkg:
+		if opts.buildpkg or "buildpkg" in features or self._issyspkg:
 
 			self._buildpkg = True
 

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 882a2db..3477c19 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2731,6 +2731,9 @@ def adjust_config(myopts, settings):
 	settings["EMERGE_WARNING_DELAY"] = str(EMERGE_WARNING_DELAY)
 	settings.backup_changes("EMERGE_WARNING_DELAY")
 
+	if "--buildpkg" in myopts:
+		settings.features.add("buildpkg")
+
 	if "--quiet" in myopts or "--quiet-build" in myopts:
 		settings["PORTAGE_QUIET"]="1"
 		settings.backup_changes("PORTAGE_QUIET")

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 84c4c58..343fd58 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1545,6 +1545,11 @@ def emerge_main(args=None):
 		settings, trees, mtimedb = load_emerge_config(trees=trees)
 		portdb = trees[settings["ROOT"]]["porttree"].dbapi
 
+	# NOTE: adjust_configs() can map options to FEATURES, so any relevant
+	# options adjustments should be made prior to calling adjust_configs().
+	if "--buildpkgonly" in myopts:
+		myopts["--buildpkg"] = True
+
 	adjust_configs(myopts, trees)
 	apply_priorities(settings)
 
@@ -1587,9 +1592,6 @@ def emerge_main(args=None):
 	if "--usepkgonly" in myopts:
 		myopts["--usepkg"] = True
 
-	if "buildpkg" in settings.features or "--buildpkgonly" in myopts:
-		myopts["--buildpkg"] = True
-
 	if "--buildpkgonly" in myopts:
 		# --buildpkgonly will not merge anything, so
 		# it cancels all binary package options.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-02  0:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-02  0:24 UTC (permalink / raw
  To: gentoo-commits

commit:     9bcba040300459fab19778925727ccfc72f55e3d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  2 00:24:03 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep  2 00:24:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9bcba040

Show merge list before "missed update" messages.

---
 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 e1c39bc..de7bd4a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -585,6 +585,7 @@ class depgraph(object):
 		if not missed_updates:
 			return
 
+		self._show_merge_list()
 		backtrack_masked = []
 
 		for pkg, parent_atoms in missed_updates:
@@ -627,6 +628,7 @@ class depgraph(object):
 		if not missed_updates:
 			return
 
+		self._show_merge_list()
 		msg = []
 		msg.append("\nWARNING: One or more updates have been " + \
 			"skipped due to a dependency conflict:\n\n")



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-03 23:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-03 23:33 UTC (permalink / raw
  To: gentoo-commits

commit:     fe01dc23324660ae18c732cfacd458c3faf50ad7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  3 23:32:50 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep  3 23:32:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe01dc23

Join /var/log/emerge.log with EPREFIX.

---
 pym/_emerge/main.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index b3e047c..b6b63e2 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1786,7 +1786,11 @@ def emerge_main(args=None):
 		if x in myopts:
 			disable_emergelog = True
 			break
-	if myaction in ("search", "info"):
+	if disable_emergelog:
+		pass
+	elif myaction in ("search", "info"):
+		disable_emergelog = True
+	elif portage.data.secpass < 1:
 		disable_emergelog = True
 
 	_emerge.emergelog._disable = disable_emergelog
@@ -1801,8 +1805,13 @@ def emerge_main(args=None):
 					"EMERGE_LOG_DIR='%s':\n!!! %s\n" % \
 					(settings['EMERGE_LOG_DIR'], e),
 					noiselevel=-1, level=logging.ERROR)
+				portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
 			else:
 				_emerge.emergelog._emerge_log_dir = settings["EMERGE_LOG_DIR"]
+		else:
+			_emerge.emergelog._emerge_log_dir = os.path.join(os.sep,
+				settings["EPREFIX"].lstrip(os.sep), "var", "log")
+			portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
 
 	if not "--pretend" in myopts:
 		emergelog(xterm_titles, "Started emerge on: "+\



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-05  0:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-05  0:59 UTC (permalink / raw
  To: gentoo-commits

commit:     8539b5778f1cea24aab4ff47b1b65516c254de1f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  5 00:58:44 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  5 00:58:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8539b577

Update unread news items in --pretend mode.

This has been disabled since commit
c7faa634369e61b87a40172ceb0a5cb9494fd518, but the only reason cited
was to avoid permissions issues. So, go ahead and enable it, and handle
PermissionDenied just in case. NOTE: The NewsManager typically handles
permission errors by returning silently, so PermissionDenied won't
necessarily be raised even if we do trigger a permission error.

---
 pym/_emerge/actions.py |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 3477c19..82adca7 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -30,7 +30,7 @@ from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.dep import Atom, extended_cp_match
-from portage.exception import InvalidAtom
+from portage.exception import InvalidAtom, PermissionDenied
 from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
 	red, yellow
 good = create_color_func("GOOD")
@@ -3049,13 +3049,26 @@ def display_news_notification(root_config, myopts):
 	NEWS_PATH = os.path.join("metadata", "news")
 	UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news")
 	newsReaderDisplay = False
-	update = "--pretend" not in myopts
 	if "news" not in settings.features:
 		return
 
+	permission_msgs = set()
 	for repo in portdb.getRepositories():
-		unreadItems = checkUpdatedNewsItems(
-			portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=update)
+		try:
+			unreadItems = checkUpdatedNewsItems(
+				portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=True)
+		except PermissionDenied as e:
+			# NOTE: The NewsManager typically handles permission errors by
+			# returning silently, so PermissionDenied won't necessarily be
+			# raised even if we do trigger a permission error above.
+			msg = _unicode_decode("Permission denied: '%s'\n") % (e,)
+			if msg in permission_msgs:
+				pass
+			else:
+				permission_msgs.add(msg)
+				writemsg_level(msg, level=logging.ERROR, noiselevel=-1)
+			unreadItems = None
+
 		if unreadItems:
 			if not newsReaderDisplay:
 				newsReaderDisplay = True



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-09 19:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-09 19:58 UTC (permalink / raw
  To: gentoo-commits

commit:     21330075f07248765016e104b3ba8216903f1ecb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  9 19:58:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep  9 19:58:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=21330075

depgraph: pull in new virtual slots with --update

Previously, the virtual cost minimization code from bug #141118 would
prevent virtual dependencies from pulling in new slots. That behavior
was not desired for --update, so now it's fixed to pull in the latest
slot available. This allows virtual/jdk-1.7.0 to be pulled in by
dependencies when --update is enabled.

---
 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 de7bd4a..d6728c1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6567,8 +6567,14 @@ class _dep_check_composite_db(dbapi):
 					continue
 				self._cpv_pkg_map[pkg.cpv] = pkg
 				ret.append(pkg.cpv)
-			if ret:
+
+			if len(ret) > 1:
 				self._cpv_sort_ascending(ret)
+				if "--update" in self._depgraph._frozen_config.myopts:
+					# With --update, we want to force selection of
+					# the highest available version.
+					ret = [ret[-1]]
+
 		self._match_cache[atom] = ret
 		return ret[:]
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-10  3:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-10  3:22 UTC (permalink / raw
  To: gentoo-commits

commit:     08079b0683c0c5e9d02aaa8508cae27206e1a46e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 03:22:29 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 03:22:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=08079b06

depgraph: use _iter_match_pkgs_any where possible

---
 pym/_emerge/depgraph.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d6728c1..928f8dc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6546,12 +6546,11 @@ class _dep_check_composite_db(dbapi):
 				# example, if virtual/jdk-1.4 is satisfied via kaffe then
 				# there's no need to pull in a newer slot to satisfy a
 				# virtual/jdk dependency.
-				for db, pkg_type, built, installed, db_keys in \
-					self._depgraph._dynamic_config._filtered_trees[self._root]["dbs"]:
-					for cpv in db.match(atom):
-						if portage.cpv_getkey(cpv) != pkg.cp:
-							continue
-						slots.add(db.aux_get(cpv, ["SLOT"])[0])
+				for virt_pkg in self._depgraph._iter_match_pkgs_any(
+					self._depgraph._frozen_config.roots[self._root], atom):
+					if virt_pkg.cp != pkg.cp:
+						continue
+					slots.add(virt_pkg.slot)
 			ret = []
 			if self._visible(pkg):
 				self._cpv_pkg_map[pkg.cpv] = pkg



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-10 14:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-10 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     569bbe4747eceb70b3225101ec9c538b1db475aa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 14:31:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 14:31:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=569bbe47

depgraph: use Atom.with_slot() to match virtuals

This ensures that USE deps and repo deps are preserved here.

---
 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 928f8dc..3cb85dc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6557,7 +6557,7 @@ class _dep_check_composite_db(dbapi):
 				ret.append(pkg.cpv)
 			slots.remove(pkg.metadata["SLOT"])
 			while slots:
-				slot_atom = Atom("%s:%s" % (atom.cp, slots.pop()))
+				slot_atom = atom.with_slot(slots.pop())
 				pkg, existing = self._depgraph._select_package(
 					self._root, slot_atom)
 				if not pkg:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-10 21:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-10 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     d3789b062ba0214c77823345d582875232b27be9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 21:50:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 21:50:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3789b06

depgraph: refactor virtual slot --update code

This re-implements the change from commit
21330075f07248765016e104b3ba8216903f1ecb in order to avoid executing
unnessary virtual slot expansion code when the given atom specifies a
slot or --update is enabled.

---
 pym/_emerge/depgraph.py |   54 ++++++++++++++++++++++------------------------
 1 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3cb85dc..2c39608 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6530,32 +6530,34 @@ class _dep_check_composite_db(dbapi):
 		ret = self._match_cache.get(atom)
 		if ret is not None:
 			return ret[:]
+
+		ret = []
 		pkg, existing = self._depgraph._select_package(self._root, atom)
-		if not pkg:
-			ret = []
-		else:
-			# Return the highest available from select_package() as well as
-			# any matching slots in the graph db.
+
+		if pkg is not None and self._visible(pkg):
+			self._cpv_pkg_map[pkg.cpv] = pkg
+			ret.append(pkg.cpv)
+
+		if pkg is not None and \
+			atom.slot is None and \
+			"--update" not in self._depgraph._frozen_config.myopts and \
+			pkg.cp.startswith("virtual/"):
+			# For new-style virtual lookahead that occurs inside dep_check()
+			# for bug #141118, examine all slots. This is needed so that newer
+			# slots will not unnecessarily be pulled in when a satisfying lower
+			# slot is already installed. For example, if virtual/jdk-1.5 is
+			# satisfied via gcj-jdk then there's no need to pull in a newer
+			# slot to satisfy a virtual/jdk dependency, unless --update is
+			# enabled.
 			slots = set()
-			slots.add(pkg.metadata["SLOT"])
-			if pkg.cp.startswith("virtual/"):
-				# For new-style virtual lookahead that occurs inside
-				# dep_check(), examine all slots. This is needed
-				# so that newer slots will not unnecessarily be pulled in
-				# when a satisfying lower slot is already installed. For
-				# example, if virtual/jdk-1.4 is satisfied via kaffe then
-				# there's no need to pull in a newer slot to satisfy a
-				# virtual/jdk dependency.
-				for virt_pkg in self._depgraph._iter_match_pkgs_any(
-					self._depgraph._frozen_config.roots[self._root], atom):
-					if virt_pkg.cp != pkg.cp:
-						continue
-					slots.add(virt_pkg.slot)
-			ret = []
-			if self._visible(pkg):
-				self._cpv_pkg_map[pkg.cpv] = pkg
-				ret.append(pkg.cpv)
-			slots.remove(pkg.metadata["SLOT"])
+			slots.add(pkg.slot)
+			for virt_pkg in self._depgraph._iter_match_pkgs_any(
+				self._depgraph._frozen_config.roots[self._root], atom):
+				if virt_pkg.cp != pkg.cp:
+					continue
+				slots.add(virt_pkg.slot)
+
+			slots.remove(pkg.slot)
 			while slots:
 				slot_atom = atom.with_slot(slots.pop())
 				pkg, existing = self._depgraph._select_package(
@@ -6569,10 +6571,6 @@ class _dep_check_composite_db(dbapi):
 
 			if len(ret) > 1:
 				self._cpv_sort_ascending(ret)
-				if "--update" in self._depgraph._frozen_config.myopts:
-					# With --update, we want to force selection of
-					# the highest available version.
-					ret = [ret[-1]]
 
 		self._match_cache[atom] = ret
 		return ret[:]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-11 17:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-11 17:31 UTC (permalink / raw
  To: gentoo-commits

commit:     a83f1864180ac88675bfd633617d835e9e42c1de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 17:30:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 17:30:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a83f1864

Revert virtual slot update code for bug 382557.

This reverts the behavior change from commit
21330075f07248765016e104b3ba8216903f1ecb, since it's too aggressive in
pulling in new virtual slots that may have masked dependencies.

---
 pym/_emerge/depgraph.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2c39608..6a04a79 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6540,7 +6540,6 @@ class _dep_check_composite_db(dbapi):
 
 		if pkg is not None and \
 			atom.slot is None and \
-			"--update" not in self._depgraph._frozen_config.myopts and \
 			pkg.cp.startswith("virtual/"):
 			# For new-style virtual lookahead that occurs inside dep_check()
 			# for bug #141118, examine all slots. This is needed so that newer



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-18 21:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-18 21:57 UTC (permalink / raw
  To: gentoo-commits

commit:     7307975a8f4ee465a27ed7cd28fde5db22607248
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 18 21:57:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 18 21:57:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7307975a

get_dep_chain: fix KeyError if start_node is root

---
 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 400207e..deda441 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2704,7 +2704,7 @@ class depgraph(object):
 		traversed_nodes.add(start_node)
 
 		start_node_parent_atoms = {}
-		for ppkg, patom in all_parents[node]:
+		for ppkg, patom in all_parents.get(node, []):
 			# Get a list of suitable atoms. For use deps
 			# (aka unsatisfied_dependency is not None) we
 			# need that the start_node doesn't match the atom.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-19 14:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-19 14:37 UTC (permalink / raw
  To: gentoo-commits

commit:     cfae195364f3cc9700f34eef031933ff701d029d
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Sep 19 11:05:23 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 14:32:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cfae1953

Suggest --autounmask-keep-masks instead of --autounmask=n

Currently emerge suggests --autounmask=n if any configuration
change is proposed. With this patch it will print a suggestion
only for mask changes, as these are the changes people complain
most about. It will suggest --autounmask-keep-masks in this case.

---
 pym/_emerge/depgraph.py |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 52d4545..e5cc2ec 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6033,15 +6033,11 @@ class depgraph(object):
 				except PortageException:
 					problems.append("!!! Failed to write '%s'\n" % file_to_write_to)
 
-		if not quiet and \
-			(unstable_keyword_msg or \
-			p_mask_change_msg or \
-			use_changes_msg or \
-			license_msg):
+		if not quiet and p_mask_change_msg:
 			msg = [
 				"",
-				"NOTE: This --autounmask behavior can be disabled by setting",
-				"      EMERGE_DEFAULT_OPTS=\"--autounmask=n\" in make.conf."
+				"NOTE: The --autounmask-keep-masks option will prevent emerge",
+				"      from creating mask changes."
 			]
 			for line in msg:
 				if line:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-19 15:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-19 15:54 UTC (permalink / raw
  To: gentoo-commits

commit:     392cc10c0a6f608ab7a8f4a8043b58589c6ee21c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 19 15:53:55 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 15:53:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=392cc10c

Suggest --autounmask-keep-masks for ** keyword.

---
 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 e5cc2ec..19773c2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5767,6 +5767,7 @@ class depgraph(object):
 		#Set of roots we have autounmask changes for.
 		roots = set()
 
+		masked_by_missing_keywords = False
 		unstable_keyword_msg = {}
 		for pkg in self._dynamic_config._needed_unstable_keywords:
 			self._show_merge_list()
@@ -5782,6 +5783,8 @@ class depgraph(object):
 					if reason.unmask_hint and \
 						reason.unmask_hint.key == 'unstable keyword':
 						keyword = reason.unmask_hint.value
+						if keyword == "**":
+							masked_by_missing_keywords = True
 
 						unstable_keyword_msg[root].append(self._get_dep_chain_as_comment(pkg))
 						if autounmask_unrestricted_atoms:
@@ -6033,11 +6036,11 @@ class depgraph(object):
 				except PortageException:
 					problems.append("!!! Failed to write '%s'\n" % file_to_write_to)
 
-		if not quiet and p_mask_change_msg:
+		if not quiet and (p_mask_change_msg or masked_by_missing_keywords):
 			msg = [
 				"",
 				"NOTE: The --autounmask-keep-masks option will prevent emerge",
-				"      from creating mask changes."
+				"      from creating package.unmask or ** keyword changes."
 			]
 			for line in msg:
 				if line:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-21 14:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-21 14:11 UTC (permalink / raw
  To: gentoo-commits

commit:     f127d25373a42f3200a331b7f2641a1cf0e90b50
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Wed Sep 21 14:11:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 21 14:11:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f127d253

Point users to the man page instead of duplicating it in --help

---
 pym/_emerge/help.py |  815 +--------------------------------------------------
 pym/_emerge/main.py |    4 +-
 2 files changed, 5 insertions(+), 814 deletions(-)

diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 7e73ec0..40c725e 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -3,10 +3,9 @@
 
 from __future__ import print_function
 
-from portage.const import _ENABLE_DYN_LINK_MAP
 from portage.output import bold, turquoise, green
 
-def shorthelp():
+def help():
 	print(bold("emerge:")+" the other white meat (command-line interface to the Portage system)")
 	print(bold("Usage:"))
 	print("   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] [ "+turquoise("ebuild")+" | "+turquoise("tbz2")+" | "+turquoise("file")+" | "+turquoise("@set")+" | "+turquoise("atom")+" ] [ ... ]")
@@ -22,813 +21,5 @@ def shorthelp():
 	print("          [ "+green("--oneshot")+"   ] [ "+green("--onlydeps")+"   ]")
 	print("          [ "+green("--reinstall ")+turquoise("changed-use")+"      ] [ " + green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" >         ]")
 	print(bold("Actions:")+"  [ "+green("--depclean")+" | "+green("--list-sets")+" | "+green("--search")+" | "+green("--sync")+" | "+green("--version")+"        ]")
-
-def help(myopts, havecolor=1):
-	# TODO: Implement a wrap() that accounts for console color escape codes.
-	from textwrap import wrap
-	desc_left_margin = 14
-	desc_indent = desc_left_margin * " "
-	desc_width = 80 - desc_left_margin - 5
-	if "--verbose" not in myopts:
-		shorthelp()
-		print()
-		print("   For more help try 'emerge --help --verbose' or consult the man page.")
-	else:
-		shorthelp()
-		print()
-		print(turquoise("Help (this screen):"))
-		print("       "+green("--help")+" ("+green("-h")+" short option)")
-		print("              Displays this help; an additional argument (see above) will tell")
-		print("              emerge to display detailed help.")
-		print()
-		print(turquoise("Actions:"))
-		print("       "+green("--clean"))
-		print("              Cleans the system by removing outdated packages which will not")
-		print("              remove functionalities or prevent your system from working.")
-		print("              The arguments can be in several different formats :")
-		print("              * world ")
-		print("              * system or")
-		print("              * 'dependency specification' (in single quotes is best.)")
-		print("              Here are a few examples of the dependency specification format:")
-		print("              "+bold("binutils")+" matches")
-		print("                  binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1")
-		print("              "+bold("sys-devel/binutils")+" matches")
-		print("                  binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1")
-		print("              "+bold(">sys-devel/binutils-2.11.90.0.7")+" matches")
-		print("                  binutils-2.11.92.0.12.3-r1")
-		print("              "+bold(">=sys-devel/binutils-2.11.90.0.7")+" matches")
-		print("                  binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1")
-		print("              "+bold("<=sys-devel/binutils-2.11.92.0.12.3-r1")+" matches")
-		print("                  binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1")
-		print()
-		print("       "+green("--config"))
-		print("              Runs package-specific operations that must be executed after an")
-		print("              emerge process has completed.  This usually entails configuration")
-		print("              file setup or other similar setups that the user may wish to run.")
-		print()
-		print("       "+green("--depclean")+" ("+green("-c")+" short option)")
-
-		paragraph = "Cleans the system by removing packages that are " + \
-		"not associated with explicitly merged packages. Depclean works " + \
-		"by creating the full dependency tree from the " + \
-		"@world set, then comparing it to installed packages. Packages " + \
-		"installed, but not part of the dependency tree, will be " + \
-		"uninstalled by depclean. See --with-bdeps for behavior with " + \
-		"respect to build time dependencies that are not strictly " + \
-		"required. Packages that are part of the world set will " + \
-		"always be kept. They can be manually added to this set with " + \
-		"emerge --noreplace <atom>. As a safety measure, depclean " + \
-		"will not remove any packages unless *all* required dependencies " + \
-		"have been resolved. As a consequence, it is often necessary to " + \
-		"run emerge --update --newuse --deep @world " + \
-		"prior to depclean."
-
-		for line in wrap(paragraph, desc_width):
-			print(desc_indent + line)
-		print()
-
-		paragraph =  "WARNING: Inexperienced users are advised to use " + \
-		"--pretend with this option in order to see a preview of which " + \
-		"packages will be uninstalled. Always study the list of packages " + \
-		"to be cleaned for any obvious mistakes. Note that packages " + \
-		"listed in package.provided (see portage(5)) may be removed by " + \
-		"depclean, even if they are part of the world set."
-
-		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)
-		print()
-
-		paragraph = "Depclean serves as a dependency aware version of " + \
-			"--unmerge. When given one or more atoms, it will unmerge " + \
-			"matched packages that have no reverse dependencies. Use " + \
-			"--depclean together with --verbose to show reverse dependencies."
-
-		for line in wrap(paragraph, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--deselect") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-
-		paragraph = \
-			"Remove atoms and/or sets from the world file. This action is implied " + \
-			"by uninstall actions, including --depclean, " + \
-			"--prune and --unmerge. Use --deselect=n " + \
-			"in order to prevent uninstall actions from removing " + \
-			"atoms from the world file."
-
-		for line in wrap(paragraph, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--ignore-default-opts"))
-
-		paragraph = \
-			"Causes EMERGE_DEFAULT_OPTS (see make.conf(5)) to be ignored."
-
-		for line in wrap(paragraph, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--info"))
-		print("              Displays important portage variables that will be exported to")
-		print("              ebuild.sh when performing merges. This information is useful")
-		print("              for bug reports and verification of settings. All settings in")
-		print("              make.{conf,globals,defaults} and the environment show up if")
-		print("              run with the '--verbose' flag.")
-		print()
-		print("       " + green("--list-sets"))
-		paragraph = "Displays a list of available package sets."
-
-		for line in wrap(paragraph, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--metadata"))
-		print("              Transfers metadata cache from ${PORTDIR}/metadata/cache/ to")
-		print("              /var/cache/edb/dep/ as is normally done on the tail end of an")
-		print("              rsync update using " + bold("emerge --sync") + ". This process populates the")
-		print("              cache database that portage uses for pre-parsed lookups of")
-		print("              package data.  It does not populate cache for the overlays")
-		print("              listed in PORTDIR_OVERLAY.  In order to generate cache for")
-		print("              overlays, use " + bold("--regen") + ".")
-		print()
-		print("       "+green("--prune")+" ("+green("-P")+" short option)")
-		print("              "+turquoise("WARNING: This action can remove important packages!"))
-		paragraph = "Removes all but the highest installed version of a " + \
-			"package from your system. Use --prune together with " + \
-			"--verbose to show reverse dependencies or with --nodeps " + \
-			"to ignore all dependencies. "
-
-		for line in wrap(paragraph, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--regen"))
-		print("              Causes portage to check and update the dependency cache of all")
-		print("              ebuilds in the portage tree. This is not recommended for rsync")
-		print("              users as rsync updates the cache using server-side caches.")
-		print("              Rsync users should simply 'emerge --sync' to regenerate.")
-		desc = "In order to specify parallel --regen behavior, use "+ \
-			"the ---jobs and --load-average options. If you would like to " + \
-			"generate and distribute cache for use by others, use egencache(1)."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--resume")+" ("+green("-r")+" short option)")
-		print("              Resumes the most recent merge list that has been aborted due to an")
-		print("              error. Please note that this operation will only return an error")
-		print("              on failure. If there is nothing for portage to do, then portage")
-		print("              will exit with a message and a success condition. A resume list")
-		print("              will persist until it has been completed in entirety or until")
-		print("              another aborted merge list replaces it. The resume history is")
-		print("              capable of storing two merge lists. After one resume list")
-		print("              completes, it is possible to invoke --resume once again in order")
-		print("              to resume an older list.")
-		print()
-		print("       "+green("--search")+" ("+green("-s")+" short option)")
-		print("              Searches for matches of the supplied string in the current local")
-		print("              portage tree. By default emerge uses a case-insensitive simple ")
-		print("              search, but you can enable a regular expression search by ")
-		print("              prefixing the search string with %.")
-		print("              Prepending the expression with a '@' will cause the category to")
-		print("              be included in the search.")
-		print("              A few examples:")
-		print("              "+bold("emerge --search libc"))
-		print("                  list all packages that contain libc in their name")
-		print("              "+bold("emerge --search '%^kde'"))
-		print("                  list all packages starting with kde")
-		print("              "+bold("emerge --search '%gcc$'"))
-		print("                  list all packages ending with gcc")
-		print("              "+bold("emerge --search '%@^dev-java.*jdk'"))
-		print("                  list all available Java JDKs")
-		print()
-		print("       "+green("--searchdesc")+" ("+green("-S")+" short option)")
-		print("              Matches the search string against the description field as well")
-		print("              the package's name. Take caution as the descriptions are also")
-		print("              matched as regular expressions.")
-		print("                emerge -S html")
-		print("                emerge -S applet")
-		print("                emerge -S 'perl.*module'")
-		print()
-		print("       "+green("--sync"))
-		desc = "This updates the portage tree that is located in the " + \
-			"directory that the PORTDIR variable refers to (default " + \
-			"location is /usr/portage). The SYNC variable specifies " + \
-			"the remote URI from which files will be synchronized. " + \
-			"The PORTAGE_SYNC_STALE variable configures " + \
-			"warnings that are shown when emerge --sync has not " + \
-			"been executed recently."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print(desc_indent + turquoise("WARNING:"))
-		desc = "The emerge --sync action will modify and/or delete " + \
-			"files located inside the directory that the PORTDIR " + \
-			"variable refers to (default location is /usr/portage). " + \
-			"For more information, see the PORTDIR documentation in " + \
-			"the make.conf(5) man page."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print(desc_indent + green("NOTE:"))
-		desc = "The emerge-webrsync program will download the entire " + \
-			"portage tree as a tarball, which is much faster than emerge " + \
-			"--sync for first time syncs."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--unmerge")+" ("+green("-C")+" short option)")
-		print("              "+turquoise("WARNING: This action can remove important packages!"))
-		print("              Removes all matching packages. This does no checking of")
-		print("              dependencies, so it may remove packages necessary for the proper")
-		print("              operation of your system. Its arguments can be atoms or")
-		print("              ebuilds. For a dependency aware version of --unmerge, use")
-		print("              --depclean or --prune.")
-		print()
-		print("       "+green("--version")+" ("+green("-V")+" short option)")
-		print("              Displays the currently installed version of portage along with")
-		print("              other information useful for quick reference on a system. See")
-		print("              "+bold("emerge info")+" for more advanced information.")
-		print()
-		print(turquoise("Options:"))
-		print("       "+green("--accept-properties=ACCEPT_PROPERTIES"))
-		desc = "This option temporarily overrides the ACCEPT_PROPERTIES " + \
-			"variable. The ACCEPT_PROPERTIES variable is incremental, " + \
-			"which means that the specified setting is appended to the " + \
-			"existing value from your configuration. The special -* " + \
-			"token can be used to discard the existing configuration " + \
-			"value and start fresh. See the MASKED PACKAGES section " + \
-			"and make.conf(5) for more information about " + \
-			"ACCEPT_PROPERTIES. A typical usage example for this option " + \
-			"would be to use --accept-properties=-interactive to " + \
-			"temporarily mask interactive packages. With default " + \
-			"configuration, this would result in an effective " + \
-			"ACCEPT_PROPERTIES value of \"* -interactive\"."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--alphabetical"))
-		print("              When displaying USE and other flag output, combines the enabled")
-		print("              and disabled flags into a single list and sorts it alphabetically.")
-		print("              With this option, output such as USE=\"dar -bar -foo\" will instead")
-		print("              be displayed as USE=\"-bar dar -foo\"")
-		print()
-		print("       " + green("--ask") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-a")))
-		desc = "Before performing the action, display what will take place (server info for " + \
-			"--sync, --pretend output for merge, and so forth), then ask " + \
-			"whether to proceed with the action or abort.  Using --ask is more " + \
-			"efficient than using --pretend and then executing the same command " + \
-			"without --pretend, as dependencies will only need to be calculated once. " + \
-			"WARNING: If the \"Enter\" key is pressed at the prompt (with no other input), " + \
-			"it is interpreted as acceptance of the first choice.  Note that the input " + \
-			"buffer is not cleared prior to the prompt, so an accidental press of the " + \
-			"\"Enter\" key at any time prior to the prompt will be interpreted as a choice! " + \
-			"Use the --ask-enter-invalid option if you want a single \"Enter\" key " + \
-			"press to be interpreted as invalid input."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("        " + green("--ask-enter-invalid"))
-		desc = "When used together with the --ask option, " + \
-			"interpret a single \"Enter\" key press as " + \
-			"invalid input. This helps prevent accidental " + \
-			"acceptance of the first choice. This option is " + \
-			"intended to be set in the make.conf(5) " + \
-			"EMERGE_DEFAULT_OPTS variable."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print() 
-		print("       " + green("--autounmask") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Automatically unmask packages and generate package.use " + \
-			"settings as necessary to satisfy dependencies. This " + \
-			"option is enabled by default. If any configuration " + \
-			"changes are required, then they will be displayed " + \
-			"after the merge list and emerge will immediately " + \
-			"abort. If the displayed configuration changes are " + \
-			"satisfactory, you should copy and paste them into " + \
-			"the specified configuration file(s), or enable the " + \
-			"--autounmask-write option. The " + \
-			"EMERGE_DEFAULT_OPTS variable may be used to " + \
-			"disable this option by default in make.conf(5)."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--autounmask-unrestricted-atoms") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "If --autounmask is enabled, keyword and mask changes" + \
-			"using the '=' operator will be written. With this option, " + \
-			"'>=' operators will be used whenever possible. USE and " + \
-			"license changes always use the latter behvior."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--autounmask-keep-masks") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "If --autounmask is enabled, no package.unmask or ** keyword " + \
-			"changes will be created. This leads to unsatisfied " + \
-			"dependencies if no other solution exists."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--autounmask-write") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "If --autounmask is enabled, changes are written " + \
-			"to config files, respecting CONFIG_PROTECT and --ask. " + \
-			"If the corresponding package.* is a file, the changes are " + \
-			"appended to it, if it is a directory, changes are written to " + \
-			"the lexicographically last file. This way it is always ensured " + \
-			"that the new changes take precedence over existing changes."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--backtrack") + " " + turquoise("COUNT"))
-		desc = "Specifies an integer number of times to backtrack if " + \
-			"dependency calculation fails due to a conflict or an " + \
-			"unsatisfied dependency (default: '10')."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		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')"
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--buildpkg") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-b")))
-		desc = "Tells emerge to build binary packages for all ebuilds processed in" + \
-			" addition to actually merging the packages. Useful for maintainers" + \
-			" or if you administrate multiple Gentoo Linux systems (build once," + \
-			" emerge tbz2s everywhere) as well as disaster recovery. The package" + \
-			" will be created in the" + \
-			" ${PKGDIR}/All directory. An alternative for already-merged" + \
-			" packages is to use quickpkg(1) which creates a tbz2 from the" + \
-			" live filesystem."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--buildpkgonly")+" ("+green("-B")+" short option)")
-		print("              Creates a binary package, but does not merge it to the")
-		print("              system. This has the restriction that unsatisfied dependencies")
-		print("              must not exist for the desired package as they cannot be used if")
-		print("              they do not exist on the system.")
-		print()
-		print("       " + green("--changed-use"))
-		desc = "This is an alias for --reinstall=changed-use."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--changelog")+" ("+green("-l")+" short option)")
-		print("              When pretending, also display the ChangeLog entries for packages")
-		print("              that will be upgraded.")
-		print()
-		print("       "+green("--color") + " < " + turquoise("y") + " | "+ turquoise("n")+" >")
-		print("              Enable or disable color output. This option will override NOCOLOR")
-		print("              (see make.conf(5)) and may also be used to force color output when")
-		print("              stdout is not a tty (by default, color is disabled unless stdout")
-		print("              is a tty).")
-		print()
-		print("       "+green("--columns"))
-		print("              Display the pretend output in a tabular form. Versions are")
-		print("              aligned vertically.")
-		print()
-		print("       "+green("--complete-graph") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "This causes emerge to consider the deep dependencies of all" + \
-			" packages from the world set. With this option enabled," + \
-			" emerge will bail out if it determines that the given operation will" + \
-			" break any dependencies of the packages that have been added to the" + \
-			" graph. Like the --deep option, the --complete-graph" + \
-			" option will significantly increase the time taken for dependency" + \
-			" calculations. Note that, unlike the --deep option, the" + \
-			" --complete-graph option does not cause any more packages to" + \
-			" be updated than would have otherwise " + \
-			"been updated with the option disabled. " + \
-			"Using --with-bdeps=y together with --complete-graph makes " + \
-			"the graph as complete as possible."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--config-root=DIR"))
-		desc = "Set the PORTAGE_CONFIGROOT environment variable " + \
-			"which is documented in the emerge(1) man page."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--debug")+" ("+green("-d")+" short option)")
-		print("              Tell emerge to run the ebuild command in --debug mode. In this")
-		print("              mode, the bash build environment will run with the -x option,")
-		print("              causing it to output verbose debug information print to stdout.")
-		print("              --debug is great for finding bash syntax errors as providing")
-		print("              very verbose information about the dependency and build process.")
-		print()
-		print("       "+green("--deep") + " " + turquoise("[DEPTH]") + \
-			" (" + green("-D") + " short option)")
-		print("              This flag forces emerge to consider the entire dependency tree of")
-		print("              packages, instead of checking only the immediate dependencies of")
-		print("              the packages. As an example, this catches updates in libraries")
-		print("              that are not directly listed in the dependencies of a package.")
-		print("              Also see --with-bdeps for behavior with respect to build time")
-		print("              dependencies that are not strictly required.")
-		print()
-
-		if _ENABLE_DYN_LINK_MAP:
-			print("       " + green("--depclean-lib-check") + " [ %s | %s ]" % \
-				(turquoise("y"), turquoise("n")))
-			desc = "Account for library link-level dependencies during " + \
-				"--depclean and --prune actions. This " + \
-				"option is enabled by default. In some cases this can " + \
-				"be somewhat time-consuming. This option is ignored " + \
-				"when FEATURES=\"preserve-libs\" is enabled in " + \
-				"make.conf(5), since any libraries that have " + \
-				"consumers will simply be preserved."
-			for line in wrap(desc, desc_width):
-				print(desc_indent + line)
-			print()
-
-		print("       "+green("--emptytree")+" ("+green("-e")+" short option)")
-		desc = "Reinstalls target atoms and their entire deep " + \
-			"dependency tree, as though no packages are currently " + \
-			"installed. You should run this with --pretend " + \
-			"first to make sure the result is what you expect."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--exclude") + " " + turquoise("ATOMS"))
-		desc = "A space separated list of package names or slot atoms. " + \
-			"Emerge won't  install any ebuild or binary package that " + \
-			"matches any of the given package atoms."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--fail-clean") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Clean up temporary files after a build failure. This is " + \
-			"particularly useful if you have PORTAGE_TMPDIR on " + \
-			"tmpfs. If this option is enabled, you probably also want " + \
-			"to enable PORT_LOGDIR (see make.conf(5)) in " + \
-			"order to save the build log."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--fetchonly")+" ("+green("-f")+" short option)")
-		print("              Instead of doing any package building, just perform fetches for")
-		print("              all packages (main package as well as all dependencies.) When")
-		print("              used in combination with --pretend all the SRC_URIs will be")
-		print("              displayed multiple mirrors per line, one line per file.")
-		print()
-		print("       "+green("--fetch-all-uri")+" ("+green("-F")+" short option)")
-		print("              Same as --fetchonly except that all package files, including those")
-		print("              not required to build the package, will be processed.")
-		print()
-		print("       " + green("--getbinpkg") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-g")))
-		print("              Using the server and location defined in PORTAGE_BINHOST, portage")
-		print("              will download the information from each binary file there and it")
-		print("              will use that information to help build the dependency list. This")
-		print("              option implies '-k'. (Use -gK for binary-only merging.)")
-		print()
-		print("       " + green("--getbinpkgonly") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-G")))
-		print("              This option is identical to -g, as above, except it will not use")
-		print("              ANY information from the local machine. All binaries will be")
-		print("              downloaded from the remote server without consulting packages")
-		print("              existing in the packages directory.")
-		print()
-		print("       " + green("--jobs") + " " + turquoise("[JOBS]") + " ("+green("-j")+" short option)")
-		desc = "Specifies the number of packages " + \
-			"to build simultaneously. If this option is " + \
-			"given without an argument, emerge will not " + \
-			"limit the number of jobs that " + \
-			"can run simultaneously. Also see " + \
-			"the related --load-average option. " + \
-			"Note that interactive packages currently force a setting " + \
-			"of --jobs=1. This issue can be temporarily avoided " + \
-			"by specifying --accept-properties=-interactive."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--keep-going") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Continue as much as possible after " + \
-			"an error. When an error occurs, " + \
-			"dependencies are recalculated for " + \
-			"remaining packages and any with " + \
-			"unsatisfied dependencies are " + \
-			"automatically dropped. Also see " + \
-			"the related --skipfirst option."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--load-average") + " " + turquoise("LOAD"))
-		desc = "Specifies that no new builds should " + \
-			"be started if there are other builds " + \
-			"running and the load average is at " + \
-			"least LOAD (a floating-point number). " + \
-			"This option is recommended for use " + \
-			"in combination with --jobs in " + \
-			"order to avoid excess load. See " + \
-			"make(1) for information about " + \
-			"analogous options that should be " + \
-			"configured via MAKEOPTS in " + \
-			"make.conf(5)."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--misspell-suggestions") + " < %s | %s >" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Enable or disable misspell suggestions. By default, " + \
-			"emerge will show a list of packages with similar names " + \
-			"when a package doesn't exist. The EMERGE_DEFAULT_OPTS " + \
-			"variable may be used to disable this option by default"
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--newuse")+" ("+green("-N")+" short option)")
-		desc = "Tells emerge to include installed packages where USE " + \
-			"flags have changed since compilation. This option " + \
-			"also implies the --selective option. If you would " + \
-			"like to skip rebuilds for which disabled flags have " + \
-			"been added to or removed from IUSE, see the related " + \
-			"--reinstall=changed-use option."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--noconfmem"))
-		print("              Portage keeps track of files that have been placed into")
-		print("              CONFIG_PROTECT directories, and normally it will not merge the")
-		print("              same file more than once, as that would become annoying. This")
-		print("              can lead to problems when the user wants the file in the case")
-		print("              of accidental deletion. With this option, files will always be")
-		print("              merged to the live fs instead of silently dropped.")
-		print()
-		print("       "+green("--nodeps")+" ("+green("-O")+" short option)")
-		print("              Merge specified packages, but don't merge any dependencies.")
-		print("              Note that the build may fail if deps aren't satisfied.")
-		print() 
-		print("       "+green("--noreplace")+" ("+green("-n")+" short option)")
-		print("              Skip the packages specified on the command-line that have")
-		print("              already been installed.  Without this option, any packages,")
-		print("              ebuilds, or deps you specify on the command-line *will* cause")
-		print("              Portage to remerge the package, even if it is already installed.")
-		print("              Note that Portage won't remerge dependencies by default.")
-		print() 
-		print("       "+green("--nospinner"))
-		print("              Disables the spinner regardless of terminal type.")
-		print()
-		print("       " + green("--usepkg-exclude") + " " + turquoise("ATOMS"))
-		desc = "A space separated list of package names or slot atoms." + \
-			" Emerge will ignore matching binary packages."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--rebuild-exclude") + " " + turquoise("ATOMS"))
-		desc = "A space separated list of package names or slot atoms." + \
-			" Emerge will not rebuild matching packages due to --rebuild."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--rebuild-ignore") + " " + turquoise("ATOMS"))
-		desc = "A space separated list of package names or slot atoms." + \
-			" Emerge will not rebuild packages that depend on matching " + \
-			" packages due to --rebuild."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--oneshot")+" ("+green("-1")+" short option)")
-		print("              Emerge as normal, but don't add packages to the world profile.")
-		print("              This package will only be updated if it is depended upon by")
-		print("              another package.")
-		print()
-		print("       "+green("--onlydeps")+" ("+green("-o")+" short option)")
-		print("              Only merge (or pretend to merge) the dependencies of the")
-		print("              specified packages, not the packages themselves.")
-		print()
-		print("       " + green("--package-moves") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Perform package moves when necessary. This option " + \
-			"is enabled by default. WARNING: This option " + \
-			"should remain enabled under normal circumstances. " + \
-			"Do not disable it unless you know what you are " + \
-			"doing."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--pretend")+" ("+green("-p")+" short option)")
-		print("              Instead of actually performing the merge, simply display what")
-		print("              ebuilds and tbz2s *would* have been installed if --pretend")
-		print("              weren't used.  Using --pretend is strongly recommended before")
-		print("              installing an unfamiliar package.  In the printout, N = new,")
-		print("              U = updating, R = replacing, F = fetch  restricted, B = blocked")
-		print("              by an already installed package, D = possible downgrading,")
-		print("              S = slotted install. --verbose causes affecting use flags to be")
-		print("              printed out accompanied by a '+' for enabled and a '-' for")
-		print("              disabled USE flags.")
-		print()
-		print("       " + green("--quiet") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-q")))
-		print("              Effects vary, but the general outcome is a reduced or condensed")
-		print("              output from portage's displays.")
-		print()
-		print("       " + green("--quiet-build") + \
-			" [ %s | %s ]" % (turquoise("y"), turquoise("n")))
-		desc = "Redirect all build output to logs alone, and do not " + \
-			"display it on stdout."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--quiet-unmerge-warn"))
-		desc = "Disable the warning message that's shown prior to " + \
-			"--unmerge actions. This option is intended " + \
-			"to be set in the make.conf(5) " + \
-			"EMERGE_DEFAULT_OPTS variable."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--rebuild-if-new-rev") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Rebuild packages when build-time dependencies are built " + \
-			"from source, if the dependency is not already installed with " + \
-			"the same version and revision."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--rebuild-if-new-ver") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Rebuild packages when build-time dependencies are built " + \
-			"from source, if the dependency is not already installed with " + \
-			"the same version. Revision numbers are ignored."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--rebuild-if-unbuilt") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Rebuild packages when build-time dependencies are built " + \
-			"from source"
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--rebuilt-binaries") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Replace installed packages with binary packages that have " + \
-			"been rebuilt. Rebuilds are detected by comparison of " + \
-			"BUILD_TIME package metadata. This option is enabled " + \
-			"automatically when using binary packages " + \
-			"(--usepkgonly or --getbinpkgonly) together with " + \
-			"--update and --deep."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--rebuilt-binaries-timestamp") + "=%s" % turquoise("TIMESTAMP"))
-		desc = "This option modifies emerge's behaviour only if " + \
-			"--rebuilt-binaries is given. Only binaries that " + \
-			"have a BUILD_TIME that is larger than the given TIMESTAMP " + \
-			"and that is larger than that of the installed package will " + \
-			"be considered by the rebuilt-binaries logic."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--reinstall ") + turquoise("changed-use"))
-		print("              Tells emerge to include installed packages where USE flags have")
-		print("              changed since installation.  Unlike --newuse, this option does")
-		print("              not trigger reinstallation when flags that the user has not")
-		print("              enabled are added or removed.")
-		print()
-		print("       " + green("--reinstall-atoms") + " " + turquoise("ATOMS"))
-		desc = "A space separated list of package names or slot atoms. " + \
-			"Emerge will treat matching packages as if they are not " + \
-			"installed, and reinstall them if necessary."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--root=DIR"))
-		desc = "Set the ROOT environment variable " + \
-			"which is documented in the emerge(1) man page."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--root-deps[=rdeps]"))
-		desc = "If no argument is given then build-time dependencies of packages for " + \
-			"ROOT are installed to " + \
-			"ROOT instead of /. If the rdeps argument is given then discard " + \
-			"all build-time dependencies of packages for ROOT. This option is " + \
-			"only meaningful when used together with ROOT and it should not " + \
-			"be enabled under normal circumstances. For currently supported " + \
-			"EAPI values, the build-time dependencies are specified in the " + \
-			"DEPEND variable. However, behavior may change for new " + \
-			"EAPIs when related extensions are added in the future."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--select") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Add specified packages to the world set (inverse of " + \
-			"--oneshot). This is useful if you want to " + \
-			"use EMERGE_DEFAULT_OPTS to make " + \
-			"--oneshot behavior default."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--selective") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "This identical to the --noreplace option. " + \
-			"Some options, such as --update, imply --selective. " + \
-			"Use --selective=n if you want to forcefully disable " + \
-			"--selective, regardless of options like --update."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--skipfirst"))
-		desc = "This option is only valid when " + \
-			"used with --resume.  It removes the " + \
-			"first package in the resume list. " + \
-			"Dependencies are recalculated for " + \
-			"remaining packages and any that " + \
-			"have unsatisfied dependencies or are " + \
-			"masked will be automatically dropped. " + \
-			"Also see the related " + \
-			"--keep-going option."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--tree")+" ("+green("-t")+" short option)")
-		print("              Shows the dependency tree using indentation for dependencies.")
-		print("              The packages are also listed in reverse merge order so that")
-		print("              a package's dependencies follow the package. Only really useful")
-		print("              in combination with --emptytree, --update or --deep.")
-		print()
-		print("       " + green("--unordered-display"))
-		desc = "By default the displayed merge list is sorted using the " + \
-			"order in which the packages will be merged. When " + \
-			"--tree is used together with this option, this " + \
-			"constraint is removed, hopefully leading to a more " + \
-			"readable dependency tree."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       "+green("--update")+" ("+green("-u")+" short option)")
-		desc = "Updates packages to the best version available, which may " + \
-			"not always be the  highest version number due to masking " + \
-			"for testing and development. Package atoms specified on " + \
-			"the command line are greedy, meaning that unspecific " + \
-			"atoms may match multiple versions of slotted packages."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--use-ebuild-visibility") + " [ %s | %s ]" % \
-			(turquoise("y"), turquoise("n")))
-		desc = "Use unbuilt ebuild metadata for visibility " + \
-			"checks on built packages."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--useoldpkg-atoms") + " " + turquoise("ATOMS"))
-		desc = "A space separated list of package names or slot atoms." + \
-			" Emerge will prefer matching binary packages over newer" + \
-			" unbuilt packages."
-		for line in wrap(desc, desc_width):
-			print(desc_indent + line)
-		print()
-		print("       " + green("--usepkg") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-k")))
-		print("              Tell emerge to use binary packages (from $PKGDIR) if they are")
-		print("              available, thus possibly avoiding some time-consuming compiles.")
-		print("              This option is useful for CD installs; you can export")
-		print("              PKGDIR=/mnt/cdrom/packages and then use this option to have")
-		print("              emerge \"pull\" binary packages from the CD in order to satisfy") 
-		print("              dependencies.")
-		print()
-		print("       " + green("--usepkgonly") + \
-			" [ %s | %s ] (%s short option)" % \
-			(turquoise("y"), turquoise("n"), green("-K")))
-		print("              Like --usepkg above, except this only allows the use of binary")
-		print("              packages, and it will abort the emerge if the package is not")
-		print("              available at the time of dependency calculation.")
-		print()
-		print("       "+green("--verbose")+" ("+green("-v")+" short option)")
-		print("              Effects vary, but the general outcome is an increased or expanded")
-		print("              display of content in portage's displays.")
-		print()
-		print("       "+green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" >")
-		print("              In dependency calculations, pull in build time dependencies that")
-		print("              are not strictly required. This defaults to 'n' for installation")
-		print("              actions and 'y' for the --depclean action. This setting can be")
-		print("              added to EMERGE_DEFAULT_OPTS (see make.conf(5)) and later")
-		print("              overridden via the command line.")
-		print()
+	print()
+	print("   For more help consult the man page.")

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 3f47af7..96a6cfa 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1611,7 +1611,7 @@ def emerge_main(args=None):
 			trees[settings["ROOT"]]["vartree"].dbapi) + '\n', noiselevel=-1)
 		return 0
 	elif myaction == 'help':
-		_emerge.help.help(myopts, portage.output.havecolor)
+		_emerge.help.help()
 		return 0
 
 	spinner = stdout_spinner()
@@ -1756,7 +1756,7 @@ def emerge_main(args=None):
 		print("myopts", myopts)
 
 	if not myaction and not myfiles and "--resume" not in myopts:
-		_emerge.help.help(myopts, portage.output.havecolor)
+		_emerge.help.help()
 		return 1
 
 	pretend = "--pretend" in myopts



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-22  1:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-22  1:59 UTC (permalink / raw
  To: gentoo-commits

commit:     8111f07162a14674484fa3bbb21550cb927818ad
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Thu Sep 22 01:59:17 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 01:59:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8111f071

Warn about ignored binary packages with non matching USE

---
 pym/_emerge/depgraph.py |   47 ++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8121f68..b10efd6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -389,6 +389,11 @@ class _dynamic_depgraph_config(object):
 		self._ignored_deps = []
 		self._highest_pkg_cache = {}
 
+		# Binary packages that have been rejected because their USE
+		# didn't match the user's config. It maps packages to a set
+		# of flags causing the rejection.
+		self.ignored_binaries = {}
+
 		self._needed_unstable_keywords = backtrack_parameters.needed_unstable_keywords
 		self._needed_p_mask_changes = backtrack_parameters.needed_p_mask_changes
 		self._needed_license_changes = backtrack_parameters.needed_license_changes
@@ -540,6 +545,38 @@ class depgraph(object):
 		if self._frozen_config.spinner:
 			self._frozen_config.spinner.update()
 
+	def _show_ignored_binaries(self):
+		"""
+		Show binaries that have been ignored becaue their USE didn't
+		match the user's config.
+		"""
+		if not self._dynamic_config.ignored_binaries \
+			or '--quiet' in self._frozen_config.myopts:
+			return
+
+		self._show_merge_list()
+
+		writemsg("\n!!! The following binary packages have been ignored " + \
+				"due to non matching USE:\n\n", noiselevel=-1)
+
+		for pkg, flags in self._dynamic_config.ignored_binaries.items():
+			writemsg("    =%s" % pkg.cpv, noiselevel=-1)
+			if pkg.root != '/':
+				writemsg(" for %s" % (pkg.root,), noiselevel=-1)
+			writemsg("\n        use flag(s): %s\n" % ", ".join(sorted(flags)),
+				noiselevel=-1)
+
+		msg = [
+			"",
+			"NOTE: The --binpkg-respect-use=n option will prevent emerge",
+			"      from ignoring these binary packages if possible."
+		]
+
+		for line in msg:
+			if line:
+				line = colorize("INFORM", line)
+			writemsg_stdout(line + "\n", noiselevel=-1)
+
 	def _show_missed_update(self):
 
 		# In order to minimize noise, show only the highest
@@ -3942,9 +3979,11 @@ class depgraph(object):
 						cur_iuse = iuses
 						if myeb and not usepkgonly and not useoldpkg:
 							cur_iuse = myeb.iuse.all
-						if self._reinstall_for_flags(forced_flags,
-							old_use, iuses,
-							now_use, cur_iuse):
+						reinstall_for_flags = self._reinstall_for_flags(forced_flags,
+							old_use, iuses, now_use, cur_iuse)
+						if reinstall_for_flags:
+							if not pkg.installed:
+								self._dynamic_config.ignored_binaries.setdefault(pkg, set()).update(reinstall_for_flags)
 							break
 					# Compare current config to installed package
 					# and do not reinstall if possible.
@@ -6125,6 +6164,8 @@ class depgraph(object):
 		else:
 			self._show_missed_update()
 
+		self._show_ignored_binaries()
+
 		self._display_autounmask()
 
 		# TODO: Add generic support for "set problem" handlers so that



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-22  3:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-22  3:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c85965f6d0493bab84d6b7a615d39678df9d53ba
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 03:03:03 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 03:03:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c85965f6

Tweak automatic --binpkg-respect-use behavior.

If --binpkg-respect-use is not explicitly specified, we enable the
behavior automatically (like requested in bug #297549), as long as it
doesn't strongly conflict with other options that have been specified.
Strongly conflicting options currently include --usepkgonly and
--rebuilt-binaries.

---
 pym/_emerge/create_depgraph_params.py |   11 +++++++++++
 pym/_emerge/depgraph.py               |    9 ++++++---
 pym/_emerge/main.py                   |    9 +++++----
 3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 221c440..d94ad89 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -64,6 +64,17 @@ def create_depgraph_params(myopts, myaction):
 		'--update' in myopts:
 		myparams['rebuilt_binaries'] = True
 
+	binpkg_respect_use = myopts.get('--binpkg-respect-use')
+	if binpkg_respect_use is not None:
+		myparams['binpkg_respect_use'] = binpkg_respect_use
+	elif '--usepkgonly' not in myopts and \
+		myopts.get('--rebuilt-binaries') is not True:
+		# If --binpkg-respect-use is not explicitly specified, we enable
+		# the behavior automatically (like requested in bug #297549), as
+		# long as it doesn't strongly conflict with other options that
+		# have been specified.
+		myparams['binpkg_respect_use'] = 'auto'
+
 	if myopts.get("--selective") == "n":
 		# --selective=n can be used to remove selective
 		# behavior that may have been implied by some

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e8d96f4..a4f6c3d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -552,7 +552,8 @@ class depgraph(object):
 		"""
 		if not self._dynamic_config.ignored_binaries \
 			or '--quiet' in self._frozen_config.myopts \
-			or "--binpkg-respect-use" in self._frozen_config.myopts:
+			or self._dynamic_config.myparams.get(
+			"binpkg_respect_use") in ("y", "n"):
 			return
 
 		self._show_merge_list()
@@ -796,7 +797,8 @@ class depgraph(object):
 		"""Return a set of flags that trigger reinstallation, or None if there
 		are no such flags."""
 		if "--newuse" in self._frozen_config.myopts or \
-			self._frozen_config.myopts.get("--binpkg-respect-use", True) == True:
+			self._dynamic_config.myparams.get(
+			"binpkg_respect_use") in ("y", "auto"):
 			flags = set(orig_iuse.symmetric_difference(
 				cur_iuse).difference(forced_flags))
 			flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
@@ -3967,7 +3969,8 @@ class depgraph(object):
 					if built and not useoldpkg and (not installed or matched_pkgs_ignore_use) and \
 						("--newuse" in self._frozen_config.myopts or \
 						"--reinstall" in self._frozen_config.myopts or \
-						self._frozen_config.myopts.get("--binpkg-respect-use", True) == True):
+						(not installed and self._dynamic_config.myparams.get(
+						"binpkg_respect_use") in ("y", "auto"))):
 						iuses = pkg.iuse.all
 						old_use = self._pkg_use_enabled(pkg)
 						if myeb:

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index d2fc0ac..f4ea36c 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -968,10 +968,11 @@ def parse_opts(tmpcmdline, silent=False):
 	if myoptions.deselect in true_y:
 		myoptions.deselect = True
 
-	if myoptions.binpkg_respect_use in true_y:
-		myoptions.binpkg_respect_use = True
-	else:
-		myoptions.binpkg_respect_use = None
+	if myoptions.binpkg_respect_use is not None:
+		if myoptions.binpkg_respect_use in true_y:
+			myoptions.binpkg_respect_use = 'y'
+		else:
+			myoptions.binpkg_respect_use = 'n'
 
 	if myoptions.complete_graph in true_y:
 		myoptions.complete_graph = True



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-22  3:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-22  3:06 UTC (permalink / raw
  To: gentoo-commits

commit:     339b0ac7f3b1f5e82b427a3cde6c021c406d5b71
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Thu Sep 22 02:04:11 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 03:01:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=339b0ac7

Make --binpkg-respect-use=y the default

Explicitly stating --binpkg-respect-use=y will disable the ignored
binary warning. This will fix bug #297549.

---
 pym/_emerge/depgraph.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b10efd6..e8d96f4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -551,7 +551,8 @@ class depgraph(object):
 		match the user's config.
 		"""
 		if not self._dynamic_config.ignored_binaries \
-			or '--quiet' in self._frozen_config.myopts:
+			or '--quiet' in self._frozen_config.myopts \
+			or "--binpkg-respect-use" in self._frozen_config.myopts:
 			return
 
 		self._show_merge_list()
@@ -569,7 +570,8 @@ class depgraph(object):
 		msg = [
 			"",
 			"NOTE: The --binpkg-respect-use=n option will prevent emerge",
-			"      from ignoring these binary packages if possible."
+			"      from ignoring these binary packages if possible.",
+			"      Using --binpkg-respect-use=y will silence this warning."
 		]
 
 		for line in msg:
@@ -794,7 +796,7 @@ class depgraph(object):
 		"""Return a set of flags that trigger reinstallation, or None if there
 		are no such flags."""
 		if "--newuse" in self._frozen_config.myopts or \
-			"--binpkg-respect-use" in self._frozen_config.myopts:
+			self._frozen_config.myopts.get("--binpkg-respect-use", True) == True:
 			flags = set(orig_iuse.symmetric_difference(
 				cur_iuse).difference(forced_flags))
 			flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
@@ -3965,7 +3967,7 @@ class depgraph(object):
 					if built and not useoldpkg and (not installed or matched_pkgs_ignore_use) and \
 						("--newuse" in self._frozen_config.myopts or \
 						"--reinstall" in self._frozen_config.myopts or \
-						"--binpkg-respect-use" in self._frozen_config.myopts):
+						self._frozen_config.myopts.get("--binpkg-respect-use", True) == True):
 						iuses = pkg.iuse.all
 						old_use = self._pkg_use_enabled(pkg)
 						if myeb:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-22 15:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-22 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     1ed746be090390bd698810081f30164094ea402d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 15:44:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 15:44:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ed746be

Tweak auto --binpkg-respect-use more.

We don't want to check for --rebuilt-binaries here, unless --usepkg
is also enabled. In fact, we can skip the --rebuilt-binaries check
since people who really want to ensure that binary packages are used
as much as possible will typically specify --usepkgonly (or
--getbinpkgonly which implies --usepkgonly).

---
 pym/_emerge/create_depgraph_params.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index d94ad89..42983fe 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -67,8 +67,7 @@ def create_depgraph_params(myopts, myaction):
 	binpkg_respect_use = myopts.get('--binpkg-respect-use')
 	if binpkg_respect_use is not None:
 		myparams['binpkg_respect_use'] = binpkg_respect_use
-	elif '--usepkgonly' not in myopts and \
-		myopts.get('--rebuilt-binaries') is not True:
+	elif '--usepkgonly' not in myopts:
 		# If --binpkg-respect-use is not explicitly specified, we enable
 		# the behavior automatically (like requested in bug #297549), as
 		# long as it doesn't strongly conflict with other options that



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-23  4:04 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-09-23  4:04 UTC (permalink / raw
  To: gentoo-commits

commit:     46d40215f2b7fafc7a78acc0ee2ccc53ade846b0
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Fri Sep 23 04:03:38 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 04:03:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=46d40215

Fix a typo.

---
 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 a4f6c3d..00d9628 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -547,7 +547,7 @@ class depgraph(object):
 
 	def _show_ignored_binaries(self):
 		"""
-		Show binaries that have been ignored becaue their USE didn't
+		Show binaries that have been ignored because their USE didn't
 		match the user's config.
 		"""
 		if not self._dynamic_config.ignored_binaries \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-28  5:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-28  5:26 UTC (permalink / raw
  To: gentoo-commits

commit:     28ce242ff1bf55605227b1877aaba0b76388714c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 28 05:26:27 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 28 05:26:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=28ce242f

depgraph: handle unicode exception for bug 384749

---
 pym/_emerge/depgraph.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 00d9628..f9f4954 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4480,7 +4480,7 @@ class depgraph(object):
 							# matches (this can happen if an atom lacks a
 							# category).
 							show_invalid_depstring_notice(
-								pkg, depstr, str(e))
+								pkg, depstr, _unicode_decode("%s") % (e,))
 							del e
 							raise
 						if not success:
@@ -4511,7 +4511,8 @@ class depgraph(object):
 						except portage.exception.InvalidAtom as e:
 							depstr = " ".join(vardb.aux_get(pkg.cpv, dep_keys))
 							show_invalid_depstring_notice(
-								pkg, depstr, "Invalid Atom: %s" % (e,))
+								pkg, depstr,
+								_unicode_decode("Invalid Atom: %s") % (e,))
 							return False
 				for cpv in stale_cache:
 					del blocker_cache[cpv]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-29  1:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-29  1:11 UTC (permalink / raw
  To: gentoo-commits

commit:     abcf9f8b8fcc7daacafc8284a580436d94e1668f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 01:10:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 01:10:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=abcf9f8b

depgraph: verify "missed updates"

Since the change involving slot conflict parent atoms in commit
6cea2091526659521d35be6c8dc7733f69f1a760, we want to check to make
sure we don't display any false positives in the "missed updates".

---
 pym/_emerge/depgraph.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f9f4954..b58b76f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -591,6 +591,10 @@ class depgraph(object):
 				# Exclude installed here since we only
 				# want to show available updates.
 				continue
+			chosen_pkg, existing_node = \
+				self._select_package(pkg.root, pkg.slot_atom)
+			if chosen_pkg >= pkg:
+				continue
 			k = (pkg.root, pkg.slot_atom)
 			if k in missed_updates:
 				other_pkg, mask_type, parent_atoms = missed_updates[k]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-29  1:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-29  1:42 UTC (permalink / raw
  To: gentoo-commits

commit:     20119771015247be5a7143ff73f00ec52f9e83cb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 01:41:22 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 01:41:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=20119771

tweak "missed updates" code from last commit

---
 pym/_emerge/depgraph.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b58b76f..da61709 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -591,9 +591,9 @@ class depgraph(object):
 				# Exclude installed here since we only
 				# want to show available updates.
 				continue
-			chosen_pkg, existing_node = \
-				self._select_package(pkg.root, pkg.slot_atom)
-			if chosen_pkg >= pkg:
+			chosen_pkg = self._dynamic_config.mydbapi[pkg.root
+				].match_pkgs(pkg.slot_atom)
+			if not chosen_pkg or chosen_pkg[-1] >= pkg:
 				continue
 			k = (pkg.root, pkg.slot_atom)
 			if k in missed_updates:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-09-30 17:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-09-30 17:04 UTC (permalink / raw
  To: gentoo-commits

commit:     c2efbad8402a7e8904c7353a9930e87ea128b962
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 30 17:04:11 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 17:04:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2efbad8

depgraph: tweak virtual transition code

This fixes a false --binpkg-respect-use warning that's triggered by
erroneous USE/IUSE comparison between the new-style virtual and an
old-style virtual match.

---
 pym/_emerge/depgraph.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9638ce9..ad04551 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3689,6 +3689,8 @@ class depgraph(object):
 		if not isinstance(atom, portage.dep.Atom):
 			atom = portage.dep.Atom(atom)
 		atom_cp = atom.cp
+		have_new_virt = atom_cp.startswith("virtual/") and \
+			self._have_new_virt(root, atom_cp)
 		atom_set = InternalPackageSet(initial_atoms=(atom,), allow_repo=True)
 		existing_node = None
 		myeb = None
@@ -3736,6 +3738,9 @@ class depgraph(object):
 				# USE configuration.
 				for pkg in self._iter_match_pkgs(root_config, pkg_type, atom.without_use, 
 					onlydeps=onlydeps):
+					if pkg.cp != atom_cp and have_new_virt:
+						# pull in a new-style virtual instead
+						continue
 					if pkg in self._dynamic_config._runtime_pkg_mask:
 						# The package has been masked by the backtracking logic
 						continue
@@ -3954,11 +3959,6 @@ class depgraph(object):
 						if not e_pkg:
 							break
 
-						if e_pkg.cp != atom_cp and \
-							self._have_new_virt(root, atom_cp):
-							# pull in a new-style virtual instead
-							break
-
 						# Use PackageSet.findAtomForPackage()
 						# for PROVIDE support.
 						if atom_set.findAtomForPackage(e_pkg, modified_use=self._pkg_use_enabled(e_pkg)):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-02 20:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-02 20:22 UTC (permalink / raw
  To: gentoo-commits

commit:     77b651300731ec007cd535a83b8ee9a898602783
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  2 20:22:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  2 20:22:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=77b65130

Prefer slot conflict over blocker display.

The slot conflict display has better noise reduction than the
unsatisfied blockers display, so skip unsatisfied blockers display if
there are slot conflicts (see bug #385391). Note that this reverses
the logic from bug 159310, since the slot conflict display has evolved
a lot since then.

---
 pym/_emerge/depgraph.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ad04551..66cba04 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6170,13 +6170,14 @@ class depgraph(object):
 			self._show_circular_deps(
 				self._dynamic_config._circular_deps_for_display)
 
-		# The user is only notified of a slot conflict if
-		# there are no unresolvable blocker conflicts.
-		if self._dynamic_config._unsatisfied_blockers_for_display is not None:
+		# The slot conflict display has better noise reduction than
+		# the unsatisfied blockers display, so skip unsatisfied blockers
+		# display if there are slot conflicts (see bug #385391).
+		if self._dynamic_config._slot_collision_info:
+			self._show_slot_collision_notice()
+		elif self._dynamic_config._unsatisfied_blockers_for_display is not None:
 			self._show_unsatisfied_blockers(
 				self._dynamic_config._unsatisfied_blockers_for_display)
-		elif self._dynamic_config._slot_collision_info:
-			self._show_slot_collision_notice()
 		else:
 			self._show_missed_update()
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-10  0:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-10  0:05 UTC (permalink / raw
  To: gentoo-commits

commit:     6622bb5b63b49b1e528d89fee061e40b2d0d5afd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 00:05:23 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 00:05:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6622bb5b

show_ignored_binaries: filter noise, bug #386379

---
 pym/_emerge/depgraph.py |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 66cba04..a409bed 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -556,6 +556,32 @@ class depgraph(object):
 			"binpkg_respect_use") in ("y", "n"):
 			return
 
+		for pkg in list(self._dynamic_config.ignored_binaries):
+
+			selected_pkg = self._dynamic_config.mydbapi[pkg.root
+				].match_pkgs(pkg.slot_atom)
+
+			if not selected_pkg:
+				continue
+
+			selected_pkg = selected_pkg[-1]
+			if selected_pkg > pkg:
+				self._dynamic_config.ignored_binaries.pop(pkg)
+				continue
+
+			if selected_pkg.installed and \
+				selected_pkg.cpv == pkg.cpv and \
+				selected_pkg.metadata.get('BUILD_TIME') == \
+				pkg.metadata.get('BUILD_TIME'):
+				# We don't care about ignored binaries when an
+				# identical installed instance is selected to
+				# fill the slot.
+				self._dynamic_config.ignored_binaries.pop(pkg)
+				continue
+
+		if not self._dynamic_config.ignored_binaries:
+			return
+
 		self._show_merge_list()
 
 		writemsg("\n!!! The following binary packages have been ignored " + \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-10  0:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-10  0:16 UTC (permalink / raw
  To: gentoo-commits

commit:     7b2be36898ef04a8cef42dc41cbc162004f329c2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 00:15:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 00:15:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7b2be368

Skip PORTAGE_TMPDIR write check for fetchonly.

Bug #286201

---
 pym/_emerge/EbuildBuild.py |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 2b0f412..012a1ef 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -30,12 +30,13 @@ class EbuildBuild(CompositeTask):
 		pkg = self.pkg
 		settings = self.settings
 
-		rval = _check_temp_dir(settings)
-		if rval != os.EX_OK:
-			self.returncode = rval
-			self._current_task = None
-			self.wait()
-			return
+		if not self.opts.fetchonly:
+			rval = _check_temp_dir(settings)
+			if rval != os.EX_OK:
+				self.returncode = rval
+				self._current_task = None
+				self.wait()
+				return
 
 		root_config = pkg.root_config
 		tree = "porttree"



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-10 18:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-10 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     8b3e8d22a5b933b5aa7c0b6440ac1b3f29237f1d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 18:13:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 18:13:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8b3e8d22

Scheduler: fix myopts typo from last commit

---
 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 11a72f3..95cc104 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -304,7 +304,7 @@ class Scheduler(PollScheduler):
 		"""
 		self._set_graph_config(graph_config)
 		self._blocker_db = {}
-		dynamic_deps = myopts.get("--dynamic-deps", "y") != "n"
+		dynamic_deps = self.myopts.get("--dynamic-deps", "y") != "n"
 		for root in self.trees:
 			if graph_config is None:
 				fake_vartree = FakeVartree(self.trees[root]["root_config"],



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-10 18:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-10 18:20 UTC (permalink / raw
  To: gentoo-commits

commit:     2a43bc0ddaf1da858e3b50d36c722e58afa439f1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 18:20:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 18:20:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a43bc0d

FakeVartree: fix sync for --dynamic-deps=n

---
 pym/_emerge/FakeVartree.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index a9c1b90..cc33d2e 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -150,7 +150,8 @@ class FakeVartree(vartree):
 			self.dbapi.aux_get = self._aux_get
 			self.settings._populate_treeVirtuals_if_needed(self)
 		finally:
-			self.dbapi.aux_get = self._aux_get_wrapper
+			if dynamic_deps:
+				self.dbapi.aux_get = self._aux_get_wrapper
 
 	def _sync(self):
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-10 18:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-10 18:21 UTC (permalink / raw
  To: gentoo-commits

commit:     90e11a316c3f240e1cbeed7c9fec96049e14e6d9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 18:21:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 18:21:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=90e11a31

FakeVartree: type from last commit

---
 pym/_emerge/FakeVartree.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index cc33d2e..140208f 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -150,7 +150,7 @@ class FakeVartree(vartree):
 			self.dbapi.aux_get = self._aux_get
 			self.settings._populate_treeVirtuals_if_needed(self)
 		finally:
-			if dynamic_deps:
+			if self._dynamic_deps:
 				self.dbapi.aux_get = self._aux_get_wrapper
 
 	def _sync(self):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-10 19:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-10 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     743a52236f1aeadf5259c68867ea8aa22b53e8ae
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 19:33:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 19:33:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=743a5223

FakeVartree: disable match wrapper if necessary

---
 pym/_emerge/FakeVartree.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 140208f..ddec7c5 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -62,10 +62,10 @@ class FakeVartree(vartree):
 		# metadata.  This ensures that the vardb lock is released ASAP, without
 		# being delayed in case cache generation is triggered.
 		self._aux_get = self.dbapi.aux_get
+		self._match = self.dbapi.match
 		if dynamic_deps:
 			self.dbapi.aux_get = self._aux_get_wrapper
-		self._match = self.dbapi.match
-		self.dbapi.match = self._match_wrapper
+			self.dbapi.match = self._match_wrapper
 		self._aux_get_history = set()
 		self._portdb_keys = ["EAPI", "DEPEND", "RDEPEND", "PDEPEND"]
 		self._portdb = portdb



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-15 19:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-15 19:34 UTC (permalink / raw
  To: gentoo-commits

commit:     ff98e89d26d4e0d4436473d9c9afab8f01c448f5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 19:34:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 19:34:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ff98e89d

EbuildMetadataPhase: use b''.join() for bytes

---
 pym/_emerge/EbuildMetadataPhase.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index aeff2f0..95729e8 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -118,9 +118,9 @@ class EbuildMetadataPhase(SubProcess):
 	def _set_returncode(self, wait_retval):
 		SubProcess._set_returncode(self, wait_retval)
 		if self.returncode == os.EX_OK:
-			metadata_lines = ''.join(_unicode_decode(chunk,
-				encoding=_encodings['repo.content'], errors='replace')
-				for chunk in self._raw_metadata).splitlines()
+			metadata_lines = _unicode_decode(b''.join(self._raw_metadata),
+				encoding=_encodings['repo.content'],
+				errors='replace').splitlines()
 			if len(portage.auxdbkeys) != len(metadata_lines):
 				# Don't trust bash's returncode if the
 				# number of lines is incorrect.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-15 22:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-15 22:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9f7aba55758ba93414ed07c58a0129178188c31b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 22:46:37 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 22:46:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f7aba55

EbuildMetadataPhase: fix broken _metadata_callback

This fixes a regression in FEATURES=parse-eapi-ebuild-head support
for egencache since commit 2ed1cb53cc4158af08c22d466b15b9a9a7767212.

---
 pym/_emerge/EbuildMetadataPhase.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 95729e8..a6630ad 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -44,8 +44,8 @@ class EbuildMetadataPhase(SubProcess):
 
 		if eapi is not None:
 			if not portage.eapi_is_supported(eapi):
-				self.metadata_callback(self.cpv, ebuild_path,
-					self.repo_path, {'EAPI' : eapi}, self.ebuild_hash.mtime)
+				self.metadata_callback(self.cpv,
+					self.repo_path, {'EAPI' : eapi}, self.ebuild_hash)
 				self._set_returncode((self.pid, os.EX_OK << 8))
 				self.wait()
 				return



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-15 22:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-15 22:56 UTC (permalink / raw
  To: gentoo-commits

commit:     0a60f0a859994ca2ed51aa0b20454743f970b956
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 22:55:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 22:55:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0a60f0a8

EbuildMetadataPhase: fix parse-eapi-ebuild-head

This fixes bugs that can only be triggered by egencache since
other callers handle parse-eapi-ebuild-head earlier.

---
 pym/_emerge/EbuildMetadataPhase.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index a6630ad..6ef7c00 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -44,8 +44,9 @@ class EbuildMetadataPhase(SubProcess):
 
 		if eapi is not None:
 			if not portage.eapi_is_supported(eapi):
+				self.metadata = {'EAPI' : eapi}
 				self.metadata_callback(self.cpv,
-					self.repo_path, {'EAPI' : eapi}, self.ebuild_hash)
+					self.repo_path, self.metadata, self.ebuild_hash)
 				self._set_returncode((self.pid, os.EX_OK << 8))
 				self.wait()
 				return
@@ -117,7 +118,11 @@ class EbuildMetadataPhase(SubProcess):
 
 	def _set_returncode(self, wait_retval):
 		SubProcess._set_returncode(self, wait_retval)
-		if self.returncode == os.EX_OK:
+		# self._raw_metadata is None when _start returns
+		# early due to an unsupported EAPI detected with
+		# FEATURES=parse-eapi-ebuild-head
+		if self.returncode == os.EX_OK and \
+			self._raw_metadata is not None:
 			metadata_lines = _unicode_decode(b''.join(self._raw_metadata),
 				encoding=_encodings['repo.content'],
 				errors='replace').splitlines()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-15 23:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-15 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     accfa9e43415d5fb54d98786859c444685ed1e4a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 23:28:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 23:28:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=accfa9e4

EbuildMetadataPhase: tweak metadata_callback usage

For parse-eapi-ebuild-head, we want to assign self.metadata from the
return value, for conformity with usage elsewhere.

---
 pym/_emerge/EbuildMetadataPhase.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 6ef7c00..2fbd29e 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -44,9 +44,8 @@ class EbuildMetadataPhase(SubProcess):
 
 		if eapi is not None:
 			if not portage.eapi_is_supported(eapi):
-				self.metadata = {'EAPI' : eapi}
-				self.metadata_callback(self.cpv,
-					self.repo_path, self.metadata, self.ebuild_hash)
+				self.metadata = self.metadata_callback(self.cpv,
+					self.repo_path, {'EAPI' : eapi}, self.ebuild_hash)
 				self._set_returncode((self.pid, os.EX_OK << 8))
 				self.wait()
 				return



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-16  0:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-16  0:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c670edc7b035fdce9d45df9d4e63d6afddba115c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 16 00:34:06 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 16 00:34:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c670edc7

MetadataRegen: remove unused import

---
 pym/_emerge/MetadataRegen.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index b338056..813ebc9 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -3,7 +3,6 @@
 
 import portage
 from portage import os
-from portage.eclass_cache import hashed_path
 from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
 from _emerge.PollScheduler import PollScheduler
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-20 16:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-20 16:30 UTC (permalink / raw
  To: gentoo-commits

commit:     273075cdf5fcd0b4756ca47860849f174f7ede57
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 16:29:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 16:29:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=273075cd

depgraph: fix installed masked warning

This warning has been broken since commit
5f65c2294df592a6a4e0f0fff0bedec49ed3491a.

---
 pym/_emerge/depgraph.py |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ab62dc7..1630a72 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3526,18 +3526,18 @@ class depgraph(object):
 
 		return pkg, existing
 
-	def _pkg_visibility_check(self, pkg, allow_unstable_keywords=False, allow_license_changes=False, allow_unmasks=False):
+	def _pkg_visibility_check(self, pkg, allow_unstable_keywords=False,
+		allow_license_changes=False, allow_unmasks=False, trust_graph=True):
 
 		if pkg.visible:
 			return True
 
-		if pkg in self._dynamic_config.digraph:
+		if trust_graph and 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.
+			# consistency in dependency resolution, in most
+			# cases we want to treat packages in the graph
+			# as though they are visible.
 			return True
 
 		if not self._dynamic_config._autounmask:
@@ -4446,7 +4446,8 @@ class depgraph(object):
 					# packages masked by license, since the user likely wants
 					# to adjust ACCEPT_LICENSE.
 					if pkg in final_db:
-						if not self._pkg_visibility_check(pkg) and \
+						if not self._pkg_visibility_check(pkg,
+							trust_graph=False) and \
 							(pkg_in_graph or 'LICENSE' in pkg.masks):
 							self._dynamic_config._masked_installed.add(pkg)
 						else:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-23 18:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-23 18:53 UTC (permalink / raw
  To: gentoo-commits

commit:     cb4cd5025405b28f76b3487f5eec82590e2cabdb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 23 18:51:43 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 23 18:51:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb4cd502

Skip global updates prior to sync (called after).

---
 pym/_emerge/main.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 26f3766..b170ea3 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1611,7 +1611,8 @@ def emerge_main(args=None):
 	tmpcmdline.extend(args)
 	myaction, myopts, myfiles = parse_opts(tmpcmdline)
 
-	if myaction not in ('help', 'info', 'version') and \
+	# skip global updates prior to sync, since it's called after sync
+	if myaction not in ('help', 'info', 'sync', 'version') and \
 		myopts.get('--package-moves') != 'n' and \
 		_global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
 		mtimedb.commit()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-25  6:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-25  6:18 UTC (permalink / raw
  To: gentoo-commits

commit:     f38b20284d42b046b771510583a27cc05e3846ed
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 25 06:18:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 06:18:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f38b2028

Remove unused root parameters from doebuild calls

---
 pym/_emerge/EbuildFetchonly.py     |    4 ++--
 pym/_emerge/EbuildMetadataPhase.py |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/EbuildFetchonly.py b/pym/_emerge/EbuildFetchonly.py
index b898971..d0f954c 100644
--- a/pym/_emerge/EbuildFetchonly.py
+++ b/pym/_emerge/EbuildFetchonly.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.SlotObject import SlotObject
@@ -21,7 +21,7 @@ class EbuildFetchonly(SlotObject):
 		debug = settings.get("PORTAGE_DEBUG") == "1"
 
 		rval = portage.doebuild(ebuild_path, "fetch",
-			settings["ROOT"], settings, debug=debug,
+			settings=settings, debug=debug,
 			listonly=self.pretend, fetchonly=1, fetchall=self.fetch_all,
 			mydbapi=portdb, tree="porttree")
 

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index aa26e19..bf562c5 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -91,7 +91,7 @@ class EbuildMetadataPhase(SubProcess):
 		self._registered = True
 
 		retval = portage.doebuild(ebuild_path, "depend",
-			settings["ROOT"], settings, debug,
+			settings=settings, debug=debug,
 			mydbapi=self.portdb, tree="porttree",
 			fd_pipes=fd_pipes, returnpid=True)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-27 16:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-27 16:46 UTC (permalink / raw
  To: gentoo-commits

commit:     34acc9e79a941cac9591c6ae723e73054141e2e7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 16:46:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 16:46:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=34acc9e7

fix previous commit to call ensure_dirs

---
 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 2244083..729b2d7 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -28,7 +28,7 @@ from portage.output import colorize, create_color_func, red
 bad = create_color_func("BAD")
 from portage._sets import SETPREFIX
 from portage._sets.base import InternalPackageSet
-from portage.util import writemsg, writemsg_level
+from portage.util import ensure_dirs, writemsg, writemsg_level
 from portage.package.ebuild.digestcheck import digestcheck
 from portage.package.ebuild.digestgen import digestgen
 from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
@@ -917,6 +917,7 @@ class Scheduler(PollScheduler):
 			settings.setcpv(x)
 			tmpdir_orig = settings["PORTAGE_TMPDIR"]
 			build_prefix_orig = os.path.join(tmpdir_orig, 'portage')
+			ensure_dirs(build_prefix_orig)
 			tmpdir = tempfile.mkdtemp(dir=build_prefix_orig)
 			settings["PORTAGE_TMPDIR"] = tmpdir
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29  3:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29  3:10 UTC (permalink / raw
  To: gentoo-commits

commit:     f935a5e7eb8e96adceaea78c29874e83f6c9ec15
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 03:10:23 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 03:10:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f935a5e7

Use any() instead of list(filter()).

---
 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 162f70f..52e4c42 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1733,7 +1733,7 @@ def emerge_main(args=None):
 		news_counts = count_unread_news(
 			root_config.trees["porttree"].dbapi,
 			root_config.trees["vartree"].dbapi)
-		if list(filter(None, news_counts.values())):
+		if any(news_counts.values()):
 			display_news_notifications(news_counts)
 		elif "--quiet" not in myopts:
 			print("", colorize("GOOD", "*"), "No news items were found.")



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29  6:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29  6:57 UTC (permalink / raw
  To: gentoo-commits

commit:     f43280c4d8d35f02c322e88c2d97e368303d5c1a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 06:57:29 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 06:57:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f43280c4

git_sync_timestamps: fix breakage

This has been broken since metadbmodule support was removed in commit
d4ea29bf6a3ce35d49e0f54f9173e3a6e42da2d6.

---
 pym/_emerge/actions.py |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index d482e0b..de5275d 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2011,7 +2011,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 		msg = ">>> Git pull in %s successful" % myportdir
 		emergelog(xterm_titles, msg)
 		writemsg_level(msg + "\n")
-		exitcode = git_sync_timestamps(settings, myportdir)
+		exitcode = git_sync_timestamps(portdb, myportdir)
 		if exitcode == os.EX_OK:
 			updatecache_flg = True
 	elif syncuri[:8]=="rsync://" or syncuri[:6]=="ssh://":
@@ -2844,27 +2844,36 @@ def getportageversion(portdir, _unused, profile, chost, vardb):
 	return "Portage %s (%s, %s, %s, %s)" % \
 		(portage.VERSION, profilever, gccver, ",".join(libcver), unameout)
 
-def git_sync_timestamps(settings, portdir):
+def git_sync_timestamps(portdb, portdir):
 	"""
 	Since git doesn't preserve timestamps, synchronize timestamps between
 	entries and ebuilds/eclasses. Assume the cache has the correct timestamp
 	for a given file as long as the file in the working tree is not modified
 	(relative to HEAD).
 	"""
-	cache_dir = os.path.join(portdir, "metadata", "cache")
-	if not os.path.isdir(cache_dir):
-		return os.EX_OK
-	writemsg_level(">>> Synchronizing timestamps...\n")
 
-	from portage.cache.cache_errors import CacheError
+	cache_db = portdb._pregen_auxdb.get(portdir)
+
 	try:
-		cache_db = settings.load_best_module("portdbapi.metadbmodule")(
-			portdir, "metadata/cache", portage.auxdbkeys[:], readonly=True)
+		if cache_db is None:
+			# portdbapi does not populate _pregen_auxdb
+			# when FEATURES=metadata-transfer is enabled
+			cache_db = portdb._create_pregen_cache(portdir)
 	except CacheError as e:
 		writemsg_level("!!! Unable to instantiate cache: %s\n" % (e,),
 			level=logging.ERROR, noiselevel=-1)
 		return 1
 
+	if cache_db is None:
+		return os.EX_OK
+
+	from portage.cache.metadata import database as pms_database
+	if not isinstance(cache_db, pms_database):
+		# newer formats like md5-dict do not require mtime sync
+		return os.EX_OK
+
+	writemsg_level(">>> Synchronizing timestamps...\n")
+
 	ec_dir = os.path.join(portdir, "eclass")
 	try:
 		ec_names = set(f[:-7] for f in os.listdir(ec_dir) \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29 17:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29 17:51 UTC (permalink / raw
  To: gentoo-commits

commit:     412f6cc18ea06987fda0c6e4c05aee5e6d1a2f08
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 17:48:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 17:48:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=412f6cc1

emerge --metadata: support md5-dict

This adds support to action_metadata() for use of arbitrary validation
methods, which were introduced in commit
2ed1cb53cc4158af08c22d466b15b9a9a7767212.

---
 pym/_emerge/actions.py |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index de5275d..610a6c4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -5,6 +5,7 @@ from __future__ import print_function
 
 import errno
 import logging
+import operator
 import platform
 import pwd
 import random
@@ -34,6 +35,7 @@ from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.dep import Atom, extended_cp_match
+from portage.eclass_cache import hashed_path
 from portage.exception import InvalidAtom
 from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
 	red, yellow
@@ -1719,6 +1721,13 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 
 	for cp in cp_all:
 		for tree_data in porttrees_data:
+
+			src_chf = tree_data.src_db.validation_chf
+			src_chf_key = '_%s_' % src_chf
+			dest_chf = tree_data.dest_db.validation_chf
+			dest_chf_key = '_%s_' % dest_chf
+			dest_chf_getter = operator.attrgetter(dest_chf)
+
 			for cpv in portdb.cp_list(cp, mytree=tree_data.path):
 				tree_data.valid_nodes.add(cpv)
 				try:
@@ -1726,6 +1735,11 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 				except (CacheError, KeyError):
 					continue
 
+				ebuild_location = portdb.findname(cpv, mytree=tree_data.path)
+				if ebuild_location is None:
+					continue
+				ebuild_hash = hashed_path(ebuild_location)
+
 				eapi = src.get('EAPI')
 				if not eapi:
 					eapi = '0'
@@ -1745,8 +1759,17 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					if d is not None and d.get('EAPI') in ('', '0'):
 						del d['EAPI']
 
+				if src_chf != 'mtime':
+					# src may contain an irrelevant _mtime_ which corresponds
+					# to the time that the cache entry was written
+					src.pop('_mtime_', None)
+
+				if src_chf != dest_chf:
+					# populate src entry with dest_chf_key
+					src[dest_chf_key] = dest_chf_getter(ebuild_hash)
+
 				if dest is not None:
-					if not (dest['_mtime_'] == src['_mtime_'] and \
+					if not (dest[dest_chf_key] == src[dest_chf_key] and \
 						tree_data.eclass_db.validate_and_rewrite_cache(
 							dest['_eclasses_'], tree_data.dest_db.validation_chf,
 							tree_data.dest_db.store_eclass_paths) is not None and \
@@ -1756,8 +1779,13 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 						# We don't want to skip the write unless we're really
 						# sure that the existing cache is identical, so don't
 						# trust _mtime_ and _eclasses_ alone.
-						for k in set(chain(src, dest)).difference(
-							('_mtime_', '_eclasses_')):
+						keys = set()
+						keys.update(src)
+						keys.update(dest)
+						keys.discard('_eclasses_')
+						keys.discard('_mtime_')
+						keys.discard(src_chf_key)
+						for k in keys:
 							if dest.get(k, '') != src.get(k, ''):
 								dest = None
 								break
@@ -1804,7 +1832,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 				if not eapi_supported:
 					src = {
 						'EAPI'       : '-' + eapi,
-						'_mtime_'    : src['_mtime_'],
+						dest_chf_key : src[dest_chf_key],
 						'_eclasses_' : src['_eclasses_'],
 					}
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29 20:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29 20:55 UTC (permalink / raw
  To: gentoo-commits

commit:     d6bce25590c9b351fe833056a89c1dd0fc91ba47
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 20:55:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 20:55:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d6bce255

action_metadata: use auxdbkeys to compare entries

This borrows the approach that egencache uses since commit
0e120da008c9d0d41c9372c81145c6e153028a6d.

---
 pym/_emerge/actions.py |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 610a6c4..6ccf894 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1779,13 +1779,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 						# We don't want to skip the write unless we're really
 						# sure that the existing cache is identical, so don't
 						# trust _mtime_ and _eclasses_ alone.
-						keys = set()
-						keys.update(src)
-						keys.update(dest)
-						keys.discard('_eclasses_')
-						keys.discard('_mtime_')
-						keys.discard(src_chf_key)
-						for k in keys:
+						for k in auxdbkeys:
 							if dest.get(k, '') != src.get(k, ''):
 								dest = None
 								break



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29 21:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29 21:31 UTC (permalink / raw
  To: gentoo-commits

commit:     d40181d1760b3d04788884f7907c8ded18c0bd1c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 21:31:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 21:31:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d40181d1

actions.py: remove unused variables

---
 pym/_emerge/actions.py |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6ccf894..28fe549 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1145,7 +1145,6 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 
 		for node in clean_set:
 			graph.add(node, None)
-			mydeps = []
 			for dep_type in dep_keys:
 				depstr = node.metadata[dep_type]
 				if not depstr:
@@ -1434,8 +1433,6 @@ def action_info(settings, trees, myopts, myfiles):
 		append("%s %s" % \
 			((cp + ":").ljust(cp_max_len + 1), versions))
 
-	libtool_vers = ",".join(vardb.match("sys-devel/libtool"))
-
 	repos = portdb.settings.repositories
 	if "--verbose" in myopts:
 		append("Repositories:\n")
@@ -1472,9 +1469,6 @@ def action_info(settings, trees, myopts, myfiles):
 	myvars = portage.util.unique_array(myvars)
 	use_expand = settings.get('USE_EXPAND', '').split()
 	use_expand.sort()
-	use_expand_hidden = set(
-		settings.get('USE_EXPAND_HIDDEN', '').upper().split())
-	alphabetical_use = '--alphabetical' in myopts
 	unset_vars = []
 	myvars.sort()
 	for k in myvars:
@@ -1551,7 +1545,6 @@ def action_info(settings, trees, myopts, myfiles):
 		mydesiredvars = [ 'CHOST', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS' ]
 		auxkeys = mydesiredvars + list(vardb._aux_cache_keys)
 		auxkeys.append('DEFINED_PHASES')
-		global_vals = {}
 		pkgsettings = portage.config(clone=settings)
 
 		# Loop through each package
@@ -1723,7 +1716,6 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 		for tree_data in porttrees_data:
 
 			src_chf = tree_data.src_db.validation_chf
-			src_chf_key = '_%s_' % src_chf
 			dest_chf = tree_data.dest_db.validation_chf
 			dest_chf_key = '_%s_' % dest_chf
 			dest_chf_getter = operator.attrgetter(dest_chf)
@@ -1874,7 +1866,7 @@ def action_regen(settings, portdb, max_jobs, max_load):
 	#regenerate cache entries
 	try:
 		os.close(sys.stdin.fileno())
-	except SystemExit as e:
+	except SystemExit:
 		raise # Needed else can't exit
 	except:
 		pass



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29 21:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29 21:41 UTC (permalink / raw
  To: gentoo-commits

commit:     1811def4b0ebc8af2280dde7f84331301b4eddd3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 21:41:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 21:41:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1811def4

EbuildMetadataPhase: use /dev/null for stdin

---
 pym/_emerge/EbuildMetadataPhase.py |    4 +++-
 pym/_emerge/actions.py             |    6 ------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index bf562c5..16948df 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -63,7 +63,8 @@ class EbuildMetadataPhase(SubProcess):
 		else:
 			fd_pipes = {}
 
-		fd_pipes.setdefault(0, sys.stdin.fileno())
+		null_input = open('/dev/null', 'rb')
+		fd_pipes.setdefault(0, null_input.fileno())
 		fd_pipes.setdefault(1, sys.stdout.fileno())
 		fd_pipes.setdefault(2, sys.stderr.fileno())
 
@@ -96,6 +97,7 @@ class EbuildMetadataPhase(SubProcess):
 			fd_pipes=fd_pipes, returnpid=True)
 
 		os.close(slave_fd)
+		null_input.close()
 
 		if isinstance(retval, int):
 			# doebuild failed before spawning

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 28fe549..036b471 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1864,12 +1864,6 @@ def action_regen(settings, portdb, max_jobs, max_load):
 	xterm_titles = "notitles" not in settings.features
 	emergelog(xterm_titles, " === regen")
 	#regenerate cache entries
-	try:
-		os.close(sys.stdin.fileno())
-	except SystemExit:
-		raise # Needed else can't exit
-	except:
-		pass
 	sys.stdout.flush()
 
 	regen = MetadataRegen(portdb, max_jobs=max_jobs, max_load=max_load)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-29 22:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-29 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     fea1962b7e8df9a8568b009a8f52b3c8ade67043
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 22:43:35 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 22:43:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fea1962b

action_metadata: clean up src entry validation

This eliminates a bunch of redundant eclasses code that we handle with
template.validate_entry() instead.

---
 pym/_emerge/actions.py |   44 ++++++++++----------------------------------
 1 files changed, 10 insertions(+), 34 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 036b471..7a1bcb5 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1732,6 +1732,13 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					continue
 				ebuild_hash = hashed_path(ebuild_location)
 
+				try:
+					if not tree_data.src_db.validate_entry(src,
+						ebuild_hash, tree_data.eclass_db):
+						continue
+				except CacheError:
+					continue
+
 				eapi = src.get('EAPI')
 				if not eapi:
 					eapi = '0'
@@ -1758,6 +1765,9 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 
 				if src_chf != dest_chf:
 					# populate src entry with dest_chf_key
+					# (the validity of the dest_chf that we generate from the
+					# ebuild here relies on the fact that we already used
+					# validate_entry to validate the ebuild with src_chf)
 					src[dest_chf_key] = dest_chf_getter(ebuild_hash)
 
 				if dest is not None:
@@ -1781,40 +1791,6 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					# so there's no need to overwrite it.
 					continue
 
-				try:
-					inherited = src.get('INHERITED', '')
-					eclasses = src.get('_eclasses_')
-				except CacheError:
-					continue
-
-				if eclasses is not None:
-					if tree_data.eclass_db.validate_and_rewrite_cache(
-						src['_eclasses_'], tree_data.src_db.validation_chf,
-						tree_data.src_db.store_eclass_paths) is None:
-						continue
-					inherited = eclasses
-				else:
-					inherited = inherited.split()
-
-				if tree_data.src_db.complete_eclass_entries and \
-					eclasses is None:
-					continue
-
-				if inherited:
-					# Even if _eclasses_ already exists, replace it with data from
-					# eclass_cache, in order to insert local eclass paths.
-					try:
-						eclasses = tree_data.eclass_db.get_eclass_data(inherited)
-					except KeyError:
-						# INHERITED contains a non-existent eclass.
-						continue
-
-					if eclasses is None:
-						continue
-					src['_eclasses_'] = eclasses
-				else:
-					src['_eclasses_'] = {}
-
 				if not eapi_supported:
 					src = {
 						'EAPI'       : '-' + eapi,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-10-30  6:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-10-30  6:21 UTC (permalink / raw
  To: gentoo-commits

commit:     102d958c4017854965229d186fbaaf6167c9d2f2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 30 06:20:53 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 30 06:20:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=102d958c

git_sync_timestamps: validation_chf == mtime

---
 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 911d5ec..af3780e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2850,8 +2850,7 @@ def git_sync_timestamps(portdb, portdir):
 	if cache_db is None:
 		return os.EX_OK
 
-	from portage.cache.metadata import database as pms_database
-	if not isinstance(cache_db, pms_database):
+	if cache_db.validation_chf != 'mtime':
 		# newer formats like md5-dict do not require mtime sync
 		return os.EX_OK
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-07  6:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-07  6:02 UTC (permalink / raw
  To: gentoo-commits

commit:     9929eaf3e50897c814062bec5a704898e085d048
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 06:01:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 06:01:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9929eaf3

Add emerge --moo action for bug #389609.

---
 pym/_emerge/main.py |   41 +++++++++++++++++++++++++----------------
 1 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 52e4c42..d4a6bd3 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -97,6 +97,21 @@ shortmapping={
 "v":"--verbose",   "V":"--version"
 }
 
+COWSAY_MOO = """
+
+  Larry loves Gentoo (%s)
+
+ _______________________
+< Have you mooed today? >
+ -----------------------
+        \   ^__^
+         \  (oo)\_______
+            (__)\       )\/\ 
+                ||----w |
+                ||     ||
+
+"""
+
 def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
 
 	if os.path.exists("/usr/bin/install-info"):
@@ -592,7 +607,7 @@ def parse_opts(tmpcmdline, silent=False):
 
 	actions = frozenset([
 		"clean", "check-news", "config", "depclean", "help",
-		"info", "list-sets", "metadata",
+		"info", "list-sets", "metadata", "moo",
 		"prune", "regen",  "search",
 		"sync",  "unmerge", "version",
 	])
@@ -1704,20 +1719,11 @@ def emerge_main(args=None):
 	del mytrees, mydb
 
 	if "moo" in myfiles:
-		print("""
-
-  Larry loves Gentoo (""" + platform.system() + """)
-
- _______________________
-< Have you mooed today? >
- -----------------------
-        \   ^__^
-         \  (oo)\_______
-            (__)\       )\/\ 
-                ||----w |
-                ||     ||
-
-""")
+		print(COWSAY_MOO % platform.system())
+		msg = ("The above `emerge moo` display is deprecated. "
+			"Please use `emerge --moo` instead.")
+		for line in textwrap.wrap(msg, 50):
+			print(" %s %s" % (colorize("WARN", "*"), line))
 
 	for x in myfiles:
 		ext = os.path.splitext(x)[1]
@@ -1726,7 +1732,10 @@ def emerge_main(args=None):
 			break
 
 	root_config = trees[settings['EROOT']]['root_config']
-	if myaction == "list-sets":
+	if myaction == "moo":
+		print(COWSAY_MOO % platform.system())
+		return os.EX_OK
+	elif myaction == "list-sets":
 		writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
 		return os.EX_OK
 	elif myaction == "check-news":



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-07  6:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-07  6:32 UTC (permalink / raw
  To: gentoo-commits

commit:     618115ef705d495d199449bfbc9c6135a8f58f94
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 06:32:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 06:32:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=618115ef

Respect --usepkgonly in suggestions, bug #389617

---
 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 fcdcc6c..0848640 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3270,7 +3270,8 @@ class depgraph(object):
 
 				all_cp = set()
 				all_cp.update(vardb.cp_all())
-				all_cp.update(portdb.cp_all())
+				if "--usepkgonly" not in self._frozen_config.myopts:
+					all_cp.update(portdb.cp_all())
 				if "--usepkg" in self._frozen_config.myopts:
 					all_cp.update(bindb.cp_all())
 				# discard dir containing no ebuilds



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-07 20:13 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-11-07 20:13 UTC (permalink / raw
  To: gentoo-commits

commit:     36bdacd2807d0ab6cfecc590426df52c7b1c29d8
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Nov  7 20:11:31 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 20:11:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=36bdacd2

Allow repository dependencies in command line arguments for --config and --info actions.

---
 pym/_emerge/actions.py |    2 +-
 pym/_emerge/main.py    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index af3780e..4a72ff4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -461,7 +461,7 @@ def action_config(settings, trees, myopts, myfiles):
 	if len(myfiles) != 1:
 		print(red("!!! config can only take a single package atom at this time\n"))
 		sys.exit(1)
-	if not is_valid_package_atom(myfiles[0]):
+	if not is_valid_package_atom(myfiles[0], allow_repo=True):
 		portage.writemsg("!!! '%s' is not a valid package atom.\n" % myfiles[0],
 			noiselevel=-1)
 		portage.writemsg("!!! Please check ebuild(5) for full details.\n")

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index d4a6bd3..e2e12c6 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1962,7 +1962,7 @@ def emerge_main(args=None):
 		bindb = trees[settings['EROOT']]["bintree"].dbapi
 		valid_atoms = []
 		for x in myfiles:
-			if is_valid_package_atom(x):
+			if is_valid_package_atom(x, allow_repo=True):
 				try:
 					#look at the installed files first, if there is no match
 					#look at the ebuilds, since EAPI 4 allows running pkg_info



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-07 21:15 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-11-07 21:15 UTC (permalink / raw
  To: gentoo-commits

commit:     7d70300bf7feb9c89470f6bb83c7324dee1074d4
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Nov  7 21:14:39 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 21:14:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d70300b

depgraph._queue_disjunctive_deps(): Pass EAPI to portage.dep.Atom().

---
 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 2ff6acb..301b252 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1855,7 +1855,7 @@ class depgraph(object):
 				i += 1
 			else:
 				try:
-					x = portage.dep.Atom(x)
+					x = portage.dep.Atom(x, eapi=pkg.metadata["EAPI"])
 				except portage.exception.InvalidAtom:
 					if not pkg.installed:
 						raise portage.exception.InvalidDependString(



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-09  3:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-09  3:23 UTC (permalink / raw
  To: gentoo-commits

commit:     6245e82305818d36eaa0a5392cb78de791f5e00a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 03:23:22 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 03:23:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6245e823

depgraph: fix possible REQUIRED_USE KeyError

This goes with commit a0961708ced50c90497811058eda6f4513d2986d.

---
 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 301b252..2296aa0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3114,7 +3114,7 @@ class depgraph(object):
 					if untouchable_flags.intersection(involved_flags):
 						continue
 
-					required_use = myparent.metadata["REQUIRED_USE"]
+					required_use = myparent.metadata.get("REQUIRED_USE")
 					required_use_warning = ""
 					if required_use:
 						old_use = self._pkg_use_enabled(myparent)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-09 18:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-09 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     f363a020a74df08d46dd4fa8b43a5fab85034951
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  9 18:13:17 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov  9 18:13:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f363a020

Use get(REQUIRED_USE) for emphasis.

None of these cases should raise KeyError, but use get(REQUIRED_USE)
anyway to emphasize that care must be taken.

---
 pym/_emerge/depgraph.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2296aa0..fda335f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1089,7 +1089,7 @@ class depgraph(object):
 		# package selection, since we want to prompt the user
 		# for USE adjustment rather than have REQUIRED_USE
 		# affect package selection and || dep choices.
-		if not pkg.built and pkg.metadata["REQUIRED_USE"] and \
+		if not pkg.built and pkg.metadata.get("REQUIRED_USE") and \
 			eapi_has_required_use(pkg.metadata["EAPI"]):
 			required_use_is_sat = check_required_use(
 				pkg.metadata["REQUIRED_USE"],
@@ -3011,7 +3011,7 @@ class depgraph(object):
 								raise
 						if not mreasons and \
 							not pkg.built and \
-							pkg.metadata["REQUIRED_USE"] and \
+							pkg.metadata.get("REQUIRED_USE") and \
 							eapi_has_required_use(pkg.metadata["EAPI"]):
 							if not check_required_use(
 								pkg.metadata["REQUIRED_USE"],
@@ -3692,7 +3692,7 @@ class depgraph(object):
 
 		if new_changes != old_changes:
 			#Don't do the change if it violates REQUIRED_USE.
-			required_use = pkg.metadata["REQUIRED_USE"]
+			required_use = pkg.metadata.get("REQUIRED_USE")
 			if required_use and check_required_use(required_use, old_use, pkg.iuse.is_valid_flag) and \
 				not check_required_use(required_use, new_use, pkg.iuse.is_valid_flag):
 				return old_use



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-16 18:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-16 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     5a75056fdf9d875359b85b13388a93bdc713b815
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 16 18:24:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov 16 18:24:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a75056f

xterm title HOSTNAME support, bug #390699

---
 pym/_emerge/JobStatusDisplay.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py
index 1949232..877a0c9 100644
--- a/pym/_emerge/JobStatusDisplay.py
+++ b/pym/_emerge/JobStatusDisplay.py
@@ -289,4 +289,11 @@ class JobStatusDisplay(object):
 			self._update(color_output.getvalue())
 
 		if self.xterm_titles:
-			xtermTitle(" ".join(plain_output.split()))
+			# If the HOSTNAME variable is exported, include it
+			# in the xterm title, just like emergelog() does.
+			# See bug #390699.
+			title_str = " ".join(plain_output.split())
+			hostname = os.environ.get("HOSTNAME")
+			if hostname is not None:
+				title_str = "%s: %s" % (hostname, title_str)
+			xtermTitle(title_str)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-16 18:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-16 18:44 UTC (permalink / raw
  To: gentoo-commits

commit:     72f9ddefe49ab1b24196161a07587aac3cdfdd04
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 16 18:43:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Nov 16 18:43:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72f9ddef

emerge --quiet-build: don't set PORTAGE_QUIET

The PORTAGE_QUIET controls lots of stuff that really should only be
controlled by --quiet, especially now that --quiet-build is enabled by
default. For example, PORTAGE_QUIET supresses the successful checksum
display that is produced by emerge --fetchonly.

---
 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 4a72ff4..ba2e631 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2707,7 +2707,7 @@ def adjust_config(myopts, settings):
 	if "--buildpkg" in myopts:
 		settings.features.add("buildpkg")
 
-	if "--quiet" in myopts or "--quiet-build" in myopts:
+	if "--quiet" in myopts:
 		settings["PORTAGE_QUIET"]="1"
 		settings.backup_changes("PORTAGE_QUIET")
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17  1:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17  1:25 UTC (permalink / raw
  To: gentoo-commits

commit:     dbe8e6593b927f67a4213317c4eab1d10bba88bf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 01:25:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 01:25:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dbe8e659

pkg_pretend: lock before unpacking binpkg xpak

This fixes a regression from the previous commit.

---
 pym/_emerge/Scheduler.py |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d5e801b..cb4aab4 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -26,7 +26,7 @@ from portage.output import colorize, create_color_func, red
 bad = create_color_func("BAD")
 from portage._sets import SETPREFIX
 from portage._sets.base import InternalPackageSet
-from portage.util import writemsg, writemsg_level
+from portage.util import ensure_dirs, writemsg, writemsg_level
 from portage.package.ebuild.digestcheck import digestcheck
 from portage.package.ebuild.digestgen import digestgen
 from portage.package.ebuild.doebuild import _check_temp_dir
@@ -920,9 +920,26 @@ class Scheduler(PollScheduler):
 			if rval != os.EX_OK:
 				return rval
 
+			build_dir_path = os.path.join(
+				os.path.realpath(settings["PORTAGE_TMPDIR"]),
+				"portage", x.category, x.pf)
+			existing_buildir = os.path.isdir(build_dir_path)
 			build_dir = None
 
 			try:
+				settings["PORTAGE_BUILDDIR"] = build_dir_path
+				build_dir = EbuildBuildDir(scheduler=sched_iface,
+					settings=settings)
+				build_dir.lock()
+
+				# Clean up the existing build dir, in case pkg_pretend
+				# checks for available space (bug #390711).
+				if existing_buildir:
+					clean_phase = EbuildPhase(background=False,
+						phase='clean', scheduler=sched_iface, settings=settings)
+					clean_phase.start()
+					clean_phase.wait()
+
 				if x.built:
 					tree = "bintree"
 					bintree = root_config.trees["bintree"].dbapi.bintree
@@ -949,9 +966,8 @@ class Scheduler(PollScheduler):
 					if fetched:
 						bintree.inject(x.cpv, filename=fetched)
 					tbz2_file = bintree.getname(x.cpv)
-					infloc = os.path.join(settings["PORTAGE_TMPDIR"],
-						x.category, x.pf, "build-info")
-					os.makedirs(infloc)
+					infloc = os.path.join(build_dir_path, "build-info")
+					ensure_dirs(infloc)
 					portage.xpak.tbz2(tbz2_file).unpackinfo(infloc)
 					ebuild_path = os.path.join(infloc, x.pf + ".ebuild")
 					settings.configdict["pkg"]["EMERGE_FROM"] = "binary"
@@ -973,19 +989,6 @@ class Scheduler(PollScheduler):
 					"pretend", settings=settings,
 					db=self.trees[settings['EROOT']][tree].dbapi)
 
-				existing_buildir = os.path.isdir(settings["PORTAGE_BUILDDIR"])
-				build_dir = EbuildBuildDir(scheduler=sched_iface,
-					settings=settings)
-				build_dir.lock()
-
-				# Clean up the existing build dir, in case pkg_pretend
-				# checks for available space (bug #390711).
-				if existing_buildir:
-					clean_phase = EbuildPhase(background=False,
-						phase='clean', scheduler=sched_iface, settings=settings)
-					clean_phase.start()
-					clean_phase.wait()
-
 				prepare_build_dirs(root_config.root, settings, cleanup=0)
 
 				vardb = root_config.trees['vartree'].dbapi



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17  1:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17  1:39 UTC (permalink / raw
  To: gentoo-commits

commit:     957b1dcdde637338cdcef625b9c820bbfe50ae5f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 01:38:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 01:38:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=957b1dcd

Tweak emerge --quiet-build default handling.

Since --quiet-build is enabled be default, there's no need to have it
in the options dict except when it is enabled.

---
 pym/_emerge/Scheduler.py |    2 +-
 pym/_emerge/main.py      |    3 ---
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index cb4aab4..47f7c45 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -386,7 +386,7 @@ class Scheduler(PollScheduler):
 		"""
 		background = (self._max_jobs is True or \
 			self._max_jobs > 1 or "--quiet" in self.myopts \
-			or "--quiet-build" in self.myopts) and \
+			or self.myopts.get("--quiet-build", "y") == "y") and \
 			not bool(self._opts_no_background.intersection(self.myopts))
 
 		if background:

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index a2995e2..5e9f13e 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -848,7 +848,6 @@ def parse_opts(tmpcmdline, silent=False):
 			"help"     : "redirect build output to logs",
 			"type"     : "choice",
 			"choices"  : true_y_or_n,
-			"default"  : "y",
 		},
 
 		"--rebuild-if-new-rev": {
@@ -1092,8 +1091,6 @@ def parse_opts(tmpcmdline, silent=False):
 		myoptions.quiet = None
 
 	if myoptions.quiet_build in true_y:
-		myoptions.quiet_build = True
-	else:
 		myoptions.quiet_build = None
 
 	if myoptions.rebuild_if_new_ver in true_y:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17  2:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17  2:09 UTC (permalink / raw
  To: gentoo-commits

commit:     c8beeac6f90b60d093e6ff5800744e45b632e2fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 02:09:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 02:09:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c8beeac6

Scheduler.py: remove unused vars (pyflakes)

---
 pym/_emerge/Scheduler.py |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 47f7c45..fb8fdfb 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -742,7 +742,6 @@ class Scheduler(PollScheduler):
 			self._status_msg("Starting parallel fetch")
 
 			prefetchers = self._prefetchers
-			getbinpkg = "--getbinpkg" in self.myopts
 
 			for pkg in self._mergelist:
 				# mergelist can contain solved Blocker instances
@@ -1159,12 +1158,9 @@ class Scheduler(PollScheduler):
 			# If only one package failed then just show it's
 			# whole log for easy viewing.
 			failed_pkg = self._failed_pkgs_all[-1]
-			build_dir = failed_pkg.build_dir
 			log_file = None
 			log_file_real = None
 
-			log_paths = [failed_pkg.build_log]
-
 			log_path = self._locate_failure_log(failed_pkg)
 			if log_path is not None:
 				try:
@@ -1260,9 +1256,6 @@ class Scheduler(PollScheduler):
 
 	def _locate_failure_log(self, failed_pkg):
 
-		build_dir = failed_pkg.build_dir
-		log_file = None
-
 		log_paths = [failed_pkg.build_log]
 
 		for log_path in log_paths:
@@ -1445,7 +1438,6 @@ class Scheduler(PollScheduler):
 
 		self._add_prefetchers()
 		self._add_packages()
-		pkg_queue = self._pkg_queue
 		failed_pkgs = self._failed_pkgs
 		portage.locks._quiet = self._background
 		portage.elog.add_listener(self._elog_listener)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17  3:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17  3:43 UTC (permalink / raw
  To: gentoo-commits

commit:     b552912a54d0240325c1b3b8bef744ea04a513f8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 03:43:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 03:43:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b552912a

pkg_pretend: tweak final cleanup logic

This ensures that the clean phase will not run if the user interrupts
emerge before the build dir is locked.

---
 pym/_emerge/Scheduler.py |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index fb8fdfb..261fa95 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -923,13 +923,12 @@ class Scheduler(PollScheduler):
 				os.path.realpath(settings["PORTAGE_TMPDIR"]),
 				"portage", x.category, x.pf)
 			existing_buildir = os.path.isdir(build_dir_path)
-			build_dir = None
+			settings["PORTAGE_BUILDDIR"] = build_dir_path
+			build_dir = EbuildBuildDir(scheduler=sched_iface,
+				settings=settings)
+			build_dir.lock()
 
 			try:
-				settings["PORTAGE_BUILDDIR"] = build_dir_path
-				build_dir = EbuildBuildDir(scheduler=sched_iface,
-					settings=settings)
-				build_dir.lock()
 
 				# Clean up the existing build dir, in case pkg_pretend
 				# checks for available space (bug #390711).
@@ -1005,12 +1004,11 @@ class Scheduler(PollScheduler):
 					failures += 1
 				portage.elog.elog_process(x.cpv, settings)
 			finally:
-				if build_dir is not None:
-					clean_phase = EbuildPhase(background=False,
-						phase='clean', scheduler=sched_iface, settings=settings)
-					clean_phase.start()
-					clean_phase.wait()
-					build_dir.unlock()
+				clean_phase = EbuildPhase(background=False,
+					phase='clean', scheduler=sched_iface, settings=settings)
+				clean_phase.start()
+				clean_phase.wait()
+				build_dir.unlock()
 
 		if failures:
 			return 1



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17  5:15 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17  5:15 UTC (permalink / raw
  To: gentoo-commits

commit:     39dfd5bf7b0c26c05b568c4538fc85bb9fe3b116
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 05:15:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 05:15:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=39dfd5bf

pkg_pretend: handle interruption more

---
 pym/_emerge/Scheduler.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 261fa95..3b53a37 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -927,6 +927,7 @@ class Scheduler(PollScheduler):
 			build_dir = EbuildBuildDir(scheduler=sched_iface,
 				settings=settings)
 			build_dir.lock()
+			current_task = None
 
 			try:
 
@@ -935,6 +936,7 @@ class Scheduler(PollScheduler):
 				if existing_buildir:
 					clean_phase = EbuildPhase(background=False,
 						phase='clean', scheduler=sched_iface, settings=settings)
+					current_task = clean_phase
 					clean_phase.start()
 					clean_phase.wait()
 
@@ -956,6 +958,7 @@ class Scheduler(PollScheduler):
 
 					verifier = BinpkgVerifier(pkg=x,
 						scheduler=sched_iface)
+					current_task = verifier
 					verifier.start()
 					if verifier.wait() != os.EX_OK:
 						failures += 1
@@ -998,12 +1001,15 @@ class Scheduler(PollScheduler):
 					phase="pretend", scheduler=sched_iface,
 					settings=settings)
 
+				current_task = pretend_phase
 				pretend_phase.start()
 				ret = pretend_phase.wait()
 				if ret != os.EX_OK:
 					failures += 1
 				portage.elog.elog_process(x.cpv, settings)
 			finally:
+				if current_task is not None and current_task.isAlive():
+					current_task.cancel()
 				clean_phase = EbuildPhase(background=False,
 					phase='clean', scheduler=sched_iface, settings=settings)
 				clean_phase.start()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17 13:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17 13:39 UTC (permalink / raw
  To: gentoo-commits

commit:     e0d5d620659397ff0c005f2aadf75a43835818d6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 13:39:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 13:39:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e0d5d620

Show option arguments in emerge.log arg list.

---
 pym/_emerge/main.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 5e9f13e..62af0ad 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1894,7 +1894,17 @@ def emerge_main(args=None):
 				encoding=_encodings['content'], errors='replace'))
 		myelogstr=""
 		if myopts:
-			myelogstr=" ".join(myopts)
+			opt_list = []
+			for opt, arg in myopts.items():
+				if arg is True:
+					opt_list.append(opt)
+				elif isinstance(arg, list):
+					# arguments like --exclude that use 'append' action
+					for x in arg:
+						opt_list.append("%s=%s" % (opt, x))
+				else:
+					opt_list.append("%s=%s" % (opt, arg))
+			myelogstr=" ".join(opt_list)
 		if myaction:
 			myelogstr+=" "+myaction
 		if myfiles:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-17 23:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-17 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     c2b1353843af26ffbad8b9f95533e4c691c93443
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 13:44:41 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 13:44:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2b13538

Show action as --action in emerge.log arg list.

---
 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 62af0ad..72984da 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1906,7 +1906,7 @@ def emerge_main(args=None):
 					opt_list.append("%s=%s" % (opt, arg))
 			myelogstr=" ".join(opt_list)
 		if myaction:
-			myelogstr+=" "+myaction
+			myelogstr += " --" + myaction
 		if myfiles:
 			myelogstr += " " + " ".join(oldargs)
 		emergelog(xterm_titles, " *** emerge " + myelogstr)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-18 19:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-18 19:40 UTC (permalink / raw
  To: gentoo-commits

commit:     0a0670ed7e600d9dbdb2fc77d6f1f5da741f2592
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 18 19:40:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 18 19:40:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0a0670ed

Schduler: _check_temp_dir in _handle_self_update

---
 pym/_emerge/Scheduler.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index ad1a944..26c3794 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -290,7 +290,7 @@ class Scheduler(PollScheduler):
 	def _handle_self_update(self):
 
 		if self._opts_no_self_update.intersection(self.myopts):
-			return
+			return os.EX_OK
 
 		for x in self._mergelist:
 			if not isinstance(x, Package):
@@ -307,9 +307,14 @@ class Scheduler(PollScheduler):
 				'9999' in x.cpv or \
 				'git' in x.inherited or \
 				'git-2' in x.inherited:
+				rval = _check_temp_dir(self.settings)
+				if rval != os.EX_OK:
+					return rval
 				_prepare_self_update(self.settings)
 			break
 
+		return os.EX_OK
+
 	def _terminate_tasks(self):
 		self._status_display.quiet = True
 		while self._running_tasks:
@@ -961,7 +966,9 @@ class Scheduler(PollScheduler):
 		except self._unknown_internal_error:
 			return 1
 
-		self._handle_self_update()
+		rval = self._handle_self_update()
+		if rval != os.EX_OK:
+			return rval
 
 		for root in self.trees:
 			root_config = self.trees[root]["root_config"]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-20 18:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-20 18:54 UTC (permalink / raw
  To: gentoo-commits

commit:     a858b16b4d7905597156f512a8055127e2c7249a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 20 18:54:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov 20 18:54:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a858b16b

emerge --help: show --quiet-build

---
 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 40c725e..a1dbb37 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -18,7 +18,7 @@ def help():
 	print("          [ "+green("--complete-graph")+"             ] [ "+green("--deep")+"       ]")
 	print("          [ "+green("--jobs") + " " + turquoise("JOBS")+" ] [ "+green("--keep-going")+" ] [ " + green("--load-average")+" " + turquoise("LOAD") + "            ]")
 	print("          [ "+green("--newuse")+"    ] [ "+green("--noconfmem")+"  ] [ "+green("--nospinner")+"  ]")
-	print("          [ "+green("--oneshot")+"   ] [ "+green("--onlydeps")+"   ]")
+	print("          [ "+green("--oneshot")+"   ] [ "+green("--onlydeps")+"   ] [ "+ green("--quiet-build")+" [ " + turquoise("y") + " | "+ turquoise("n")+" ]        ]")
 	print("          [ "+green("--reinstall ")+turquoise("changed-use")+"      ] [ " + green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" >         ]")
 	print(bold("Actions:")+"  [ "+green("--depclean")+" | "+green("--list-sets")+" | "+green("--search")+" | "+green("--sync")+" | "+green("--version")+"        ]")
 	print()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-11-27 20:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-11-27 20:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ee441f2c5358656f2f404f65f8e4d4972ac6daf8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 27 20:52:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov 27 20:52:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ee441f2c

_get_dep_chain: fix KeyError, bug #392059

This fixes a regression since commit
57cc4e3e8991e7c4394d1dff7698aa62ed2a286b, which make a faulty
assumption that the digraph contained all of the edges contained in
parent_atoms.

---
 pym/_emerge/depgraph.py |   35 ++++++++++++++++++++++-------------
 1 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 484206e..3bda894 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2743,6 +2743,7 @@ class depgraph(object):
 		node = start_node
 		child = None
 		all_parents = self._dynamic_config._parent_atoms
+		graph = self._dynamic_config.digraph
 
 		if target_atom is not None and isinstance(node, Package):
 			affecting_use = set()
@@ -2801,8 +2802,12 @@ class depgraph(object):
 		while node is not None:
 			traversed_nodes.add(node)
 
-			if isinstance(node, DependencyArg):
-				if self._dynamic_config.digraph.parent_nodes(node):
+			if node not in graph:
+				# The parent is not in the graph due to backtracking.
+				break
+
+			elif isinstance(node, DependencyArg):
+				if graph.parent_nodes(node):
 					node_type = "set"
 				else:
 					node_type = "argument"
@@ -2815,13 +2820,21 @@ class depgraph(object):
 						break
 
 				dep_strings = set()
-				for priority in self._dynamic_config.digraph.nodes[node][0][child]:
-					if priority.buildtime:
-						dep_strings.add(node.metadata["DEPEND"])
-					if priority.runtime:
-						dep_strings.add(node.metadata["RDEPEND"])
-					if priority.runtime_post:
-						dep_strings.add(node.metadata["PDEPEND"])
+				priorities = graph.nodes[node][0].get(child)
+				if priorities is None:
+					# This edge comes from _parent_atoms and was not added to
+					# the graph, and _parent_atoms does not contain priorities.
+					dep_strings.add(node.metadata["DEPEND"])
+					dep_strings.add(node.metadata["RDEPEND"])
+					dep_strings.add(node.metadata["PDEPEND"])
+				else:
+					for priority in priorities:
+						if priority.buildtime:
+							dep_strings.add(node.metadata["DEPEND"])
+						if priority.runtime:
+							dep_strings.add(node.metadata["RDEPEND"])
+						if priority.runtime_post:
+							dep_strings.add(node.metadata["PDEPEND"])
 
 				affecting_use = set()
 				for dep_str in dep_strings:
@@ -2848,10 +2861,6 @@ class depgraph(object):
 
 				dep_chain.append((pkg_name, node.type_name))
 
-			if node not in self._dynamic_config.digraph:
-				# The parent is not in the graph due to backtracking.
-				break
-
 			# 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.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-01 21:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-01 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     b573f6f81c4500af9a4d08d58746d59c2b95f67c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  1 21:05:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec  1 21:05:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b573f6f8

_emerge/SubProcess.py: support int fd in _files

---
 pym/_emerge/SubProcess.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index b99cf0b..37922dc 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -120,7 +120,10 @@ class SubProcess(AbstractPollTask):
 
 		if self._files is not None:
 			for f in self._files.values():
-				f.close()
+				if isinstance(f, int):
+					os.close(f)
+				else:
+					f.close()
 			self._files = None
 
 	def _set_returncode(self, wait_retval):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-01 21:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-01 21:22 UTC (permalink / raw
  To: gentoo-commits

commit:     b432a1b3051d91546649e8f3190675767461d8e8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  1 21:22:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec  1 21:22:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b432a1b3

_emerge/EbuildMetadataPhase.py: use os.read()

There's no need for a file object, and file objects introduce
complexity that can lead to bugs as mentioned in bug 337465 comment 31,
so use os.read() directly on the file descriptor.

---
 pym/_emerge/EbuildMetadataPhase.py |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 16948df..e068e8f 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -10,6 +10,7 @@ from portage import os
 from portage import _encodings
 from portage import _unicode_decode
 from portage import _unicode_encode
+import errno
 import fcntl
 import io
 
@@ -75,7 +76,6 @@ class EbuildMetadataPhase(SubProcess):
 			if fd == sys.stderr.fileno():
 				sys.stderr.flush()
 
-		fd_pipes_orig = fd_pipes.copy()
 		self._files = self._files_dict()
 		files = self._files
 
@@ -86,8 +86,8 @@ class EbuildMetadataPhase(SubProcess):
 		fd_pipes[self._metadata_fd] = slave_fd
 
 		self._raw_metadata = []
-		files.ebuild = os.fdopen(master_fd, 'rb', 0)
-		self._reg_id = self.scheduler.register(files.ebuild.fileno(),
+		files.ebuild = master_fd
+		self._reg_id = self.scheduler.register(files.ebuild,
 			self._registered_events, self._output_handler)
 		self._registered = True
 
@@ -112,10 +112,16 @@ class EbuildMetadataPhase(SubProcess):
 	def _output_handler(self, fd, event):
 
 		if event & PollConstants.POLLIN:
-			self._raw_metadata.append(self._files.ebuild.read())
-			if not self._raw_metadata[-1]:
-				self._unregister()
-				self.wait()
+			try:
+				self._raw_metadata.append(
+					os.read(self._files.ebuild, self._bufsize))
+			except IOError as e:
+				if e.errno not in (errno.EAGAIN,):
+					raise
+			else:
+				if not self._raw_metadata[-1]:
+					self._unregister()
+					self.wait()
 
 		self._unregister_if_appropriate(event)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-02  1:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-02  1:44 UTC (permalink / raw
  To: gentoo-commits

commit:     27b6a21bd8b4f9372c328b979ee0ba0a8020a2b9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  2 01:43:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  2 01:43:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=27b6a21b

AsynchronousLock: use os.read/write

Similar to commit b432a1b3051d91546649e8f3190675767461d8e8, don't use
unecessary file objects. It also happens that these changes fix
compatibility issues with PyPy.

---
 pym/_emerge/AsynchronousLock.py |   43 +++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index be498b8..39e36c8 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -3,6 +3,7 @@
 
 import dummy_threading
 import fcntl
+import errno
 import logging
 import sys
 
@@ -114,12 +115,12 @@ class _LockThread(AbstractPollTask):
 	def _start(self):
 		pr, pw = os.pipe()
 		self._files = {}
-		self._files['pipe_read'] = os.fdopen(pr, 'rb', 0)
-		self._files['pipe_write'] = os.fdopen(pw, 'wb', 0)
+		self._files['pipe_read'] = pr
+		self._files['pipe_write'] = pw
 		for k, f in self._files.items():
-			fcntl.fcntl(f.fileno(), fcntl.F_SETFL,
-				fcntl.fcntl(f.fileno(), fcntl.F_GETFL) | os.O_NONBLOCK)
-		self._reg_id = self.scheduler.register(self._files['pipe_read'].fileno(),
+			fcntl.fcntl(f, fcntl.F_SETFL,
+				fcntl.fcntl(f, fcntl.F_GETFL) | os.O_NONBLOCK)
+		self._reg_id = self.scheduler.register(self._files['pipe_read'],
 			PollConstants.POLLIN, self._output_handler)
 		self._registered = True
 		threading_mod = threading
@@ -130,10 +131,16 @@ class _LockThread(AbstractPollTask):
 
 	def _run_lock(self):
 		self._lock_obj = lockfile(self.path, wantnewlockfile=True)
-		self._files['pipe_write'].write(b'\0')
+		os.write(self._files['pipe_write'], b'\0')
 
 	def _output_handler(self, f, event):
-		buf = self._read_buf(self._files['pipe_read'], event)
+		buf = None
+		if event & PollConstants.POLLIN:
+			try:
+				buf = os.read(self._files['pipe_read'], self._bufsize)
+			except IOError as e:
+				if e.errno not in (errno.EAGAIN,):
+					raise
 		if buf:
 			self._unregister()
 			self.returncode = os.EX_OK
@@ -171,7 +178,7 @@ class _LockThread(AbstractPollTask):
 
 		if self._files is not None:
 			for f in self._files.values():
-				f.close()
+				os.close(f)
 			self._files = None
 
 class _LockProcess(AbstractPollTask):
@@ -190,8 +197,8 @@ class _LockProcess(AbstractPollTask):
 		in_pr, in_pw = os.pipe()
 		out_pr, out_pw = os.pipe()
 		self._files = {}
-		self._files['pipe_in'] = os.fdopen(in_pr, 'rb', 0)
-		self._files['pipe_out'] = os.fdopen(out_pw, 'wb', 0)
+		self._files['pipe_in'] = in_pr
+		self._files['pipe_out'] = out_pw
 		fcntl.fcntl(in_pr, fcntl.F_SETFL,
 			fcntl.fcntl(in_pr, fcntl.F_GETFL) | os.O_NONBLOCK)
 		self._reg_id = self.scheduler.register(in_pr,
@@ -219,7 +226,7 @@ class _LockProcess(AbstractPollTask):
 			except KeyError:
 				pass
 			else:
-				pipe_out.close()
+				os.close(pipe_out)
 
 		if proc.returncode != os.EX_OK:
 			# Typically, this will happen due to the
@@ -263,7 +270,13 @@ class _LockProcess(AbstractPollTask):
 		return self.returncode
 
 	def _output_handler(self, f, event):
-		buf = self._read_buf(self._files['pipe_in'], event)
+		buf = None
+		if event & PollConstants.POLLIN:
+			try:
+				buf = os.read(self._files['pipe_in'], self._bufsize)
+			except IOError as e:
+				if e.errno not in (errno.EAGAIN,):
+					raise
 		if buf:
 			self._acquired = True
 			self._unregister()
@@ -283,7 +296,7 @@ class _LockProcess(AbstractPollTask):
 			except KeyError:
 				pass
 			else:
-				pipe_in.close()
+				os.close(pipe_in)
 
 	def unlock(self):
 		if self._proc is None:
@@ -294,8 +307,8 @@ class _LockProcess(AbstractPollTask):
 			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()
+		os.write(self._files['pipe_out'], b'\0')
+		os.close(self._files['pipe_out'])
 		self._files = None
 		self._proc.wait()
 		self._proc = None



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-02  2:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-02  2:34 UTC (permalink / raw
  To: gentoo-commits

commit:     6b9a29652474f1139dc088322cf68f22f37e5fed
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  2 02:34:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  2 02:34:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b9a2965

PipeReader: use os.read/write

---
 pym/_emerge/PipeReader.py |   30 +++++++++++-------------------
 1 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 888c609..67144c3 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -4,8 +4,8 @@
 from portage import os
 from _emerge.AbstractPollTask import AbstractPollTask
 from _emerge.PollConstants import PollConstants
+import errno
 import fcntl
-import array
 
 class PipeReader(AbstractPollTask):
 
@@ -59,26 +59,18 @@ class PipeReader(AbstractPollTask):
 
 		if event & PollConstants.POLLIN:
 
-			for f in self.input_files.values():
-				if fd == f.fileno():
-					break
-
-			buf = array.array('B')
+			data = None
 			try:
-				buf.fromfile(f, self._bufsize)
-			except (EOFError, IOError):
-				pass
-
-			if buf:
-				try:
-					# Python >=3.2
-					data = buf.tobytes()
-				except AttributeError:
-					data = buf.tostring()
-				self._read_data.append(data)
+				data = os.read(fd, self._bufsize)
+			except IOError as e:
+				if e.errno not in (errno.EAGAIN,):
+					raise
 			else:
-				self._unregister()
-				self.wait()
+				if data:
+					self._read_data.append(data)
+				else:
+					self._unregister()
+					self.wait()
 
 		self._unregister_if_appropriate(event)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-02  6:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-02  6:14 UTC (permalink / raw
  To: gentoo-commits

commit:     c6c71eefb9532af0d4505de70e58f45ad8e8fe0a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  2 06:14:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  2 06:14:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6c71eef

Handle OSError from os.read and loop if needed.

Looping fixes EbuildMetadataPhase failures for ebuilds that produce
more than 4096 bytes of metadata, broken since commit
b432a1b3051d91546649e8f3190675767461d8e8.

---
 pym/_emerge/AsynchronousLock.py    |    4 ++--
 pym/_emerge/EbuildMetadataPhase.py |   23 +++++++++++++----------
 pym/_emerge/PipeReader.py          |   25 ++++++++++++++-----------
 3 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 39e36c8..9d0545b 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -138,7 +138,7 @@ class _LockThread(AbstractPollTask):
 		if event & PollConstants.POLLIN:
 			try:
 				buf = os.read(self._files['pipe_read'], self._bufsize)
-			except IOError as e:
+			except OSError as e:
 				if e.errno not in (errno.EAGAIN,):
 					raise
 		if buf:
@@ -274,7 +274,7 @@ class _LockProcess(AbstractPollTask):
 		if event & PollConstants.POLLIN:
 			try:
 				buf = os.read(self._files['pipe_in'], self._bufsize)
-			except IOError as e:
+			except OSError as e:
 				if e.errno not in (errno.EAGAIN,):
 					raise
 		if buf:

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index e068e8f..d4f5bc0 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -112,16 +112,19 @@ class EbuildMetadataPhase(SubProcess):
 	def _output_handler(self, fd, event):
 
 		if event & PollConstants.POLLIN:
-			try:
-				self._raw_metadata.append(
-					os.read(self._files.ebuild, self._bufsize))
-			except IOError as e:
-				if e.errno not in (errno.EAGAIN,):
-					raise
-			else:
-				if not self._raw_metadata[-1]:
-					self._unregister()
-					self.wait()
+			while True:
+				try:
+					self._raw_metadata.append(
+						os.read(self._files.ebuild, self._bufsize))
+				except OSError as e:
+					if e.errno not in (errno.EAGAIN,):
+						raise
+					break
+				else:
+					if not self._raw_metadata[-1]:
+						self._unregister()
+						self.wait()
+						break
 
 		self._unregister_if_appropriate(event)
 

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 67144c3..af8cfdd 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -59,18 +59,21 @@ class PipeReader(AbstractPollTask):
 
 		if event & PollConstants.POLLIN:
 
-			data = None
-			try:
-				data = os.read(fd, self._bufsize)
-			except IOError as e:
-				if e.errno not in (errno.EAGAIN,):
-					raise
-			else:
-				if data:
-					self._read_data.append(data)
+			while True:
+				data = None
+				try:
+					data = os.read(fd, self._bufsize)
+				except OSError as e:
+					if e.errno not in (errno.EAGAIN,):
+						raise
+					break
 				else:
-					self._unregister()
-					self.wait()
+					if data:
+						self._read_data.append(data)
+					else:
+						self._unregister()
+						self.wait()
+						break
 
 		self._unregister_if_appropriate(event)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-02 18:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-02 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     0ac299616c5cb22befdd9fcd4091d80ca889ef19
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  2 18:30:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  2 18:30:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0ac29961

action_depclean: fix return code

The fixes some cases where emerge.log would show that depclean was
unsuccessful when it was really successful but there was nothing to
remove.

---
 pym/_emerge/actions.py |   13 +++++++++----
 pym/_emerge/unmerge.py |    2 +-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ba2e631..a62b305 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -588,15 +588,18 @@ def action_depclean(settings, trees, ldpath_mtimes,
 		return rval
 
 	if cleanlist:
-		unmerge(root_config, myopts, "unmerge",
+		if unmerge(root_config, myopts, "unmerge",
 			cleanlist, ldpath_mtimes, ordered=ordered,
-			scheduler=scheduler)
+			scheduler=scheduler):
+			rval = os.EX_OK
+		else:
+			rval = 1
 
 	if action == "prune":
-		return
+		return rval
 
 	if not cleanlist and "--quiet" in myopts:
-		return
+		return rval
 
 	print("Packages installed:   " + str(len(vardb.cpv_all())))
 	print("Packages in world:    " + \
@@ -609,6 +612,8 @@ def action_depclean(settings, trees, ldpath_mtimes,
 	else:
 		print("Number removed:       "+str(len(cleanlist)))
 
+	return rval
+
 def calc_depclean(settings, trees, ldpath_mtimes,
 	myopts, action, args_set, spinner):
 	allow_missing_deps = bool(args_set)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 852ad93..c76afdf 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -526,7 +526,7 @@ def unmerge(root_config, myopts, unmerge_action,
 
 	if "--pretend" in myopts:
 		#we're done... return
-		return 0
+		return 1
 	if "--ask" in myopts:
 		if userquery("Would you like to unmerge these packages?",
 			enter_invalid) == "No":



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-04 23:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-04 23:43 UTC (permalink / raw
  To: gentoo-commits

commit:     3faeebbed6a3613d501c6892e3b6b03d9779fd22
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 23:43:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 23:43:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3faeebbe

depgraph: fix case insensitive search for unsat

This fixes an interaction between the code from commits
9ce6da43ab90c4dab97ebf3b8339e5dbc113a0a8 and
cbe44d92ff13b8a22f5b4215b73078ce600c6bf4, so that we don't discard
matches that are identical except for differnces in upper/lower case.

---
 pym/_emerge/depgraph.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3bda894..57619e0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3296,9 +3296,17 @@ class depgraph(object):
 					for other_cp in list(all_cp):
 						other_pkg = portage.catsplit(other_cp)[1]
 						if other_pkg == pkg:
-							# discard dir containing no ebuilds
-							all_cp.discard(other_cp)
-							continue
+							# Check for non-identical package that
+							# differs only by upper/lower case.
+							identical = True
+							for cp_orig in orig_cp_map[other_cp]:
+								if cp_orig != cp:
+									identical = False
+									break
+							if identical:
+								# discard dir containing no ebuilds
+								all_cp.discard(other_cp)
+								continue
 						pkg_to_cp.setdefault(other_pkg, set()).add(other_cp)
 					pkg_matches = difflib.get_close_matches(pkg, pkg_to_cp)
 					matches = []



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-04 23:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-04 23:56 UTC (permalink / raw
  To: gentoo-commits

commit:     49795425003ada6457a780ecef599ae6e507ad79
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 23:55:49 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 23:55:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=49795425

fix logic from last commit

---
 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 57619e0..e7307c0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3300,7 +3300,8 @@ class depgraph(object):
 							# differs only by upper/lower case.
 							identical = True
 							for cp_orig in orig_cp_map[other_cp]:
-								if cp_orig != cp:
+								if portage.catsplit(cp_orig)[1] != \
+									portage.catsplit(atom.cp)[1]:
 									identical = False
 									break
 							if identical:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-06 18:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-06 18:53 UTC (permalink / raw
  To: gentoo-commits

commit:     96a8b44c8a1fddfa82424ad3c86b6a380ad863a2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  6 18:52:50 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 18:52:50 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=96a8b44c

action_sync: fix git_sync_timestamps KeyError

This fixes the case where $PORTDIR doesn't exist prior to sync.

---
 pym/_emerge/actions.py |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a62b305..87610a6 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1971,6 +1971,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 	os.umask(0o022)
 	dosyncuri = syncuri
 	updatecache_flg = False
+	git = False
 	if myaction == "metadata":
 		print("skipping sync")
 		updatecache_flg = True
@@ -1999,9 +2000,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 		msg = ">>> Git pull in %s successful" % myportdir
 		emergelog(xterm_titles, msg)
 		writemsg_level(msg + "\n")
-		exitcode = git_sync_timestamps(portdb, myportdir)
-		if exitcode == os.EX_OK:
-			updatecache_flg = True
+		git = True
 	elif syncuri[:8]=="rsync://" or syncuri[:6]=="ssh://":
 		for vcs_dir in vcs_dirs:
 			writemsg_level(("!!! %s appears to be under revision " + \
@@ -2443,17 +2442,25 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 			noiselevel=-1, level=logging.ERROR)
 		return 1
 
-	if updatecache_flg and  \
-		myaction != "metadata" and \
-		"metadata-transfer" not in settings.features:
-		updatecache_flg = False
-
 	# Reload the whole config from scratch.
 	settings, trees, mtimedb = load_emerge_config(trees=trees)
 	adjust_configs(myopts, trees)
 	root_config = trees[settings['EROOT']]['root_config']
 	portdb = trees[settings['EROOT']]['porttree'].dbapi
 
+	if git:
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		exitcode = git_sync_timestamps(portdb, myportdir)
+		if exitcode == os.EX_OK:
+			updatecache_flg = True
+
+	if updatecache_flg and  \
+		myaction != "metadata" and \
+		"metadata-transfer" not in settings.features:
+		updatecache_flg = False
+
 	if updatecache_flg and \
 		os.path.exists(os.path.join(myportdir, 'metadata', 'cache')):
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-09  3:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-09  3:21 UTC (permalink / raw
  To: gentoo-commits

commit:     d5700b8579a9a8756b0a0e4b1ae801322593d28b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  9 03:21:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec  9 03:21:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5700b85

load_emerge_config: init portage.data earlier

The portage_uid initialization here must to happend before the
_init_dirs() calls.

---
 pym/_emerge/actions.py |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 2849598..54c9774 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2987,19 +2987,22 @@ def load_emerge_config(trees=None):
 			kwargs[k] = v
 	trees = portage.create_trees(trees=trees, **kwargs)
 
-	for root, root_trees in trees.items():
-		settings = root_trees["vartree"].settings
-		settings._init_dirs()
-		setconfig = load_default_config(settings, root_trees)
-		root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
-
 	settings = trees[trees._target_eroot]['vartree'].settings
 	mtimedbfile = os.path.join(settings['EROOT'], portage.CACHE_PATH, "mtimedb")
 	mtimedb = portage.MtimeDB(mtimedbfile)
 	portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])
+	# The portage_uid initialization here must to happend before
+	# the _init_dirs() calls below.
 	portage.data._init(settings)
 	QueryCommand._db = trees
-	return settings, trees, mtimedb
+
+	for root, root_trees in trees.items():
+		settings = root_trees["vartree"].settings
+		settings._init_dirs()
+		setconfig = load_default_config(settings, root_trees)
+		root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
+	
+	return trees[trees._target_eroot]['vartree'].settings, trees, mtimedb
 
 def chk_updated_cfg_files(eroot, config_protect):
 	target_root = eroot



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10  3:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     2168e6e712e671afc0845de41fc1f81a7046750c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 03:03:15 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 03:03:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2168e6e7

BinpkgEnvExtractor: fix PORTAGE_LOG_FILE spelling

---
 pym/_emerge/BinpkgEnvExtractor.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/BinpkgEnvExtractor.py b/pym/_emerge/BinpkgEnvExtractor.py
index 1c94718..5ba1495 100644
--- a/pym/_emerge/BinpkgEnvExtractor.py
+++ b/pym/_emerge/BinpkgEnvExtractor.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
 
 import errno
@@ -38,7 +38,7 @@ class BinpkgEnvExtractor(CompositeTask):
 			background=self.background,
 			env=self.settings.environ(), 
 			scheduler=self.scheduler,
-			logfile=self.settings.get('PORTAGE_LOGFILE'))
+			logfile=self.settings.get('PORTAGE_LOG_FILE'))
 
 		self._start_task(extractor_proc, self._extractor_exit)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10  3:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10  3:31 UTC (permalink / raw
  To: gentoo-commits

commit:     d4b19ee8e8f7039d146ed85af2f264cf9b93dae1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 03:31:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 03:31:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d4b19ee8

Binpkg: fix os.path.dirname() usage

It doesn't behave as intended for $ED which has a trailing slash.

---
 pym/_emerge/Binpkg.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 5a58ad2..57b170f 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -354,7 +354,7 @@ class Binpkg(CompositeTask):
 		os.rename(os.path.join(self.settings["D"],
 			self._build_prefix.lstrip(os.sep)), image_tmp_dir)
 		shutil.rmtree(self._image_dir)
-		ensure_dirs(os.path.dirname(self.settings["ED"]))
+		ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep)))
 		os.rename(image_tmp_dir, self.settings["ED"])
 
 		self.wait()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10  3:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10  3:55 UTC (permalink / raw
  To: gentoo-commits

commit:     7c0ba941760c32d123dc225fe797f509195831cb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 03:55:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 03:55:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7c0ba941

Binpkg: handle missing dir after chpathtool

---
 pym/_emerge/Binpkg.py |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 57b170f..4936878 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -351,11 +351,17 @@ class Binpkg(CompositeTask):
 		# Move the files to the correct location for merge.
 		image_tmp_dir = os.path.join(
 			self.settings["PORTAGE_BUILDDIR"], "image_tmp")
-		os.rename(os.path.join(self.settings["D"],
-			self._build_prefix.lstrip(os.sep)), image_tmp_dir)
-		shutil.rmtree(self._image_dir)
-		ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep)))
-		os.rename(image_tmp_dir, self.settings["ED"])
+		build_d = os.path.join(self.settings["D"],
+			self._build_prefix.lstrip(os.sep))
+		if not os.path.isdir(build_d):
+			# Assume this is a virtual package or something.
+			shutil.rmtree(self._image_dir)
+			ensure_dirs(self.settings["ED"])
+		else:
+			os.rename(build_d, image_tmp_dir)
+			shutil.rmtree(self._image_dir)
+			ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep)))
+			os.rename(image_tmp_dir, self.settings["ED"])
 
 		self.wait()
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10  4:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10  4:00 UTC (permalink / raw
  To: gentoo-commits

commit:     41a920fa8ef79707a573e95704c6bccf2fee044f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 03:58:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 03:58:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=41a920fa

Binpkg: ensure $ED exists after extraction

---
 pym/_emerge/Binpkg.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 4936878..b259069 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -318,6 +318,7 @@ class Binpkg(CompositeTask):
 			self._build_prefix = ""
 
 		if self._build_prefix == self.settings["EPREFIX"]:
+			ensure_dirs(self.settings["ED"])
 			self._current_task = None
 			self.returncode = os.EX_OK
 			self.wait()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10  7:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10  7:08 UTC (permalink / raw
  To: gentoo-commits

commit:     6081171d9920c6902aced768ce19af94ed3c7320
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 07:08:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 07:08:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6081171d

emerge: allow search when profile is missing

---
 pym/_emerge/main.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 72984da..6acc80e 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1560,7 +1560,7 @@ def config_protect_check(trees):
 			writemsg_level(msg, level=logging.WARN, noiselevel=-1)
 
 def profile_check(trees, myaction):
-	if myaction in ("help", "info", "sync", "version"):
+	if myaction in ("help", "info", "search", "sync", "version"):
 		return os.EX_OK
 	for root, root_trees in trees.items():
 		if root_trees["root_config"].settings.profiles:
@@ -1570,7 +1570,7 @@ def profile_check(trees, myaction):
 		msg = ("Your current profile is invalid. If you have just changed "
 			"your profile configuration, you should revert back to the "
 			"previous configuration. Allowed actions are limited to "
-			"--help, --info, --sync, and --version.")
+			"--help, --info, --search, --sync, and --version.")
 		writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
 			level=logging.ERROR, noiselevel=-1)
 		return 1



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10 21:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10 21:13 UTC (permalink / raw
  To: gentoo-commits

commit:     01d85ae3b72022cda50830d6aff61f92b48a19fc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 21:13:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 21:13:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=01d85ae3

Binpkg: move imports to top

---
 pym/_emerge/Binpkg.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index ba25d3a..6c70b19 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -20,6 +20,7 @@ from portage import _unicode_decode
 from portage import _unicode_encode
 import io
 import logging
+import textwrap
 from portage.output import colorize
 
 class Binpkg(CompositeTask):
@@ -90,9 +91,8 @@ class Binpkg(CompositeTask):
 				"/var/log/emerge-fetch.log` in another " + \
 				"terminal.") % (prefetcher.pkg_path, settings["EPREFIX"])
 			msg_prefix = colorize("GOOD", " * ")
-			from textwrap import wrap
 			waiting_msg = "".join("%s%s\n" % (msg_prefix, line) \
-				for line in wrap(waiting_msg, 65))
+				for line in textwrap.wrap(waiting_msg, 65))
 			if not self.background:
 				writemsg(waiting_msg, noiselevel=-1)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-10 21:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-10 21:37 UTC (permalink / raw
  To: gentoo-commits

commit:     495c0ce534af794456a0a21f213f8f996bce0186
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 21:37:15 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 21:37:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=495c0ce5

actions.py: fix grammar in comment

---
 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 f38998d..7150c23 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2991,7 +2991,7 @@ def load_emerge_config(trees=None):
 	mtimedbfile = os.path.join(settings['EROOT'], portage.CACHE_PATH, "mtimedb")
 	mtimedb = portage.MtimeDB(mtimedbfile)
 	portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])
-	# The portage_uid initialization here must to happend before
+	# The portage_uid initialization here must happen before
 	# the _init_dirs() calls below.
 	portage.data._init(settings)
 	QueryCommand._db = trees



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-11  7:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-11  7:49 UTC (permalink / raw
  To: gentoo-commits

commit:     d67d11c82338a6d9ee073eab18bd0e24cd846c77
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 11 07:49:40 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 11 07:49:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d67d11c8

load_emerge_config: change order of code back

A couple of recent commits touched this function, and code got moved
around unnecessarily.

---
 pym/_emerge/actions.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 484f6b0..b3d0b12 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2987,18 +2987,17 @@ def load_emerge_config(trees=None):
 			kwargs[k] = v
 	trees = portage.create_trees(trees=trees, **kwargs)
 
-	settings = trees[trees._target_eroot]['vartree'].settings
-	mtimedbfile = os.path.join(settings['EROOT'], portage.CACHE_PATH, "mtimedb")
-	mtimedb = portage.MtimeDB(mtimedbfile)
-	QueryCommand._db = trees
-
 	for root, root_trees in trees.items():
 		settings = root_trees["vartree"].settings
 		settings._init_dirs()
 		setconfig = load_default_config(settings, root_trees)
 		root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
-	
-	return trees[trees._target_eroot]['vartree'].settings, trees, mtimedb
+
+	settings = trees[trees._target_eroot]['vartree'].settings
+	mtimedbfile = os.path.join(settings['EROOT'], portage.CACHE_PATH, "mtimedb")
+	mtimedb = portage.MtimeDB(mtimedbfile)
+	QueryCommand._db = trees
+	return settings, trees, mtimedb
 
 def chk_updated_cfg_files(eroot, config_protect):
 	target_root = eroot



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-13 17:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-13 17:27 UTC (permalink / raw
  To: gentoo-commits

commit:     a3797a63a30579be3ba5418aad7e76fd520f9aee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 17:27:38 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 13 17:27:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3797a63

AbstractEbuildProcess: null in if not interactive

---
 pym/_emerge/AbstractEbuildProcess.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 4147ecb..6e1491b 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -92,7 +92,19 @@ class AbstractEbuildProcess(SpawnProcess):
 			else:
 				self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None)
 
-		SpawnProcess._start(self)
+		if self.fd_pipes is None:
+			self.fd_pipes = {}
+		null_fd = None
+		if 0 not in self.fd_pipes and \
+			"interactive" not in self.settings.get("PROPERTIES", "").split():
+			null_fd = os.open('/dev/null', os.O_RDONLY)
+			self.fd_pipes[0] = null_fd
+
+		try:
+			SpawnProcess._start(self)
+		finally:
+			if null_fd is not None:
+				os.close(null_fd)
 
 	def _init_ipc_fifos(self):
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-13 18:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-13 18:35 UTC (permalink / raw
  To: gentoo-commits

commit:     a628147b632ad8b33296f5698d30410854cf1d75
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 18:35:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 13 18:35:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a628147b

AbstractEbuildProcess: interactive pkg_config

---
 pym/_emerge/AbstractEbuildProcess.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 6e1491b..63368d4 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -21,6 +21,7 @@ class AbstractEbuildProcess(SpawnProcess):
 	__slots__ = ('phase', 'settings',) + \
 		('_build_dir', '_ipc_daemon', '_exit_command',)
 	_phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',)
+	_phases_interactive_whitelist = ('config',)
 
 	# Number of milliseconds to allow natural exit of the ebuild
 	# process after it has called the exit command via IPC. It
@@ -96,6 +97,7 @@ class AbstractEbuildProcess(SpawnProcess):
 			self.fd_pipes = {}
 		null_fd = None
 		if 0 not in self.fd_pipes and \
+			self.phase not in self._phases_interactive_whitelist and \
 			"interactive" not in self.settings.get("PROPERTIES", "").split():
 			null_fd = os.open('/dev/null', os.O_RDONLY)
 			self.fd_pipes[0] = null_fd



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-13 20:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-13 20:01 UTC (permalink / raw
  To: gentoo-commits

commit:     4d9c153df82200d76684b6a9de69994c5f325971
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 20:01:23 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 13 20:01:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d9c153d

FifoIpcDaemon: use plain fd instead of fdopen

---
 pym/_emerge/FifoIpcDaemon.py |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index a716dac..b1f7a95 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -15,14 +15,14 @@ class FifoIpcDaemon(AbstractPollTask):
 
 	def _start(self):
 		self._files = self._files_dict()
-		input_fd = os.open(self.input_fifo, os.O_RDONLY|os.O_NONBLOCK)
 
 		# File streams are in unbuffered mode since we do atomic
 		# read and write of whole pickles.
-		self._files.pipe_in = os.fdopen(input_fd, 'rb', 0)
+		self._files.pipe_in = \
+			os.open(self.input_fifo, os.O_RDONLY|os.O_NONBLOCK)
 
 		self._reg_id = self.scheduler.register(
-			self._files.pipe_in.fileno(),
+			self._files.pipe_in,
 			self._registered_events, self._input_handler)
 
 		self._registered = True
@@ -32,12 +32,12 @@ class FifoIpcDaemon(AbstractPollTask):
 		Re-open the input stream, in order to suppress
 		POLLHUP events (bug #339976).
 		"""
-		self._files.pipe_in.close()
-		input_fd = os.open(self.input_fifo, os.O_RDONLY|os.O_NONBLOCK)
-		self._files.pipe_in = os.fdopen(input_fd, 'rb', 0)
 		self.scheduler.unregister(self._reg_id)
+		os.close(self._files.pipe_in)
+		self._files.pipe_in = \
+			os.open(self.input_fifo, os.O_RDONLY|os.O_NONBLOCK)
 		self._reg_id = self.scheduler.register(
-			self._files.pipe_in.fileno(),
+			self._files.pipe_in,
 			self._registered_events, self._input_handler)
 
 	def isAlive(self):
@@ -77,5 +77,5 @@ class FifoIpcDaemon(AbstractPollTask):
 
 		if self._files is not None:
 			for f in self._files.values():
-				f.close()
+				os.close(f)
 			self._files = None



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-14  6:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-14  6:30 UTC (permalink / raw
  To: gentoo-commits

commit:     1a26bf9e433abff5f0b68f2a3b546eac732a359b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 06:30:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 06:30:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a26bf9e

SpawnProcess: use /dev/null fd from subclass

---
 pym/_emerge/SpawnProcess.py |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 065146c..84493fe 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -39,16 +39,6 @@ class SpawnProcess(SubProcess):
 		if self.fd_pipes is None:
 			self.fd_pipes = {}
 		fd_pipes = self.fd_pipes
-		fd_pipes.setdefault(0, sys.stdin.fileno())
-		fd_pipes.setdefault(1, sys.stdout.fileno())
-		fd_pipes.setdefault(2, sys.stderr.fileno())
-
-		# flush any pending output
-		for fd in fd_pipes.values():
-			if fd == sys.stdout.fileno():
-				sys.stdout.flush()
-			if fd == sys.stderr.fileno():
-				sys.stderr.flush()
 
 		self._files = self._files_dict()
 		files = self._files
@@ -62,22 +52,35 @@ class SpawnProcess(SubProcess):
 			logfile = self.logfile
 
 		null_input = None
-		fd_pipes_orig = fd_pipes.copy()
-		if self.background:
+		if not self.background or 0 in fd_pipes:
+			# Subclasses such as AbstractEbuildProcess may have already passed
+			# in a null file descriptor in fd_pipes, so use that when given.
+			pass
+		else:
 			# TODO: Use job control functions like tcsetpgrp() to control
 			# access to stdin. Until then, use /dev/null so that any
 			# attempts to read from stdin will immediately return EOF
 			# instead of blocking indefinitely.
 			null_input = open('/dev/null', 'rb')
 			fd_pipes[0] = null_input.fileno()
-		else:
-			fd_pipes[0] = fd_pipes_orig[0]
+
+		fd_pipes.setdefault(0, sys.stdin.fileno())
+		fd_pipes.setdefault(1, sys.stdout.fileno())
+		fd_pipes.setdefault(2, sys.stderr.fileno())
+
+		# flush any pending output
+		for fd in fd_pipes.values():
+			if fd == sys.stdout.fileno():
+				sys.stdout.flush()
+			if fd == sys.stderr.fileno():
+				sys.stderr.flush()
 
 		# WARNING: It is very important to use unbuffered mode here,
 		# in order to avoid issue 5380 with python3.
 		files.process = os.fdopen(master_fd, 'rb', 0)
 		if logfile is not None:
 
+			fd_pipes_orig = fd_pipes.copy()
 			fd_pipes[1] = slave_fd
 			fd_pipes[2] = slave_fd
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-14  7:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-14  7:31 UTC (permalink / raw
  To: gentoo-commits

commit:     7de863659d624468830ebc342806f255f245b4af
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 07:31:43 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 07:31:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7de86365

emergelog: pass path to lockfile, not file object

---
 pym/_emerge/emergelog.py |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index d6ef1b4..b1b093f 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -49,15 +49,12 @@ def emergelog(xterm_titles, mystr, short_msg=None):
 			portage.util.apply_secpass_permissions(file_path,
 				uid=portage.portage_uid, gid=portage.portage_gid,
 				mode=0o660)
-		mylock = None
+		mylock = portage.locks.lockfile(file_path)
 		try:
-			mylock = portage.locks.lockfile(mylogfile)
 			mylogfile.write(_log_fmt % (time.time(), mystr))
-			mylogfile.flush()
-		finally:
-			if mylock:
-				portage.locks.unlockfile(mylock)
 			mylogfile.close()
+		finally:
+			portage.locks.unlockfile(mylock)
 	except (IOError,OSError,portage.exception.PortageException) as e:
 		if secpass >= 1:
 			print("emergelog():",e, file=sys.stderr)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-16 18:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-16 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     36632047bebbd435610944ad9e7850163b260645
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 16 18:58:35 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 18:58:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=36632047

Fix EIO handling for PollSelectAdapter.

In PipeReader and AbstractPollTask, we have to treat EIO as EOF, in
order to terminate the select loop at the correct time when using
PollSelectAdapter. This fixes a regression in EIO handling since
commits 915348ce34fc499ac295b8f0ffee9f0829803542 adn
30d2d0a9db486c5a70848ad5d27b37a3ec48f271.

---
 pym/_emerge/AbstractPollTask.py |    9 +++++++--
 pym/_emerge/PipeReader.py       |    9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index ea13587..d4785a2 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -50,9 +50,14 @@ class AbstractPollTask(AsynchronousTask):
 			except OSError as e:
 				# EIO happens with pty on Linux after the
 				# slave end of the pty has been closed.
-				if e.errno not in (errno.EAGAIN, errno.EIO):
+				if e.errno == errno.EIO:
+					# EOF: return empty buffer
+					pass
+				elif e.errno == errno.EAGAIN:
+					# EAGAIN: return None
+					buf = None
+				else:
 					raise
-				buf = None
 
 		return buf
 

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 78acb72..a465c2a 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -66,9 +66,14 @@ class PipeReader(AbstractPollTask):
 				except OSError as e:
 					# EIO happens with pty on Linux after the
 					# slave end of the pty has been closed.
-					if e.errno not in (errno.EAGAIN, errno.EIO):
+					if e.errno == errno.EIO:
+						self._unregister()
+						self.wait()
+						break
+					elif e.errno == errno.EAGAIN:
+						break
+					else:
 						raise
-					break
 				else:
 					if data:
 						self._read_data.append(data)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-16 19:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-16 19:18 UTC (permalink / raw
  To: gentoo-commits

commit:     f75fc7375ea902da2e96825ca27c8b7f5031a491
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 16 19:18:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 19:18:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f75fc737

SpawnProcess: remove obsolete fdopen

Since commit 30d2d0a9db486c5a70848ad5d27b37a3ec48f271, we use os.read()
due to bugs in array.fromfile(), so there's no need to use fdopen.

---
 pym/_emerge/SpawnProcess.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index c2f4928..9f83ef0 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -46,6 +46,7 @@ class SpawnProcess(SubProcess):
 		master_fd, slave_fd = self._pipe(fd_pipes)
 		fcntl.fcntl(master_fd, fcntl.F_SETFL,
 			fcntl.fcntl(master_fd, fcntl.F_GETFL) | os.O_NONBLOCK)
+		files.process = master_fd
 
 		logfile = None
 		if self._can_log(slave_fd):
@@ -75,9 +76,6 @@ class SpawnProcess(SubProcess):
 			if fd == sys.stderr.fileno():
 				sys.stderr.flush()
 
-		# WARNING: It is very important to use unbuffered mode here,
-		# in order to avoid issue 5380 with python3.
-		files.process = os.fdopen(master_fd, 'rb', 0)
 		if logfile is not None:
 
 			fd_pipes_orig = fd_pipes.copy()
@@ -120,7 +118,7 @@ class SpawnProcess(SubProcess):
 		kwargs["returnpid"] = True
 		kwargs.pop("logfile", None)
 
-		self._reg_id = self.scheduler.register(files.process.fileno(),
+		self._reg_id = self.scheduler.register(files.process,
 			self._registered_events, output_handler)
 		self._registered = True
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-16 19:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-16 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     f1ec68632ff22b72b25c0d70cc2f2c137f957a91
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 16 19:32:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 19:32:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f1ec6863

SpawnProcess/AbstractPollTask: eliminate array

Since commit 30d2d0a9db486c5a70848ad5d27b37a3ec48f271, we use os.read()
due to bugs in array.fromfile(). So, eliminate array usage entirely.

---
 pym/_emerge/AbstractPollTask.py |   20 ++++++--------------
 pym/_emerge/SpawnProcess.py     |   13 ++-----------
 2 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index d4785a2..b3c0b2d 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -1,7 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-import array
 import errno
 import logging
 import os
@@ -27,10 +26,9 @@ class AbstractPollTask(AsynchronousTask):
 		| POLLIN | RETURN
 		| BIT    | VALUE
 		| ---------------------------------------------------
-		| 1      | Read self._bufsize into an instance of
-		|        | array.array('B') and return it, ignoring
-		|        | EOFError and IOError. An empty array
-		|        | indicates EOF.
+		| 1      | Read self._bufsize into a string of bytes,
+		|        | handling EAGAIN and EIO. An empty string
+		|        | of bytes indicates EOF.
 		| ---------------------------------------------------
 		| 0      | None
 		"""
@@ -39,20 +37,14 @@ class AbstractPollTask(AsynchronousTask):
 		# and Python 3.2).
 		buf = None
 		if event & PollConstants.POLLIN:
-			buf = array.array('B')
 			try:
-				# Python >=3.2
-				frombytes = buf.frombytes
-			except AttributeError:
-				frombytes = buf.fromstring
-			try:
-				frombytes(os.read(fd, self._bufsize))
+				buf = os.read(fd, self._bufsize)
 			except OSError as e:
 				# EIO happens with pty on Linux after the
 				# slave end of the pty has been closed.
 				if e.errno == errno.EIO:
-					# EOF: return empty buffer
-					pass
+					# EOF: return empty string of bytes
+					buf = b''
 				elif e.errno == errno.EAGAIN:
 					# EAGAIN: return None
 					buf = None

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 9f83ef0..ec5bf7d 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -183,7 +183,7 @@ class SpawnProcess(SubProcess):
 					while True:
 						try:
 							if not write_successful:
-								buf.tofile(files.stdout)
+								files.stdout.write(buf)
 								write_successful = True
 							files.stdout.flush()
 							break
@@ -213,16 +213,7 @@ class SpawnProcess(SubProcess):
 								fcntl.fcntl(files.stdout.fileno(),
 								fcntl.F_GETFL) ^ os.O_NONBLOCK)
 
-				try:
-					buf.tofile(files.log)
-				except TypeError:
-					# array.tofile() doesn't work with GzipFile
-					try:
-						# Python >=3.2
-						data = buf.tobytes()
-					except AttributeError:
-						data = buf.tostring()
-					files.log.write(data)
+				files.log.write(buf)
 				files.log.flush()
 
 		self._unregister_if_appropriate(event)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-16 19:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-16 19:56 UTC (permalink / raw
  To: gentoo-commits

commit:     2eea0db1855009c3407ba6eae1dc095297769989
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 16 19:56:01 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 19:56:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2eea0db1

PipeReader: use AbstractPollTask._read_buf()

---
 pym/_emerge/PipeReader.py |   36 ++++++++++--------------------------
 1 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index a465c2a..9fedbff 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -3,8 +3,6 @@
 
 from portage import os
 from _emerge.AbstractPollTask import AbstractPollTask
-from _emerge.PollConstants import PollConstants
-import errno
 import fcntl
 
 class PipeReader(AbstractPollTask):
@@ -57,30 +55,16 @@ class PipeReader(AbstractPollTask):
 
 	def _output_handler(self, fd, event):
 
-		if event & PollConstants.POLLIN:
-
-			while True:
-				data = None
-				try:
-					data = os.read(fd, self._bufsize)
-				except OSError as e:
-					# EIO happens with pty on Linux after the
-					# slave end of the pty has been closed.
-					if e.errno == errno.EIO:
-						self._unregister()
-						self.wait()
-						break
-					elif e.errno == errno.EAGAIN:
-						break
-					else:
-						raise
-				else:
-					if data:
-						self._read_data.append(data)
-					else:
-						self._unregister()
-						self.wait()
-						break
+		while True:
+			data = self._read_buf(fd, event)
+			if data is None:
+				break
+			if data:
+				self._read_data.append(data)
+			else:
+				self._unregister()
+				self.wait()
+				break
 
 		self._unregister_if_appropriate(event)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-17 19:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-17 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     36a6673199602796bf1626a4bd4110b99e590e5c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 17 19:32:59 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 17 19:32:59 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=36a66731

_show_unsatisfied_dep: avoid invalid, bug #394995

---
 pym/_emerge/depgraph.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e7307c0..63365cd 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2985,12 +2985,20 @@ class depgraph(object):
 							repo = metadata.get('repository')
 						pkg = self._pkg(cpv, pkg_type, root_config,
 							installed=installed, myrepo=repo)
-						if not atom_set.findAtomForPackage(pkg,
-							modified_use=self._pkg_use_enabled(pkg)):
-							continue
 						# pkg.metadata contains calculated USE for ebuilds,
 						# required later for getMissingLicenses.
 						metadata = pkg.metadata
+						if pkg.invalid:
+							# Avoid doing any operations with packages that
+							# have invalid metadata. It would be unsafe at
+							# least because it could trigger unhandled
+							# exceptions in places like check_required_use().
+							masked_packages.append(
+								(root_config, pkgsettings, cpv, repo, metadata, mreasons))
+							continue
+						if not atom_set.findAtomForPackage(pkg,
+							modified_use=self._pkg_use_enabled(pkg)):
+							continue
 						if pkg in self._dynamic_config._runtime_pkg_mask:
 							backtrack_reasons = \
 								self._dynamic_config._runtime_pkg_mask[pkg]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-19  0:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-19  0:13 UTC (permalink / raw
  To: gentoo-commits

commit:     7a0a0a1dc02487b08f47fef129a29e18f7c226a0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 19 00:12:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 00:12:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a0a0a1d

_run_pkg_pretend: doebuild_environment for clean

---
 pym/_emerge/Scheduler.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 302b905..3800b8b 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -866,6 +866,20 @@ class Scheduler(PollScheduler):
 				# Clean up the existing build dir, in case pkg_pretend
 				# checks for available space (bug #390711).
 				if existing_buildir:
+					if x.built:
+						tree = "bintree"
+						infloc = os.path.join(build_dir_path, "build-info")
+						ebuild_path = os.path.join(infloc, x.pf + ".ebuild")
+					else:
+						tree = "porttree"
+						portdb = root_config.trees["porttree"].dbapi
+						ebuild_path = portdb.findname(x.cpv, myrepo=x.repo)
+						if ebuild_path is None:
+							raise AssertionError(
+								"ebuild not found for '%s'" % x.cpv)
+					portage.package.ebuild.doebuild.doebuild_environment(
+						ebuild_path, "clean", settings=settings,
+						db=self.trees[settings['EROOT']][tree].dbapi)
 					clean_phase = EbuildPhase(background=False,
 						phase='clean', scheduler=sched_iface, settings=settings)
 					current_task = clean_phase



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-22  0:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-22  0:44 UTC (permalink / raw
  To: gentoo-commits

commit:     0cb2523bca051aa06e73169d647d2ad3278fa25f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 22 00:44:37 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 00:44:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0cb2523b

search.py: use _aux_cache_keys more

This helps to avoid triggering the environment.bz2 extraction in
vardbapi.aux_get().

---
 pym/_emerge/search.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index acfcfd0..5abc8a0 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -151,7 +151,7 @@ class search(object):
 					if not result or cpv == portage.best([cpv, result]):
 						result = cpv
 				else:
-					db_keys = Package.metadata_keys
+					db_keys = list(db._aux_cache_keys)
 					# break out of this loop with highest visible
 					# match, checked in descending order
 					for cpv in reversed(db.match(atom)):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-23 10:15 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-23 10:15 UTC (permalink / raw
  To: gentoo-commits

commit:     1ad30a09a9beeb5ddb4b508c0698dea665be50d5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 10:15:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 10:15:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ad30a09

depgraph.py: remove unused variables

---
 pym/_emerge/depgraph.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2c44ce1..81b1743 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -927,7 +927,6 @@ class depgraph(object):
 		debug = "--debug" in self._frozen_config.myopts
 		buildpkgonly = "--buildpkgonly" in self._frozen_config.myopts
 		nodeps = "--nodeps" in self._frozen_config.myopts
-		deep = self._dynamic_config.myparams.get("deep", 0)
 		if dep.blocker:
 			if not buildpkgonly and \
 				not nodeps and \
@@ -1287,7 +1286,7 @@ class depgraph(object):
 					settings.unlock()
 					settings.setinst(pkg.cpv, pkg.metadata)
 					settings.lock()
-				except portage.exception.InvalidDependString as e:
+				except portage.exception.InvalidDependString:
 					if not pkg.installed:
 						# should have been masked before it was selected
 						raise
@@ -1360,7 +1359,6 @@ class depgraph(object):
 
 	def _add_pkg_deps(self, pkg, allow_unsatisfied=False):
 
-		mytype = pkg.type_name
 		myroot = pkg.root
 		metadata = pkg.metadata
 		removal_action = "remove" in self._dynamic_config.myparams



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-23 18:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-23 18:07 UTC (permalink / raw
  To: gentoo-commits

commit:     f7f35fe13abfb038f4ac38e3ec6d56b55c58abc8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 18:07:35 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 18:07:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f7f35fe1

AbstractPollTask: note PipeReaderArrayTestCase

---
 pym/_emerge/AbstractPollTask.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 83e6c7b..13e3c23 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -26,13 +26,13 @@ class AbstractPollTask(AsynchronousTask):
 		"""
 		NOTE: array.fromfile() is used here only for testing purposes,
 		because it has bugs in all known versions of Python (including
-		Python 2.7 and Python 3.2).
+		Python 2.7 and Python 3.2). See PipeReaderArrayTestCase.
 
 		| POLLIN | RETURN
 		| BIT    | VALUE
 		| ---------------------------------------------------
 		| 1      | Read self._bufsize into an instance of
-		|        | array.array('B') and return it, ignoring
+		|        | array.array('B') and return it, handling
 		|        | EOFError and IOError. An empty array
 		|        | indicates EOF.
 		| ---------------------------------------------------



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2011-12-24 10:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2011-12-24 10:23 UTC (permalink / raw
  To: gentoo-commits

commit:     9446ae1efbbac8a42654007109c94dc3f161f430
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 24 10:23:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 24 10:23:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9446ae1e

FakeVartree: implement self.dbapi._aux_cache_keys

This will fix bug #395879.

---
 pym/_emerge/FakeVartree.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index e1e5757..d4dbe97 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -57,6 +57,7 @@ class FakeVartree(vartree):
 		self._db_keys = mykeys
 		self._pkg_cache = pkg_cache
 		self.dbapi = FakeVardbapi(real_vartree.settings)
+		self.dbapi._aux_cache_keys = set(self._db_keys)
 
 		# Initialize variables needed for lazy cache pulls of the live ebuild
 		# metadata.  This ensures that the vardb lock is released ASAP, without



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-01-12 16:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-01-12 16:33 UTC (permalink / raw
  To: gentoo-commits

commit:     eb97b85501583129e1f31039a443632633d5d887
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 12 16:32:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 12 16:32:53 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb97b855

depgraph: unevaluated parent atom in debug output

---
 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 81b1743..19daa4e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1058,9 +1058,12 @@ class depgraph(object):
 			else:
 				# Display the specific atom from SetArg or
 				# Package types.
+				uneval = ""
+				if dep.atom is not dep.atom.unevaluated_atom:
+					uneval = " (%s)" % (dep.atom.unevaluated_atom,)
 				writemsg_level(
-					"%s%s required by %s\n" %
-					("Parent Dep:".ljust(15), dep.atom, myparent),
+					"%s%s%s required by %s\n" %
+					("Parent Dep:".ljust(15), dep.atom, uneval, myparent),
 					level=logging.DEBUG, noiselevel=-1)
 
 		# Ensure that the dependencies of the same package



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-01-12 16:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-01-12 16:59 UTC (permalink / raw
  To: gentoo-commits

commit:     5438bb29c996d777b6343515995176912a7c137f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 12 16:59:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 12 16:59:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5438bb29

depgraph: account for unevaluated_atom in cache

---
 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 19daa4e..0c9e5f2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3450,7 +3450,7 @@ class depgraph(object):
 						yield pkg
 
 	def _select_pkg_highest_available(self, root, atom, onlydeps=False):
-		cache_key = (root, atom, onlydeps)
+		cache_key = (root, atom, atom.unevaluated_atom, onlydeps)
 		ret = self._dynamic_config._highest_pkg_cache.get(cache_key)
 		if ret is not None:
 			pkg, existing = ret



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-01-15 18:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-01-15 18:00 UTC (permalink / raw
  To: gentoo-commits

commit:     fb6020862e1b609f3006584d018221312bfbe581
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 15 17:59:37 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 18:00:01 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fb602086

create_world_atom: multi-repo portdbapi aux_get

This handles a KeyError raised from portdbapi.aux_get() when one of the
repositories has a corrupt ebuild.

---
 pym/_emerge/create_world_atom.py |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/create_world_atom.py b/pym/_emerge/create_world_atom.py
index fa7cffc..35fb7c4 100644
--- a/pym/_emerge/create_world_atom.py
+++ b/pym/_emerge/create_world_atom.py
@@ -21,8 +21,25 @@ def create_world_atom(pkg, args_set, root_config):
 	sets = root_config.sets
 	portdb = root_config.trees["porttree"].dbapi
 	vardb = root_config.trees["vartree"].dbapi
-	available_slots = set(portdb.aux_get(cpv, ["SLOT"])[0] \
-		for cpv in portdb.match(cp))
+
+	if arg_atom.repo is not None:
+		repos = [arg_atom.repo]
+	else:
+		# Iterate over portdbapi.porttrees, since it's common to
+		# tweak this attribute in order to adjust match behavior.
+		repos = []
+		for tree in portdb.porttrees:
+			repos.append(portdb.repositories.get_name_for_location(tree))
+
+	available_slots = set()
+	for cpv in portdb.match(cp):
+		for repo in repos:
+			try:
+				available_slots.add(portdb.aux_get(cpv, ["SLOT"],
+					myrepo=repo)[0])
+			except KeyError:
+				pass
+
 	slotted = len(available_slots) > 1 or \
 		(len(available_slots) == 1 and "0" not in available_slots)
 	if not slotted:
@@ -64,8 +81,18 @@ def create_world_atom(pkg, args_set, root_config):
 			# enough to identify a specific slot.
 			matches = mydb.match(arg_atom)
 			matched_slots = set()
-			for cpv in matches:
-				matched_slots.add(mydb.aux_get(cpv, ["SLOT"])[0])
+			if mydb is vardb:
+				for cpv in matches:
+					matched_slots.add(mydb.aux_get(cpv, ["SLOT"])[0])
+			else:
+				for cpv in matches:
+					for repo in repos:
+						try:
+							matched_slots.add(portdb.aux_get(cpv, ["SLOT"],
+								myrepo=repo)[0])
+						except KeyError:
+							pass
+
 			if len(matched_slots) == 1:
 				new_world_atom = slot_atom
 				if arg_atom.repo:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-01-20 20:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-01-20 20:29 UTC (permalink / raw
  To: gentoo-commits

commit:     a77292d37e3c2604479514abed2dda64dabace25
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 20 20:29:31 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 20 20:29:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a77292d3

Fix --changed-use interaction with bug 297549.

The automatic --binpkg-respect-use code (from bug #297549) was
inappropriately overriding --changed-use and triggering behavior like
--newuse, as reported here:

http://archives.gentoo.org/gentoo-dev/msg_6070ab87737d7e16a5cec2a72c9111fd.xml

---
 pym/_emerge/depgraph.py |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 0c9e5f2..6d0ba1c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -827,20 +827,28 @@ class depgraph(object):
 					else:
 						self._dynamic_config._slot_conflict_parent_atoms.add(parent_atom)
 
-	def _reinstall_for_flags(self, forced_flags,
+	def _reinstall_for_flags(self, pkg, forced_flags,
 		orig_use, orig_iuse, cur_use, cur_iuse):
 		"""Return a set of flags that trigger reinstallation, or None if there
 		are no such flags."""
-		if "--newuse" in self._frozen_config.myopts or \
-			self._dynamic_config.myparams.get(
-			"binpkg_respect_use") in ("y", "auto"):
+
+		# binpkg_respect_use: Behave like newuse by default. If newuse is
+		# False and changed_use is True, then behave like changed_use.
+		binpkg_respect_use = (pkg.built and
+			self._dynamic_config.myparams.get("binpkg_respect_use")
+			in ("y", "auto"))
+		newuse = "--newuse" in self._frozen_config.myopts
+		changed_use = "changed-use" == self._frozen_config.myopts.get("--reinstall")
+
+		if newuse or (binpkg_respect_use and not changed_use):
 			flags = set(orig_iuse.symmetric_difference(
 				cur_iuse).difference(forced_flags))
 			flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
 				cur_iuse.intersection(cur_use)))
 			if flags:
 				return flags
-		elif "changed-use" == self._frozen_config.myopts.get("--reinstall"):
+
+		elif changed_use or binpkg_respect_use:
 			flags = orig_iuse.intersection(orig_use).symmetric_difference(
 				cur_iuse.intersection(cur_use))
 			if flags:
@@ -4039,8 +4047,8 @@ class depgraph(object):
 						cur_iuse = iuses
 						if myeb and not usepkgonly and not useoldpkg:
 							cur_iuse = myeb.iuse.all
-						reinstall_for_flags = self._reinstall_for_flags(forced_flags,
-							old_use, iuses, now_use, cur_iuse)
+						reinstall_for_flags = self._reinstall_for_flags(pkg,
+							forced_flags, old_use, iuses, now_use, cur_iuse)
 						if reinstall_for_flags:
 							if not pkg.installed:
 								self._dynamic_config.ignored_binaries.setdefault(pkg, set()).update(reinstall_for_flags)
@@ -4060,7 +4068,7 @@ class depgraph(object):
 						cur_use = self._pkg_use_enabled(pkg)
 						cur_iuse = pkg.iuse.all
 						reinstall_for_flags = \
-							self._reinstall_for_flags(
+							self._reinstall_for_flags(pkg,
 							forced_flags, old_use, old_iuse,
 							cur_use, cur_iuse)
 						if reinstall_for_flags:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-07 23:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-07 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     e9d1125f6730c85c4b384a580da55da68338acf1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 19:11:50 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  7 19:11:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9d1125f

PollScheduler: add timeout_add like glib's

This will be useful as a substitute for recursion, in order to avoid
hitting the recursion limit for bug #402335.

---
 pym/_emerge/PollScheduler.py |   89 ++++++++++++++++++++++++++++++++++++++++--
 pym/_emerge/Scheduler.py     |    8 ++--
 2 files changed, 89 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index fd9dfc0..fd57359 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -24,7 +24,12 @@ from _emerge.PollSelectAdapter import PollSelectAdapter
 class PollScheduler(object):
 
 	class _sched_iface_class(SlotObject):
-		__slots__ = ("output", "register", "schedule", "unregister")
+		__slots__ = ("output", "register", "schedule",
+			"source_remove", "timeout_add", "unregister")
+
+	class _timeout_handler_class(SlotObject):
+		__slots__ = ("args", "function", "interval", "source_id",
+			"timestamp")
 
 	def __init__(self):
 		self._terminated = threading.Event()
@@ -37,13 +42,17 @@ class PollScheduler(object):
 		self._poll_event_handler_ids = {}
 		# Increment id for each new handler.
 		self._event_handler_id = 0
+		self._timeout_handlers = {}
 		self._poll_obj = create_poll_instance()
+		self._polling = False
 		self._scheduling = False
 		self._background = False
 		self.sched_iface = self._sched_iface_class(
 			output=self._task_output,
 			register=self._register,
 			schedule=self._schedule_wait,
+			source_remove=self._unregister,
+			timeout_add=self._timeout_add,
 			unregister=self._unregister)
 
 	def terminate(self):
@@ -82,7 +91,7 @@ class PollScheduler(object):
 		should return False immediately (since there's no need to
 		schedule anything after _terminate_tasks() has been called).
 		"""
-		raise NotImplementedError()
+		pass
 
 	def _schedule(self):
 		"""
@@ -140,6 +149,23 @@ class PollScheduler(object):
 		StopIteration if timeout is None and there are
 		no file descriptors to poll.
 		"""
+		if self._polling:
+			return
+		self._polling = True
+		try:
+			self._do_poll(timeout=timeout)
+		finally:
+			self._polling = False
+
+	def _do_poll(self, timeout=None):
+		"""
+		All poll() calls pass through here. The poll events
+		are added directly to self._poll_event_queue.
+		In order to avoid endless blocking, this raises
+		StopIteration if timeout is None and there are
+		no file descriptors to poll.
+		"""
+		self._run_timeouts()
 		if not self._poll_event_handlers:
 			self._schedule()
 			if timeout is None and \
@@ -226,6 +252,51 @@ class PollScheduler(object):
 
 		return bool(events_handled)
 
+	def _timeout_add(self, interval, function, *args):
+		"""
+		Like glib.timeout_add(), interval argument is the number of
+		milliseconds between calls to your function, and your function
+		should return False to stop being called, or True to continue
+		being called. Any additional positional arguments given here
+		are passed to your function when it's called.
+
+		NOTE: Timeouts registered by this function currently do not
+		keep the main loop running when there are no remaining callbacks
+		registered for IO events. This is not an issue if the purpose of
+		the timeout is to place an upper limit on the time allowed for
+		a particular IO event to occur, since the handler associated with
+		the IO event will serve to keep the main loop running.
+		"""
+		self._event_handler_id += 1
+		source_id = self._event_handler_id
+		self._timeout_handlers[source_id] = \
+			self._timeout_handler_class(
+				interval=interval, function=function, args=args,
+				source_id=source_id, timestamp=time.time())
+		return source_id
+
+	def _run_timeouts(self):
+		ready_timeouts = []
+		current_time = time.time()
+		for x in self._timeout_handlers.values():
+			elapsed_seconds = current_time - x.timestamp
+			# elapsed_seconds < 0 means the system clock has been adjusted
+			if elapsed_seconds < 0 or \
+				(x.interval - 1000 * elapsed_seconds) <= 0:
+				ready_timeouts.append(x)
+
+		# Iterate of our local list, since self._timeout_handlers can be
+		# modified during the exection of these callbacks.
+		for x in ready_timeouts:
+			if x.source_id not in self._timeout_handlers:
+				# it got cancelled while executing another timeout
+				continue
+			x.timestamp = time.time()
+			if not x.function(*x.args):
+				self._unregister(x.source_id)
+
+		return bool(ready_timeouts)
+
 	def _register(self, f, eventmask, handler):
 		"""
 		@rtype: Integer
@@ -242,7 +313,17 @@ class PollScheduler(object):
 		return reg_id
 
 	def _unregister(self, reg_id):
-		f = self._poll_event_handler_ids[reg_id]
+		"""
+		Like glib.source_remove(), this returns True if the given reg_id
+		is found and removed, and False if the reg_id is invalid or has
+		already been removed.
+		"""
+		timeout_handler = self._timeout_handlers.pop(reg_id, None)
+		if timeout_handler is not None:
+			return True
+		f = self._poll_event_handler_ids.pop(reg_id, None)
+		if f is None:
+			return False
 		self._poll_obj.unregister(f)
 		if self._poll_event_queue:
 			# Discard any unhandled events that belong to this file,
@@ -262,7 +343,7 @@ class PollScheduler(object):
 				self._poll_event_queue[:] = remaining_events
 
 		del self._poll_event_handlers[f]
-		del self._poll_event_handler_ids[reg_id]
+		return True
 
 	def _schedule_wait(self, wait_ids=None, timeout=None, condition=None):
 		"""

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d09b474..5b56650 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -79,11 +79,9 @@ class Scheduler(PollScheduler):
 	_opts_no_self_update = frozenset(["--buildpkgonly",
 		"--fetchonly", "--fetch-all-uri", "--pretend"])
 
-	class _iface_class(SlotObject):
+	class _iface_class(PollScheduler._sched_iface_class):
 		__slots__ = ("fetch",
-			"output", "register", "schedule",
-			"scheduleSetup", "scheduleUnpack", "scheduleYield",
-			"unregister")
+			"scheduleSetup", "scheduleUnpack", "scheduleYield")
 
 	class _fetch_iface_class(SlotObject):
 		__slots__ = ("log_file", "schedule")
@@ -223,6 +221,8 @@ class Scheduler(PollScheduler):
 			scheduleSetup=self._schedule_setup,
 			scheduleUnpack=self._schedule_unpack,
 			scheduleYield=self._schedule_yield,
+			source_remove=self._unregister,
+			timeout_add=self._timeout_add,
 			unregister=self._unregister)
 
 		self._prefetchers = weakref.WeakValueDictionary()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-07 23:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-07 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     839f369f259a7c019c1f544bf4c153058355f6d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 02:52:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  7 19:12:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=839f369f

AsynchronousTask: merge _waiting from subclass

---
 pym/_emerge/AsynchronousLock.py |    7 ++-----
 pym/_emerge/AsynchronousTask.py |   10 ++++++++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index ae3bde4..3593834 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -36,7 +36,7 @@ class AsynchronousLock(AsynchronousTask):
 
 	__slots__ = ('path', 'scheduler',) + \
 		('_imp', '_force_async', '_force_dummy', '_force_process', \
-		'_force_thread', '_waiting')
+		'_force_thread')
 
 	_use_process_by_default = True
 
@@ -67,8 +67,7 @@ class AsynchronousLock(AsynchronousTask):
 
 	def _imp_exit(self, imp):
 		# call exit listeners
-		if not self._waiting:
-			self.wait()
+		self.wait()
 
 	def _cancel(self):
 		if isinstance(self._imp, AsynchronousTask):
@@ -82,9 +81,7 @@ class AsynchronousLock(AsynchronousTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-		self._waiting = True
 		self.returncode = self._imp.wait()
-		self._waiting = False
 		return self.returncode
 
 	def unlock(self):

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 36522ca..4aa5980 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -14,7 +14,8 @@ class AsynchronousTask(SlotObject):
 	"""
 
 	__slots__ = ("background", "cancelled", "returncode") + \
-		("_exit_listeners", "_exit_listener_stack", "_start_listeners")
+		("_exit_listeners", "_exit_listener_stack", "_start_listeners",
+		"_waiting")
 
 	def start(self):
 		"""
@@ -42,7 +43,12 @@ class AsynchronousTask(SlotObject):
 
 	def wait(self):
 		if self.returncode is None:
-			self._wait()
+			if not self._waiting:
+				self._waiting = True
+				try:
+					self._wait()
+				finally:
+					self._waiting = False
 		self._wait_hook()
 		return self.returncode
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-07 23:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-07 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     fa983106fac83ca29f242cca37ce8ddf565f92d6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 19:40:55 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  7 19:40:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fa983106

PollScheduler: timeouts regardless of IO events

Now PollScheduler will execute timeouts predictably, even when there
no IO events being generated. This allows the Scheduler's display
updates to be handled via timeout_add.

---
 pym/_emerge/JobStatusDisplay.py |   10 ++++--
 pym/_emerge/PollScheduler.py    |   59 +++++++++++++++++++++++++++++++++------
 pym/_emerge/Scheduler.py        |   46 ++----------------------------
 3 files changed, 59 insertions(+), 56 deletions(-)

diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py
index 877a0c9..d84d1b0 100644
--- a/pym/_emerge/JobStatusDisplay.py
+++ b/pym/_emerge/JobStatusDisplay.py
@@ -209,24 +209,26 @@ class JobStatusDisplay(object):
 	def display(self):
 		"""
 		Display status on stdout, but only if something has
-		changed since the last call.
+		changed since the last call. This always returns True,
+		for continuous scheduling via timeout_add.
 		"""
 
 		if self.quiet:
-			return
+			return True
 
 		current_time = time.time()
 		time_delta = current_time - self._last_display_time
 		if self._displayed and \
 			not self._changed:
 			if not self._isatty:
-				return
+				return True
 			if time_delta < self._min_display_latency:
-				return
+				return True
 
 		self._last_display_time = current_time
 		self._changed = False
 		self._display_status()
+		return True
 
 	def _display_status(self):
 		# Don't use len(self._completed_tasks) here since that also

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index fd57359..757d12e 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -43,6 +43,7 @@ class PollScheduler(object):
 		# Increment id for each new handler.
 		self._event_handler_id = 0
 		self._timeout_handlers = {}
+		self._timeout_interval = None
 		self._poll_obj = create_poll_instance()
 		self._polling = False
 		self._scheduling = False
@@ -142,18 +143,51 @@ class PollScheduler(object):
 		return True
 
 	def _poll(self, timeout=None):
-		"""
-		All poll() calls pass through here. The poll events
-		are added directly to self._poll_event_queue.
-		In order to avoid endless blocking, this raises
-		StopIteration if timeout is None and there are
-		no file descriptors to poll.
-		"""
 		if self._polling:
 			return
 		self._polling = True
 		try:
-			self._do_poll(timeout=timeout)
+			if self._timeout_interval is None:
+				self._run_timeouts()
+				self._do_poll(timeout=timeout)
+
+			elif timeout is None:
+				while True:
+					self._run_timeouts()
+					previous_count = len(self._poll_event_queue)
+					self._do_poll(timeout=self._timeout_interval)
+					if previous_count != len(self._poll_event_queue):
+						break
+
+			elif timeout <= self._timeout_interval:
+				self._run_timeouts()
+				self._do_poll(timeout=timeout)
+
+			else:
+				remaining_timeout = timeout
+				start_time = time.time()
+				while True:
+					self._run_timeouts()
+					# _timeout_interval can change each time
+					# _run_timeouts is called
+					min_timeout = remaining_timeout
+					if self._timeout_interval is not None and \
+						self._timeout_interval < min_timeout:
+						min_timeout = self._timeout_interval
+
+					previous_count = len(self._poll_event_queue)
+					self._do_poll(timeout=min_timeout)
+					if previous_count != len(self._poll_event_queue):
+						break
+					elapsed_time = time.time() - start_time
+					if elapsed_time < 0:
+						# The system clock has changed such that start_time
+						# is now in the future, so just assume that the
+						# timeout has already elapsed.
+						break
+					remaining_timeout = timeout - 1000 * elapsed_time
+					if remaining_timeout <= 0:
+						break
 		finally:
 			self._polling = False
 
@@ -165,7 +199,6 @@ class PollScheduler(object):
 		StopIteration if timeout is None and there are
 		no file descriptors to poll.
 		"""
-		self._run_timeouts()
 		if not self._poll_event_handlers:
 			self._schedule()
 			if timeout is None and \
@@ -273,6 +306,8 @@ class PollScheduler(object):
 			self._timeout_handler_class(
 				interval=interval, function=function, args=args,
 				source_id=source_id, timestamp=time.time())
+		if self._timeout_interval is None or self._timeout_interval < interval:
+			self._timeout_interval = interval
 		return source_id
 
 	def _run_timeouts(self):
@@ -320,6 +355,12 @@ class PollScheduler(object):
 		"""
 		timeout_handler = self._timeout_handlers.pop(reg_id, None)
 		if timeout_handler is not None:
+			if timeout_handler.interval >= self._timeout_interval:
+				if self._timeout_handlers:
+					self._timeout_interval = \
+						min(x.interval for x in self._timeout_handlers.values())
+				else:
+					self._timeout_interval = None
 			return True
 		f = self._poll_event_handler_ids.pop(reg_id, None)
 		if f is None:

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5b56650..e6f3e0e 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -196,6 +196,8 @@ class Scheduler(PollScheduler):
 
 		self._status_display = JobStatusDisplay(
 			xterm_titles=('notitles' not in settings.features))
+		self._timeout_add(self._max_display_latency,
+			self._status_display.display)
 		self._max_load = myopts.get("--load-average")
 		max_jobs = myopts.get("--jobs")
 		if max_jobs is None:
@@ -352,50 +354,8 @@ class Scheduler(PollScheduler):
 		gc.collect()
 
 	def _poll(self, timeout=None):
-
 		self._schedule()
-
-		if timeout is None:
-			while True:
-				if not self._poll_event_handlers:
-					self._schedule()
-					if not self._poll_event_handlers:
-						raise StopIteration(
-							"timeout is None and there are no poll() event handlers")
-				previous_count = len(self._poll_event_queue)
-				PollScheduler._poll(self, timeout=self._max_display_latency)
-				self._status_display.display()
-				if previous_count != len(self._poll_event_queue):
-					break
-
-		elif timeout <= self._max_display_latency:
-			PollScheduler._poll(self, timeout=timeout)
-			if timeout == 0:
-				# The display is updated by _schedule() above, so it would be
-				# redundant to update it here when timeout is 0.
-				pass
-			else:
-				self._status_display.display()
-
-		else:
-			remaining_timeout = timeout
-			start_time = time.time()
-			while True:
-				previous_count = len(self._poll_event_queue)
-				PollScheduler._poll(self,
-					timeout=min(self._max_display_latency, remaining_timeout))
-				self._status_display.display()
-				if previous_count != len(self._poll_event_queue):
-					break
-				elapsed_time = time.time() - start_time
-				if elapsed_time < 0:
-					# The system clock has changed such that start_time
-					# is now in the future, so just assume that the
-					# timeout has already elapsed.
-					break
-				remaining_timeout = timeout - 1000 * elapsed_time
-				if remaining_timeout <= 0:
-					break
+		PollScheduler._poll(self, timeout=timeout)
 
 	def _set_max_jobs(self, max_jobs):
 		self._max_jobs = max_jobs



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-07 23:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-07 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     445a6ea22c132f4c06c2cc7c48ec6e7af7116962
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 02:58:51 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  7 19:12:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=445a6ea2

Use timeout_add to avoid recursion, bug #402335.

---
 pym/_emerge/AbstractEbuildProcess.py |   37 ++++++++++++++++++++++++++-------
 pym/_emerge/SubProcess.py            |    6 ++++-
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 63368d4..5742cb2 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -19,7 +19,7 @@ from portage.util import apply_secpass_permissions
 class AbstractEbuildProcess(SpawnProcess):
 
 	__slots__ = ('phase', 'settings',) + \
-		('_build_dir', '_ipc_daemon', '_exit_command',)
+		('_build_dir', '_ipc_daemon', '_exit_command', '_exit_timeout_id')
 	_phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',)
 	_phases_interactive_whitelist = ('config',)
 
@@ -157,13 +157,30 @@ class AbstractEbuildProcess(SpawnProcess):
 	def _exit_command_callback(self):
 		if self._registered:
 			# Let the process exit naturally, if possible.
-			self.scheduler.schedule(self._reg_id, timeout=self._exit_timeout)
-			if self._registered:
-				# If it doesn't exit naturally in a reasonable amount
-				# of time, kill it (solves bug #278895). We try to avoid
-				# this when possible since it makes sandbox complain about
-				# being killed by a signal.
-				self.cancel()
+			self._exit_timeout_id = \
+				self.scheduler.timeout_add(self._exit_timeout,
+				self._exit_command_timeout_cb)
+
+	def _exit_command_timeout_cb(self):
+		if self._registered:
+			# If it doesn't exit naturally in a reasonable amount
+			# of time, kill it (solves bug #278895). We try to avoid
+			# this when possible since it makes sandbox complain about
+			# being killed by a signal.
+			self.cancelled = True
+			self._cancel()
+			self._exit_timeout_id = \
+				self.scheduler.timeout_add(self._cancel_timeout,
+					self._cancel_timeout_cb)
+		else:
+			self._exit_timeout_id = None
+
+		return False # only run once
+
+	def _cancel_timeout_cb(self):
+		self._exit_timeout_id = None
+		self.wait()
+		return False # only run once
 
 	def _orphan_process_warn(self):
 		phase = self.phase
@@ -253,6 +270,10 @@ class AbstractEbuildProcess(SpawnProcess):
 	def _set_returncode(self, wait_retval):
 		SpawnProcess._set_returncode(self, wait_retval)
 
+		if self._exit_timeout_id is not None:
+			self.scheduler.source_remove(self._exit_timeout_id)
+			self._exit_timeout_id = None
+
 		if self._ipc_daemon is not None:
 			self._ipc_daemon.cancel()
 			if self._exit_command.exitcode is not None:

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 37922dc..c5cac7d 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -16,6 +16,10 @@ class SubProcess(AbstractPollTask):
 	# serve this purpose alone.
 	_dummy_pipe_fd = 9
 
+	# This is how much time we allow for waitpid to succeed after
+	# we've sent a kill signal to our subprocess.
+	_cancel_timeout = 1000 # 1 second
+
 	def _poll(self):
 		if self.returncode is not None:
 			return self.returncode
@@ -60,7 +64,7 @@ class SubProcess(AbstractPollTask):
 
 		if self._registered:
 			if self.cancelled:
-				timeout = 1000
+				timeout = self._cancel_timeout
 				self.scheduler.schedule(self._reg_id, timeout=timeout)
 				if self._registered:
 					try:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-07 23:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-07 23:24 UTC (permalink / raw
  To: gentoo-commits

commit:     a3162633773ce5efd3b1cc459df147c93877d953
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 19:40:55 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  7 23:23:59 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3162633

PollScheduler: timeouts regardless of IO events

Now PollScheduler will execute timeouts predictably, even when there
no IO events being generated. This allows the Scheduler's display
updates to be handled via timeout_add.

---
 pym/_emerge/JobStatusDisplay.py |   10 ++++--
 pym/_emerge/PollScheduler.py    |   59 +++++++++++++++++++++++++++++++++------
 pym/_emerge/Scheduler.py        |   46 ++----------------------------
 3 files changed, 59 insertions(+), 56 deletions(-)

diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py
index 877a0c9..d84d1b0 100644
--- a/pym/_emerge/JobStatusDisplay.py
+++ b/pym/_emerge/JobStatusDisplay.py
@@ -209,24 +209,26 @@ class JobStatusDisplay(object):
 	def display(self):
 		"""
 		Display status on stdout, but only if something has
-		changed since the last call.
+		changed since the last call. This always returns True,
+		for continuous scheduling via timeout_add.
 		"""
 
 		if self.quiet:
-			return
+			return True
 
 		current_time = time.time()
 		time_delta = current_time - self._last_display_time
 		if self._displayed and \
 			not self._changed:
 			if not self._isatty:
-				return
+				return True
 			if time_delta < self._min_display_latency:
-				return
+				return True
 
 		self._last_display_time = current_time
 		self._changed = False
 		self._display_status()
+		return True
 
 	def _display_status(self):
 		# Don't use len(self._completed_tasks) here since that also

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index fd57359..519a370 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -43,6 +43,7 @@ class PollScheduler(object):
 		# Increment id for each new handler.
 		self._event_handler_id = 0
 		self._timeout_handlers = {}
+		self._timeout_interval = None
 		self._poll_obj = create_poll_instance()
 		self._polling = False
 		self._scheduling = False
@@ -142,18 +143,51 @@ class PollScheduler(object):
 		return True
 
 	def _poll(self, timeout=None):
-		"""
-		All poll() calls pass through here. The poll events
-		are added directly to self._poll_event_queue.
-		In order to avoid endless blocking, this raises
-		StopIteration if timeout is None and there are
-		no file descriptors to poll.
-		"""
 		if self._polling:
 			return
 		self._polling = True
 		try:
-			self._do_poll(timeout=timeout)
+			if self._timeout_interval is None:
+				self._run_timeouts()
+				self._do_poll(timeout=timeout)
+
+			elif timeout is None:
+				while True:
+					self._run_timeouts()
+					previous_count = len(self._poll_event_queue)
+					self._do_poll(timeout=self._timeout_interval)
+					if previous_count != len(self._poll_event_queue):
+						break
+
+			elif timeout <= self._timeout_interval:
+				self._run_timeouts()
+				self._do_poll(timeout=timeout)
+
+			else:
+				remaining_timeout = timeout
+				start_time = time.time()
+				while True:
+					self._run_timeouts()
+					# _timeout_interval can change each time
+					# _run_timeouts is called
+					min_timeout = remaining_timeout
+					if self._timeout_interval is not None and \
+						self._timeout_interval < min_timeout:
+						min_timeout = self._timeout_interval
+
+					previous_count = len(self._poll_event_queue)
+					self._do_poll(timeout=min_timeout)
+					if previous_count != len(self._poll_event_queue):
+						break
+					elapsed_time = time.time() - start_time
+					if elapsed_time < 0:
+						# The system clock has changed such that start_time
+						# is now in the future, so just assume that the
+						# timeout has already elapsed.
+						break
+					remaining_timeout = timeout - 1000 * elapsed_time
+					if remaining_timeout <= 0:
+						break
 		finally:
 			self._polling = False
 
@@ -165,7 +199,6 @@ class PollScheduler(object):
 		StopIteration if timeout is None and there are
 		no file descriptors to poll.
 		"""
-		self._run_timeouts()
 		if not self._poll_event_handlers:
 			self._schedule()
 			if timeout is None and \
@@ -273,6 +306,8 @@ class PollScheduler(object):
 			self._timeout_handler_class(
 				interval=interval, function=function, args=args,
 				source_id=source_id, timestamp=time.time())
+		if self._timeout_interval is None or self._timeout_interval < interval:
+			self._timeout_interval = interval
 		return source_id
 
 	def _run_timeouts(self):
@@ -320,6 +355,12 @@ class PollScheduler(object):
 		"""
 		timeout_handler = self._timeout_handlers.pop(reg_id, None)
 		if timeout_handler is not None:
+			if timeout_handler.interval == self._timeout_interval:
+				if self._timeout_handlers:
+					self._timeout_interval = \
+						min(x.interval for x in self._timeout_handlers.values())
+				else:
+					self._timeout_interval = None
 			return True
 		f = self._poll_event_handler_ids.pop(reg_id, None)
 		if f is None:

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5b56650..e6f3e0e 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -196,6 +196,8 @@ class Scheduler(PollScheduler):
 
 		self._status_display = JobStatusDisplay(
 			xterm_titles=('notitles' not in settings.features))
+		self._timeout_add(self._max_display_latency,
+			self._status_display.display)
 		self._max_load = myopts.get("--load-average")
 		max_jobs = myopts.get("--jobs")
 		if max_jobs is None:
@@ -352,50 +354,8 @@ class Scheduler(PollScheduler):
 		gc.collect()
 
 	def _poll(self, timeout=None):
-
 		self._schedule()
-
-		if timeout is None:
-			while True:
-				if not self._poll_event_handlers:
-					self._schedule()
-					if not self._poll_event_handlers:
-						raise StopIteration(
-							"timeout is None and there are no poll() event handlers")
-				previous_count = len(self._poll_event_queue)
-				PollScheduler._poll(self, timeout=self._max_display_latency)
-				self._status_display.display()
-				if previous_count != len(self._poll_event_queue):
-					break
-
-		elif timeout <= self._max_display_latency:
-			PollScheduler._poll(self, timeout=timeout)
-			if timeout == 0:
-				# The display is updated by _schedule() above, so it would be
-				# redundant to update it here when timeout is 0.
-				pass
-			else:
-				self._status_display.display()
-
-		else:
-			remaining_timeout = timeout
-			start_time = time.time()
-			while True:
-				previous_count = len(self._poll_event_queue)
-				PollScheduler._poll(self,
-					timeout=min(self._max_display_latency, remaining_timeout))
-				self._status_display.display()
-				if previous_count != len(self._poll_event_queue):
-					break
-				elapsed_time = time.time() - start_time
-				if elapsed_time < 0:
-					# The system clock has changed such that start_time
-					# is now in the future, so just assume that the
-					# timeout has already elapsed.
-					break
-				remaining_timeout = timeout - 1000 * elapsed_time
-				if remaining_timeout <= 0:
-					break
+		PollScheduler._poll(self, timeout=timeout)
 
 	def _set_max_jobs(self, max_jobs):
 		self._max_jobs = max_jobs



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  2:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  2:14 UTC (permalink / raw
  To: gentoo-commits

commit:     32e3bffa19329a848633a7fcefbf4fe3761dbfef
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 01:59:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 02:12:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=32e3bffa

PollScheduler: implement idle_add

---
 pym/_emerge/PollScheduler.py |   46 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 7cf8189..ab18f0d 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -24,9 +24,13 @@ from _emerge.PollSelectAdapter import PollSelectAdapter
 class PollScheduler(object):
 
 	class _sched_iface_class(SlotObject):
-		__slots__ = ("io_add_watch", "output", "register", "schedule",
+		__slots__ = ("idle_add", "io_add_watch",
+			"output", "register", "schedule",
 			"source_remove", "timeout_add", "unregister")
 
+	class _idle_callback_class(SlotObject):
+		__slots__ = ("args", "callback", "source_id")
+
 	class _io_handler_class(SlotObject):
 		__slots__ = ("args", "callback", "fd", "source_id")
 
@@ -45,6 +49,7 @@ class PollScheduler(object):
 		self._poll_event_handler_ids = {}
 		# Increment id for each new handler.
 		self._event_handler_id = 0
+		self._idle_callbacks = {}
 		self._timeout_handlers = {}
 		self._timeout_interval = None
 		self._poll_obj = create_poll_instance()
@@ -52,6 +57,7 @@ class PollScheduler(object):
 		self._scheduling = False
 		self._background = False
 		self.sched_iface = self._sched_iface_class(
+			idle_add=self._idle_add,
 			io_add_watch=self._register,
 			output=self._task_output,
 			register=self._register,
@@ -291,6 +297,35 @@ class PollScheduler(object):
 
 		return bool(events_handled)
 
+	def _idle_add(self, callback, *args):
+		"""
+		Like glib.idle_add(), if callback returns False it is
+		automatically removed from the list of event sources and will
+		not be called again.
+
+		@type callback: callable
+		@param callback: a function to call
+		@rtype: int
+		@return: an integer ID
+		"""
+		self._event_handler_id += 1
+		source_id = self._event_handler_id
+		self._idle_callbacks[source_id] = self._idle_callback_class(
+			args=args, callback=callback, source_id=source_id)
+		return source_id
+
+	def _run_idle_callbacks(self):
+		if not self._idle_callbacks:
+			return
+		# Iterate of our local list, since self._idle_callbacks can be
+		# modified during the exection of these callbacks.
+		for x in list(self._idle_callbacks.values()):
+			if x.source_id not in self._idle_callbacks:
+				# it got cancelled while executing another callback
+				continue
+			if not x.callback(*x.args):
+				self._unregister(x.source_id)
+
 	def _timeout_add(self, interval, function, *args):
 		"""
 		Like glib.timeout_add(), interval argument is the number of
@@ -317,6 +352,12 @@ class PollScheduler(object):
 		return source_id
 
 	def _run_timeouts(self):
+
+		self._run_idle_callbacks()
+
+		if not self._timeout_handlers:
+			return False
+
 		ready_timeouts = []
 		current_time = time.time()
 		for x in self._timeout_handlers.values():
@@ -370,6 +411,9 @@ class PollScheduler(object):
 		is found and removed, and False if the reg_id is invalid or has
 		already been removed.
 		"""
+		idle_callback = self._idle_callbacks.pop(reg_id, None)
+		if idle_callback is not None:
+			return True
 		timeout_handler = self._timeout_handlers.pop(reg_id, None)
 		if timeout_handler is not None:
 			if timeout_handler.interval == self._timeout_interval:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  2:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  2:14 UTC (permalink / raw
  To: gentoo-commits

commit:     73dc0ef7c678b7e95ab7e70a07f72efe7590b8d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 02:00:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 02:12:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=73dc0ef7

Scheduler: use idle_add, not _poll override

---
 pym/_emerge/Scheduler.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 55e327f..b6b6586 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -196,6 +196,7 @@ class Scheduler(PollScheduler):
 
 		self._status_display = JobStatusDisplay(
 			xterm_titles=('notitles' not in settings.features))
+		self._idle_add(self._idle_schedule)
 		self._timeout_add(self._max_display_latency,
 			self._status_display.display)
 		self._max_load = myopts.get("--load-average")
@@ -218,6 +219,7 @@ class Scheduler(PollScheduler):
 			schedule=self._schedule_fetch)
 		self._sched_iface = self._iface_class(
 			fetch=fetch_iface, output=self._task_output,
+			idle_add=self._idle_add,
 			io_add_watch=self._register,
 			register=self._register,
 			schedule=self._schedule_wait,
@@ -354,9 +356,9 @@ class Scheduler(PollScheduler):
 		self._set_graph_config(None)
 		gc.collect()
 
-	def _poll(self, timeout=None):
+	def _idle_schedule(self):
 		self._schedule()
-		PollScheduler._poll(self, timeout=timeout)
+		return True
 
 	def _set_max_jobs(self, max_jobs):
 		self._max_jobs = max_jobs



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  3:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     082c908cd82426dfd45a2bf0ca9741213a7c7d5f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 03:26:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 03:34:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=082c908c

Use PollScheduler iteration method.

---
 pym/_emerge/AsynchronousLock.py |   10 +++++-----
 pym/_emerge/CompositeTask.py    |    5 +++--
 pym/_emerge/FifoIpcDaemon.py    |    7 +++----
 pym/_emerge/PipeReader.py       |    7 +++----
 pym/_emerge/SubProcess.py       |    5 +++--
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index e166df3..2c4fe10 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import dummy_threading
@@ -152,8 +152,8 @@ class _LockThread(AbstractPollTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-		if self._registered:
-			self.scheduler.schedule(self._reg_id)
+		while self._registered:
+			self.scheduler.iteration()
 		return self.returncode
 
 	def unlock(self):
@@ -264,8 +264,8 @@ class _LockProcess(AbstractPollTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-		if self._registered:
-			self.scheduler.schedule(self._reg_id)
+		while self._registered:
+			self.scheduler.iteration()
 		return self.returncode
 
 	def _output_handler(self, f, event):

diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index 644a69b..e56188d 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -60,7 +60,8 @@ class CompositeTask(AsynchronousTask):
 					self._current_task = None
 					break
 				else:
-					self.scheduler.schedule(condition=self._task_queued_wait)
+					while not self._task_queued_wait():
+						self.scheduler.iteration()
 					if self.returncode is not None:
 						break
 					elif self.cancelled:

diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index b1f7a95..cbe8058 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -52,9 +52,8 @@ class FifoIpcDaemon(AbstractPollTask):
 		if self.returncode is not None:
 			return self.returncode
 
-		if self._registered:
-			self.scheduler.schedule(self._reg_id)
-			self._unregister()
+		while self._registered:
+			self.scheduler.iteration()
 
 		if self.returncode is None:
 			self.returncode = os.EX_OK

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index a85d794..54c6eb7 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -44,9 +44,8 @@ class PipeReader(AbstractPollTask):
 		if self.returncode is not None:
 			return self.returncode
 
-		if self._registered:
-			self.scheduler.schedule(self._reg_ids)
-			self._unregister()
+		while self._registered:
+			self.scheduler.iteration()
 
 		self.returncode = os.EX_OK
 		return self.returncode

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index c5cac7d..c3dc74a 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -77,7 +77,8 @@ class SubProcess(AbstractPollTask):
 					if self._registered:
 						self._orphan_process_warn()
 			else:
-				self.scheduler.schedule(self._reg_id)
+				while self._registered:
+					self.scheduler.iteration()
 			self._unregister()
 			if self.returncode is not None:
 				return self.returncode



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  3:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     334c911923af24a7a7d977b28b24a09686e9906d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 03:21:58 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 03:34:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=334c9119

PollScheduler: add iteration method

---
 pym/_emerge/PollScheduler.py |   33 ++++++++++++++++++++++++---------
 pym/_emerge/Scheduler.py     |    6 +++---
 2 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index ab18f0d..9ddcd96 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import gzip
@@ -24,7 +24,7 @@ from _emerge.PollSelectAdapter import PollSelectAdapter
 class PollScheduler(object):
 
 	class _sched_iface_class(SlotObject):
-		__slots__ = ("idle_add", "io_add_watch",
+		__slots__ = ("idle_add", "io_add_watch", "iteration",
 			"output", "register", "schedule",
 			"source_remove", "timeout_add", "unregister")
 
@@ -59,6 +59,7 @@ class PollScheduler(object):
 		self.sched_iface = self._sched_iface_class(
 			idle_add=self._idle_add,
 			io_add_watch=self._register,
+			iteration=self._iteration,
 			output=self._task_output,
 			register=self._register,
 			schedule=self._schedule_wait,
@@ -268,14 +269,24 @@ class PollScheduler(object):
 		if not event_handled:
 			raise AssertionError("tight loop")
 
-	def _schedule_yield(self):
+	def _iteration(self, *args):
 		"""
-		Schedule for a short period of time chosen by the scheduler based
-		on internal state. Synchronous tasks should call this periodically
-		in order to allow the scheduler to service pending poll events. The
-		scheduler will call poll() exactly once, without blocking, and any
-		resulting poll events will be serviced.
+		Like glib.MainContext.iteration(), runs a single iteration.
+		@type may_block: bool
+		@param may_block: if True the call may block waiting for an event
+			(default is True).
+		@rtype: bool
+		@return: True if events were dispatched.
 		"""
+
+		may_block = True
+
+		if args:
+			if len(args) > 1:
+				raise TypeError(
+					"expected at most 1 argument (%s given)" % len(args))
+			may_block = args[0]
+
 		event_handlers = self._poll_event_handlers
 		events_handled = 0
 
@@ -283,7 +294,11 @@ class PollScheduler(object):
 			return bool(events_handled)
 
 		if not self._poll_event_queue:
-			self._poll(0)
+			if may_block:
+				timeout = 0
+			else:
+				timeout = None
+			self._poll(timeout=timeout)
 
 		try:
 			while event_handlers and self._poll_event_queue:

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index b6b6586..e22ef46 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -81,7 +81,7 @@ class Scheduler(PollScheduler):
 
 	class _iface_class(PollScheduler._sched_iface_class):
 		__slots__ = ("fetch",
-			"scheduleSetup", "scheduleUnpack", "scheduleYield")
+			"scheduleSetup", "scheduleUnpack")
 
 	class _fetch_iface_class(SlotObject):
 		__slots__ = ("log_file", "schedule")
@@ -221,11 +221,11 @@ class Scheduler(PollScheduler):
 			fetch=fetch_iface, output=self._task_output,
 			idle_add=self._idle_add,
 			io_add_watch=self._register,
+			iteration=self._iteration,
 			register=self._register,
 			schedule=self._schedule_wait,
 			scheduleSetup=self._schedule_setup,
 			scheduleUnpack=self._schedule_unpack,
-			scheduleYield=self._schedule_yield,
 			source_remove=self._unregister,
 			timeout_add=self._timeout_add,
 			unregister=self._unregister)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  3:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  3:59 UTC (permalink / raw
  To: gentoo-commits

commit:     f17ff92635818620ea0df156dee4796c353d954a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 03:58:48 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 03:58:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f17ff926

AbstractPollTask: add _wait_loop method

---
 pym/_emerge/AbstractPollTask.py |   23 ++++++++++++++++++++++-
 pym/_emerge/SubProcess.py       |    8 +++-----
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 13e3c23..b4728e7 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -1,10 +1,11 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import array
 import errno
 import logging
 import os
+import time
 
 from portage.util import writemsg_level
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -121,3 +122,23 @@ class AbstractPollTask(AsynchronousTask):
 				self._unregister()
 				self.wait()
 
+	def _wait_loop(self, timeout=None):
+
+		if timeout is None:
+			while self._registered:
+				self.scheduler.iteration()
+			return
+
+		remaining_timeout = timeout
+		start_time = time.time()
+		while self._registered:
+			self.scheduler.iteration()
+			elapsed_time = time.time() - start_time
+			if elapsed_time < 0:
+				# The system clock has changed such that start_time
+				# is now in the future, so just assume that the
+				# timeout has already elapsed.
+				break
+			remaining_timeout = timeout - 1000 * elapsed_time
+			if remaining_timeout <= 0:
+				break

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index c3dc74a..17a3e8f 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -64,8 +64,7 @@ class SubProcess(AbstractPollTask):
 
 		if self._registered:
 			if self.cancelled:
-				timeout = self._cancel_timeout
-				self.scheduler.schedule(self._reg_id, timeout=timeout)
+				self._wait_loop(timeout=self._cancel_timeout)
 				if self._registered:
 					try:
 						os.kill(self.pid, signal.SIGKILL)
@@ -73,12 +72,11 @@ class SubProcess(AbstractPollTask):
 						if e.errno != errno.ESRCH:
 							raise
 						del e
-					self.scheduler.schedule(self._reg_id, timeout=timeout)
+					self._wait_loop(timeout=self._cancel_timeout)
 					if self._registered:
 						self._orphan_process_warn()
 			else:
-				while self._registered:
-					self.scheduler.iteration()
+				self._wait_loop()
 			self._unregister()
 			if self.returncode is not None:
 				return self.returncode



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  4:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  4:25 UTC (permalink / raw
  To: gentoo-commits

commit:     20a5f9cb0c9fec433df7256617bd8fe09892fafa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 04:24:47 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 04:24:47 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=20a5f9cb

QueueScheduler: use timeout_add

---
 pym/_emerge/QueueScheduler.py |   51 +++++++++++++---------------------------
 1 files changed, 17 insertions(+), 34 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index a4ab328..91a2831 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -36,42 +36,25 @@ class QueueScheduler(PollScheduler):
 
 	def run(self, timeout=None):
 
-		start_time = None
-		timed_out = False
-		remaining_timeout = timeout
+		timeout_id = None
 		if timeout is not None:
-			start_time = time.time()
-
-		while self._schedule():
-			self._schedule_wait(timeout=remaining_timeout)
-			if timeout is not None:
-				elapsed_time = time.time() - start_time
-				if elapsed_time < 0:
-					# The system clock has changed such that start_time
-					# is now in the future, so just assume that the
-					# timeout has already elapsed.
-					timed_out = True
-					break
-				remaining_timeout = timeout - 1000 * elapsed_time
-				if remaining_timeout <= 0:
-					timed_out = True
-					break
-
-		if timeout is None or not timed_out:
+			def timeout_callback():
+				raise StopIteration()
+			timeout_id = self._timeout_add(timeout, timeout_callback)
+
+		try:
+
+			while self._schedule():
+				self._iteration()
+
 			while self._running_job_count():
-				self._schedule_wait(timeout=remaining_timeout)
-				if timeout is not None:
-					elapsed_time = time.time() - start_time
-					if elapsed_time < 0:
-						# The system clock has changed such that start_time
-						# is now in the future, so just assume that the
-						# timeout has already elapsed.
-						timed_out = True
-						break
-					remaining_timeout = timeout - 1000 * elapsed_time
-					if remaining_timeout <= 0:
-						timed_out = True
-						break
+				self._iteration()
+
+		except StopIteration:
+			pass
+
+		if timeout_id is not None:
+			self._unregister(timeout_id)
 
 	def _schedule_tasks(self):
 		"""



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  4:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  4:35 UTC (permalink / raw
  To: gentoo-commits

commit:     618ad1f92b6f768e5cc2f783cd1756ffe65b3fef
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 04:35:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 04:35:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=618ad1f9

PollScheduler: remove _schedule_wait

---
 pym/_emerge/PollScheduler.py |   48 +-----------------------------------------
 pym/_emerge/Scheduler.py     |    2 +-
 2 files changed, 2 insertions(+), 48 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 9ddcd96..0e510b3 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -62,7 +62,7 @@ class PollScheduler(object):
 			iteration=self._iteration,
 			output=self._task_output,
 			register=self._register,
-			schedule=self._schedule_wait,
+			schedule=self._poll_loop,
 			source_remove=self._unregister,
 			timeout_add=self._timeout_add,
 			unregister=self._unregister)
@@ -462,52 +462,6 @@ class PollScheduler(object):
 		del self._poll_event_handlers[f]
 		return True
 
-	def _schedule_wait(self, wait_ids=None, timeout=None, condition=None):
-		"""
-		Schedule until wait_id is not longer registered
-		for poll() events.
-		@type wait_id: int
-		@param wait_id: a task id to wait for
-		"""
-		event_handlers = self._poll_event_handlers
-		handler_ids = self._poll_event_handler_ids
-		event_handled = False
-
-		if isinstance(wait_ids, int):
-			wait_ids = frozenset([wait_ids])
-
-		start_time = None
-		remaining_timeout = timeout
-		timed_out = False
-		if timeout is not None:
-			start_time = time.time()
-		try:
-			while (wait_ids is None and event_handlers) or \
-				(wait_ids is not None and wait_ids.intersection(handler_ids)):
-				f, event = self._next_poll_event(timeout=remaining_timeout)
-				x = event_handlers[f]
-				if not x.callback(f, event, *x.args):
-					self._unregister(x.source_id)
-				event_handled = True
-				if condition is not None and condition():
-					break
-				if timeout is not None:
-					elapsed_time = time.time() - start_time
-					if elapsed_time < 0:
-						# The system clock has changed such that start_time
-						# is now in the future, so just assume that the
-						# timeout has already elapsed.
-						timed_out = True
-						break
-					remaining_timeout = timeout - 1000 * elapsed_time
-					if remaining_timeout <= 0:
-						timed_out = True
-						break
-		except StopIteration:
-			event_handled = True
-
-		return event_handled
-
 	def _task_output(self, msg, log_path=None, background=None,
 		level=0, noiselevel=-1):
 		"""

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index e22ef46..afcdda8 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -223,7 +223,7 @@ class Scheduler(PollScheduler):
 			io_add_watch=self._register,
 			iteration=self._iteration,
 			register=self._register,
-			schedule=self._schedule_wait,
+			schedule=self._poll_loop,
 			scheduleSetup=self._schedule_setup,
 			scheduleUnpack=self._schedule_unpack,
 			source_remove=self._unregister,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  5:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  5:17 UTC (permalink / raw
  To: gentoo-commits

commit:     071fa4eb82ba9dbb2f0ae3c78cb87580eb6baeff
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 05:03:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 05:03:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=071fa4eb

QueueScheduler: tweak timeout handling

---
 pym/_emerge/QueueScheduler.py |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index 91a2831..db7aa5a 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -36,25 +36,28 @@ class QueueScheduler(PollScheduler):
 
 	def run(self, timeout=None):
 
-		timeout_id = None
+		timeout_callback = None
 		if timeout is not None:
 			def timeout_callback():
-				raise StopIteration()
-			timeout_id = self._timeout_add(timeout, timeout_callback)
+				timeout_callback.timed_out = True
+				return False
+			timeout_callback.timed_out = False
+			timeout_callback.timeout_id = self._timeout_add(
+				timeout, timeout_callback)
 
 		try:
 
-			while self._schedule():
+			while not (timeout_callback is not None and
+				timeout_callback.timed_out) and self._schedule():
 				self._iteration()
 
-			while self._running_job_count():
+			while not (timeout_callback is not None and
+				timeout_callback.timed_out) and self._running_job_count():
 				self._iteration()
 
-		except StopIteration:
-			pass
-
-		if timeout_id is not None:
-			self._unregister(timeout_id)
+		finally:
+			if timeout_callback is not None:
+				self._unregister(timeout_callback.timeout_id)
 
 	def _schedule_tasks(self):
 		"""



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  5:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  5:17 UTC (permalink / raw
  To: gentoo-commits

commit:     6b985978952fce6f1bb0741d8657d08a20c9937f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 05:16:51 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 05:16:51 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b985978

AbstractPollTask: use timeout_add

---
 pym/_emerge/AbstractPollTask.py |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index b4728e7..9229052 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -5,7 +5,6 @@ import array
 import errno
 import logging
 import os
-import time
 
 from portage.util import writemsg_level
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -129,16 +128,14 @@ class AbstractPollTask(AsynchronousTask):
 				self.scheduler.iteration()
 			return
 
-		remaining_timeout = timeout
-		start_time = time.time()
-		while self._registered:
-			self.scheduler.iteration()
-			elapsed_time = time.time() - start_time
-			if elapsed_time < 0:
-				# The system clock has changed such that start_time
-				# is now in the future, so just assume that the
-				# timeout has already elapsed.
-				break
-			remaining_timeout = timeout - 1000 * elapsed_time
-			if remaining_timeout <= 0:
-				break
+		def timeout_cb():
+			timeout_cb.timed_out = True
+			return False
+		timeout_cb.timed_out = False
+		timeout_cb.timeout_id = self.scheduler.timeout_add(timeout, timeout_cb)
+
+		try:
+			while self._registered and not timeout_cb.timed_out:
+				self.scheduler.iteration()
+		finally:
+			self.scheduler.unregister(timeout_cb.timeout_id)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  5:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  5:17 UTC (permalink / raw
  To: gentoo-commits

commit:     1c7d0f10af6eaa4a7964eb8c7ebb65a3fff944d1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 05:07:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 05:07:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1c7d0f10

fixup! QueueScheduler: tweak timeout handling

---
 pym/_emerge/QueueScheduler.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index db7aa5a..e115ba1 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -1,8 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-import time
-
 from _emerge.PollScheduler import PollScheduler
 
 class QueueScheduler(PollScheduler):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  6:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  6:09 UTC (permalink / raw
  To: gentoo-commits

commit:     c02b0e535a4cfe4dc0a3c3d07124b8dfa5d4f9a5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 05:03:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 06:08:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c02b0e53

QueueScheduler: tweak timeout handling

---
 pym/_emerge/QueueScheduler.py |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index 91a2831..e115ba1 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -1,8 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-import time
-
 from _emerge.PollScheduler import PollScheduler
 
 class QueueScheduler(PollScheduler):
@@ -36,25 +34,28 @@ class QueueScheduler(PollScheduler):
 
 	def run(self, timeout=None):
 
-		timeout_id = None
+		timeout_callback = None
 		if timeout is not None:
 			def timeout_callback():
-				raise StopIteration()
-			timeout_id = self._timeout_add(timeout, timeout_callback)
+				timeout_callback.timed_out = True
+				return False
+			timeout_callback.timed_out = False
+			timeout_callback.timeout_id = self._timeout_add(
+				timeout, timeout_callback)
 
 		try:
 
-			while self._schedule():
+			while not (timeout_callback is not None and
+				timeout_callback.timed_out) and self._schedule():
 				self._iteration()
 
-			while self._running_job_count():
+			while not (timeout_callback is not None and
+				timeout_callback.timed_out) and self._running_job_count():
 				self._iteration()
 
-		except StopIteration:
-			pass
-
-		if timeout_id is not None:
-			self._unregister(timeout_id)
+		finally:
+			if timeout_callback is not None:
+				self._unregister(timeout_callback.timeout_id)
 
 	def _schedule_tasks(self):
 		"""



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08  6:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08  6:09 UTC (permalink / raw
  To: gentoo-commits

commit:     7e38a0253bdc1a25b54f0783c0bb2a72239fdb05
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 05:16:51 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 06:08:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7e38a025

AbstractPollTask: use timeout_add

---
 pym/_emerge/AbstractPollTask.py |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index b4728e7..9229052 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -5,7 +5,6 @@ import array
 import errno
 import logging
 import os
-import time
 
 from portage.util import writemsg_level
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -129,16 +128,14 @@ class AbstractPollTask(AsynchronousTask):
 				self.scheduler.iteration()
 			return
 
-		remaining_timeout = timeout
-		start_time = time.time()
-		while self._registered:
-			self.scheduler.iteration()
-			elapsed_time = time.time() - start_time
-			if elapsed_time < 0:
-				# The system clock has changed such that start_time
-				# is now in the future, so just assume that the
-				# timeout has already elapsed.
-				break
-			remaining_timeout = timeout - 1000 * elapsed_time
-			if remaining_timeout <= 0:
-				break
+		def timeout_cb():
+			timeout_cb.timed_out = True
+			return False
+		timeout_cb.timed_out = False
+		timeout_cb.timeout_id = self.scheduler.timeout_add(timeout, timeout_cb)
+
+		try:
+			while self._registered and not timeout_cb.timed_out:
+				self.scheduler.iteration()
+		finally:
+			self.scheduler.unregister(timeout_cb.timeout_id)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08 20:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     b41e88203cb308eb79f15961a0508b86209e2dfb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 20:24:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 20:24:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b41e8820

PollScheduler: split out EventLoop base class

---
 pym/_emerge/PollScheduler.py |  222 ++++++++++++++++++++++--------------------
 1 files changed, 116 insertions(+), 106 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 0e510b3..983bfa9 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -21,12 +21,8 @@ from _emerge.getloadavg import getloadavg
 from _emerge.PollConstants import PollConstants
 from _emerge.PollSelectAdapter import PollSelectAdapter
 
-class PollScheduler(object):
 
-	class _sched_iface_class(SlotObject):
-		__slots__ = ("idle_add", "io_add_watch", "iteration",
-			"output", "register", "schedule",
-			"source_remove", "timeout_add", "unregister")
+class EventLoop(object):
 
 	class _idle_callback_class(SlotObject):
 		__slots__ = ("args", "callback", "source_id")
@@ -39,11 +35,6 @@ class PollScheduler(object):
 			"timestamp")
 
 	def __init__(self):
-		self._terminated = threading.Event()
-		self._terminated_tasks = False
-		self._max_jobs = 1
-		self._max_load = None
-		self._jobs = 0
 		self._poll_event_queue = []
 		self._poll_event_handlers = {}
 		self._poll_event_handler_ids = {}
@@ -53,105 +44,11 @@ class PollScheduler(object):
 		self._timeout_handlers = {}
 		self._timeout_interval = None
 		self._poll_obj = create_poll_instance()
-		self._polling = False
-		self._scheduling = False
-		self._background = False
-		self.sched_iface = self._sched_iface_class(
-			idle_add=self._idle_add,
-			io_add_watch=self._register,
-			iteration=self._iteration,
-			output=self._task_output,
-			register=self._register,
-			schedule=self._poll_loop,
-			source_remove=self._unregister,
-			timeout_add=self._timeout_add,
-			unregister=self._unregister)
-
-	def terminate(self):
-		"""
-		Schedules asynchronous, graceful termination of the scheduler
-		at the earliest opportunity.
-
-		This method is thread-safe (and safe for signal handlers).
-		"""
-		self._terminated.set()
-
-	def _terminate_tasks(self):
-		"""
-		Send signals to terminate all tasks. This is called once
-		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()
-
-	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).
-		"""
-		pass
+		self._polling = False		
 
 	def _schedule(self):
-		"""
-		Calls _schedule_tasks() and automatically returns early from
-		any recursive calls to this method that the _schedule_tasks()
-		call might trigger. This makes _schedule() safe to call from
-		inside exit listeners.
-		"""
-		if self._scheduling:
-			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
-
-	def _running_job_count(self):
-		return self._jobs
-
-	def _can_add_job(self):
-		if self._terminated_tasks:
-			return False
-
-		max_jobs = self._max_jobs
-		max_load = self._max_load
-
-		if self._max_jobs is not True and \
-			self._running_job_count() >= self._max_jobs:
-			return False
-
-		if max_load is not None and \
-			(max_jobs is True or max_jobs > 1) and \
-			self._running_job_count() >= 1:
-			try:
-				avg1, avg5, avg15 = getloadavg()
-			except OSError:
-				return False
-
-			if avg1 >= max_load:
-				return False
+		pass
 
-		return True
 
 	def _poll(self, timeout=None):
 		if self._polling:
@@ -462,6 +359,119 @@ class PollScheduler(object):
 		del self._poll_event_handlers[f]
 		return True
 
+class PollScheduler(EventLoop):
+
+	class _sched_iface_class(SlotObject):
+		__slots__ = ("idle_add", "io_add_watch", "iteration",
+			"output", "register", "schedule",
+			"source_remove", "timeout_add", "unregister")
+
+	def __init__(self):
+		super(PollScheduler, self).__init__()
+		self._terminated = threading.Event()
+		self._terminated_tasks = False
+		self._max_jobs = 1
+		self._max_load = None
+		self._jobs = 0
+		self._scheduling = False
+		self._background = False
+		self.sched_iface = self._sched_iface_class(
+			idle_add=self._idle_add,
+			io_add_watch=self._register,
+			iteration=self._iteration,
+			output=self._task_output,
+			register=self._register,
+			schedule=self._poll_loop,
+			source_remove=self._unregister,
+			timeout_add=self._timeout_add,
+			unregister=self._unregister)
+
+	def terminate(self):
+		"""
+		Schedules asynchronous, graceful termination of the scheduler
+		at the earliest opportunity.
+
+		This method is thread-safe (and safe for signal handlers).
+		"""
+		self._terminated.set()
+
+	def _terminate_tasks(self):
+		"""
+		Send signals to terminate all tasks. This is called once
+		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()
+
+	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).
+		"""
+		pass
+
+	def _schedule(self):
+		"""
+		Calls _schedule_tasks() and automatically returns early from
+		any recursive calls to this method that the _schedule_tasks()
+		call might trigger. This makes _schedule() safe to call from
+		inside exit listeners.
+		"""
+		if self._scheduling:
+			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
+
+	def _running_job_count(self):
+		return self._jobs
+
+	def _can_add_job(self):
+		if self._terminated_tasks:
+			return False
+
+		max_jobs = self._max_jobs
+		max_load = self._max_load
+
+		if self._max_jobs is not True and \
+			self._running_job_count() >= self._max_jobs:
+			return False
+
+		if max_load is not None and \
+			(max_jobs is True or max_jobs > 1) and \
+			self._running_job_count() >= 1:
+			try:
+				avg1, avg5, avg15 = getloadavg()
+			except OSError:
+				return False
+
+			if avg1 >= max_load:
+				return False
+
+		return True
+
 	def _task_output(self, msg, log_path=None, background=None,
 		level=0, noiselevel=-1):
 		"""



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08 21:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08 21:20 UTC (permalink / raw
  To: gentoo-commits

commit:     b003b7e2374051fa050e6a05f1defec6a6c67252
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 21:20:06 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 21:20:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b003b7e2

EventLoop: use same method names as glib

---
 pym/_emerge/PollScheduler.py |   32 ++++++++++++++++----------------
 pym/_emerge/Scheduler.py     |   14 +++++++-------
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index b9188f7..ee00f10 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -158,7 +158,7 @@ class EventLoop(object):
 				f, event = self._next_poll_event()
 				x = event_handlers[f]
 				if not x.callback(f, event, *x.args):
-					self._unregister(x.source_id)
+					self.source_remove(x.source_id)
 				event_handled = True
 		except StopIteration:
 			event_handled = True
@@ -166,7 +166,7 @@ class EventLoop(object):
 		if not event_handled:
 			raise AssertionError("tight loop")
 
-	def _iteration(self, *args):
+	def iteration(self, *args):
 		"""
 		Like glib.MainContext.iteration(), runs a single iteration.
 		@type may_block: bool
@@ -202,14 +202,14 @@ class EventLoop(object):
 				f, event = self._next_poll_event()
 				x = event_handlers[f]
 				if not x.callback(f, event, *x.args):
-					self._unregister(x.source_id)
+					self.source_remove(x.source_id)
 				events_handled += 1
 		except StopIteration:
 			events_handled += 1
 
 		return bool(events_handled)
 
-	def _idle_add(self, callback, *args):
+	def idle_add(self, callback, *args):
 		"""
 		Like glib.idle_add(), if callback returns False it is
 		automatically removed from the list of event sources and will
@@ -236,9 +236,9 @@ class EventLoop(object):
 				# it got cancelled while executing another callback
 				continue
 			if not x.callback(*x.args):
-				self._unregister(x.source_id)
+				self.source_remove(x.source_id)
 
-	def _timeout_add(self, interval, function, *args):
+	def timeout_add(self, interval, function, *args):
 		"""
 		Like glib.timeout_add(), interval argument is the number of
 		milliseconds between calls to your function, and your function
@@ -287,11 +287,11 @@ class EventLoop(object):
 				continue
 			x.timestamp = time.time()
 			if not x.function(*x.args):
-				self._unregister(x.source_id)
+				self.source_remove(x.source_id)
 
 		return bool(ready_timeouts)
 
-	def _register(self, f, condition, callback, *args):
+	def io_add_watch(self, f, condition, callback, *args):
 		"""
 		Like glib.io_add_watch(), your function should return False to
 		stop being called, or True to continue being called. Any
@@ -317,7 +317,7 @@ class EventLoop(object):
 		self._poll_obj.register(f, condition)
 		return source_id
 
-	def _unregister(self, reg_id):
+	def source_remove(self, reg_id):
 		"""
 		Like glib.source_remove(), this returns True if the given reg_id
 		is found and removed, and False if the reg_id is invalid or has
@@ -378,15 +378,15 @@ class PollScheduler(object):
 		self._event_loop = EventLoop()
 		self._event_loop._schedule = self._schedule
 		self.sched_iface = self._sched_iface_class(
-			idle_add=self._event_loop._idle_add,
-			io_add_watch=self._event_loop._register,
-			iteration=self._event_loop._iteration,
+			idle_add=self._event_loop.idle_add,
+			io_add_watch=self._event_loop.io_add_watch,
+			iteration=self._event_loop.iteration,
 			output=self._task_output,
-			register=self._event_loop._register,
+			register=self._event_loop.io_add_watch,
 			run=self._event_loop._poll_loop,
-			source_remove=self._event_loop._unregister,
-			timeout_add=self._event_loop._timeout_add,
-			unregister=self._event_loop._unregister)
+			source_remove=self._event_loop.source_remove,
+			timeout_add=self._event_loop.timeout_add,
+			unregister=self._event_loop.source_remove)
 
 	def terminate(self):
 		"""

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d2d6ad8..770cb6c 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -219,16 +219,16 @@ class Scheduler(PollScheduler):
 			schedule=self._schedule_fetch)
 		self._sched_iface = self._iface_class(
 			fetch=fetch_iface, output=self._task_output,
-			idle_add=self._event_loop._idle_add,
-			io_add_watch=self._event_loop._register,
-			iteration=self._event_loop._iteration,
-			register=self._event_loop._register,
+			idle_add=self._event_loop.idle_add,
+			io_add_watch=self._event_loop.io_add_watch,
+			iteration=self._event_loop.iteration,
+			register=self._event_loop.io_add_watch,
 			schedule=self._event_loop._poll_loop,
 			scheduleSetup=self._schedule_setup,
 			scheduleUnpack=self._schedule_unpack,
-			source_remove=self._event_loop._unregister,
-			timeout_add=self._event_loop._timeout_add,
-			unregister=self._event_loop._unregister)
+			source_remove=self._event_loop.source_remove,
+			timeout_add=self._event_loop.timeout_add,
+			unregister=self._event_loop.source_remove)
 
 		self._prefetchers = weakref.WeakValueDictionary()
 		self._pkg_queue = []



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-08 23:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-08 23:44 UTC (permalink / raw
  To: gentoo-commits

commit:     8c1fcf5a9ba9fa4d406a4d0cc284fe73a84f5a63
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 23:43:50 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 23:43:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8c1fcf5a

Scheduler: remove _idle_schedule

This shouldn't be needed, since _schedule() should already be called
automatically when there are any relevant state changes.

---
 pym/_emerge/Scheduler.py |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 770cb6c..ee7a02c 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -196,7 +196,6 @@ class Scheduler(PollScheduler):
 
 		self._status_display = JobStatusDisplay(
 			xterm_titles=('notitles' not in settings.features))
-		self.sched_iface.idle_add(self._idle_schedule)
 		self.sched_iface.timeout_add(self._max_display_latency,
 			self._status_display.display)
 		self._max_load = myopts.get("--load-average")
@@ -356,10 +355,6 @@ class Scheduler(PollScheduler):
 		self._set_graph_config(None)
 		gc.collect()
 
-	def _idle_schedule(self):
-		self._schedule()
-		return True
-
 	def _set_max_jobs(self, max_jobs):
 		self._max_jobs = max_jobs
 		self._task_queues.jobs.max_jobs = max_jobs



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  0:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  0:33 UTC (permalink / raw
  To: gentoo-commits

commit:     4620d6aba1c5c10344e311585516ee43819b703c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 00:33:14 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 00:33:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4620d6ab

SequentialTaskQueue: schedule automatically

This is needed to compensate for the removal of _idle_schedule in
commit 8c1fcf5a9ba9fa4d406a4d0cc284fe73a84f5a63, so that the
Scheduler's task queues operate without needing their schedule methods
called inside Scheduler._schedule_tasks().

---
 pym/_emerge/Scheduler.py           |   14 +++++++-------
 pym/_emerge/SequentialTaskQueue.py |    5 ++++-
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index ee7a02c..d3f7761 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1514,6 +1514,8 @@ class Scheduler(PollScheduler):
 
 		while True:
 
+			state_change = 0
+
 			# 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
@@ -1524,17 +1526,15 @@ class Scheduler(PollScheduler):
 				not self._task_queues.merge):
 				task = self._merge_wait_queue.popleft()
 				task.addExitListener(self._merge_wait_exit_handler)
+				self._merge_wait_scheduled.append(task)
 				self._task_queues.merge.add(task)
 				self._status_display.merges = len(self._task_queues.merge)
-				self._merge_wait_scheduled.append(task)
+				state_change += 1
 
-			self._schedule_tasks_imp()
-			self._status_display.display()
+			if self._schedule_tasks_imp():
+				state_change += 1
 
-			state_change = 0
-			for q in self._task_queues.values():
-				if q.schedule():
-					state_change += 1
+			self._status_display.display()
 
 			# Cancel prefetchers if they're the only reason
 			# the main poll loop is still running.

diff --git a/pym/_emerge/SequentialTaskQueue.py b/pym/_emerge/SequentialTaskQueue.py
index c1c98c4..88ac844 100644
--- a/pym/_emerge/SequentialTaskQueue.py
+++ b/pym/_emerge/SequentialTaskQueue.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import sys
@@ -20,10 +20,12 @@ class SequentialTaskQueue(SlotObject):
 	def add(self, task):
 		self._task_queue.append(task)
 		self._dirty = True
+		self.schedule()
 
 	def addFront(self, task):
 		self._task_queue.appendleft(task)
 		self._dirty = True
+		self.schedule()
 
 	def schedule(self):
 
@@ -69,6 +71,7 @@ class SequentialTaskQueue(SlotObject):
 		self.running_tasks.remove(task)
 		if self._task_queue:
 			self._dirty = True
+			self.schedule()
 
 	def clear(self):
 		self._task_queue.clear()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  1:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  1:50 UTC (permalink / raw
  To: gentoo-commits

commit:     3ea7f3dc381ea2b61604e6cedb82b4847537317c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 01:49:56 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 01:49:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3ea7f3dc

SequentialTaskQueue: use finally for _scheduling

Also, remove unecessary _dirty flag.

---
 pym/_emerge/SequentialTaskQueue.py |   46 ++++++++++-------------------------
 1 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/pym/_emerge/SequentialTaskQueue.py b/pym/_emerge/SequentialTaskQueue.py
index 88ac844..3cd56d2 100644
--- a/pym/_emerge/SequentialTaskQueue.py
+++ b/pym/_emerge/SequentialTaskQueue.py
@@ -7,7 +7,7 @@ from collections import deque
 class SequentialTaskQueue(SlotObject):
 
 	__slots__ = ("max_jobs", "running_tasks") + \
-		("_dirty", "_scheduling", "_task_queue")
+		("_scheduling", "_task_queue")
 
 	def __init__(self, **kwargs):
 		SlotObject.__init__(self, **kwargs)
@@ -15,52 +15,34 @@ class SequentialTaskQueue(SlotObject):
 		self.running_tasks = set()
 		if self.max_jobs is None:
 			self.max_jobs = 1
-		self._dirty = True
 
 	def add(self, task):
 		self._task_queue.append(task)
-		self._dirty = True
 		self.schedule()
 
 	def addFront(self, task):
 		self._task_queue.appendleft(task)
-		self._dirty = True
 		self.schedule()
 
 	def schedule(self):
 
-		if not self._dirty:
-			return False
-
-		if not self:
-			return False
-
 		if self._scheduling:
 			# Ignore any recursive schedule() calls triggered via
 			# self._task_exit().
-			return False
+			return
 
 		self._scheduling = True
-
-		task_queue = self._task_queue
-		running_tasks = self.running_tasks
-		max_jobs = self.max_jobs
-		state_changed = False
-
-		while task_queue and \
-			(max_jobs is True or len(running_tasks) < max_jobs):
-			task = task_queue.popleft()
-			cancelled = getattr(task, "cancelled", None)
-			if not cancelled:
-				running_tasks.add(task)
-				task.addExitListener(self._task_exit)
-				task.start()
-			state_changed = True
-
-		self._dirty = False
-		self._scheduling = False
-
-		return state_changed
+		try:
+			while self._task_queue and (self.max_jobs is True or
+				len(self.running_tasks) < self.max_jobs):
+				task = self._task_queue.popleft()
+				cancelled = getattr(task, "cancelled", None)
+				if not cancelled:
+					self.running_tasks.add(task)
+					task.addExitListener(self._task_exit)
+					task.start()
+		finally:
+			self._scheduling = False
 
 	def _task_exit(self, task):
 		"""
@@ -70,7 +52,6 @@ class SequentialTaskQueue(SlotObject):
 		"""
 		self.running_tasks.remove(task)
 		if self._task_queue:
-			self._dirty = True
 			self.schedule()
 
 	def clear(self):
@@ -80,7 +61,6 @@ class SequentialTaskQueue(SlotObject):
 			task = running_tasks.pop()
 			task.removeExitListener(self._task_exit)
 			task.cancel()
-		self._dirty = False
 
 	def __bool__(self):
 		return bool(self._task_queue or self.running_tasks)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  1:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  1:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e414834041d39f14211ede7df8ec5ff527673967
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 01:58:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 01:58:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e4148340

Scheduler: tweak _add_prefetchers

Since commit 4620d6aba1c5c10344e311585516ee43819b703c, the first
prefetcher is started as soon as it's added to the task queue.

---
 pym/_emerge/Scheduler.py |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d3f7761..6502f71 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -733,15 +733,13 @@ class Scheduler(PollScheduler):
 					continue
 				prefetcher = self._create_prefetcher(pkg)
 				if prefetcher is not None:
-					self._task_queues.fetch.add(prefetcher)
+					# This will start the first prefetcher immediately, so that
+					# self._task() won't discard it. This avoids a case where
+					# the first prefetcher is discarded, causing the second
+					# prefetcher to occupy the fetch queue before the first
+					# fetcher has an opportunity to execute.
 					prefetchers[pkg] = prefetcher
-
-			# Start the first prefetcher immediately so that self._task()
-			# won't discard it. This avoids a case where the first
-			# prefetcher is discarded, causing the second prefetcher to
-			# occupy the fetch queue before the first fetcher has an
-			# opportunity to execute.
-			self._task_queues.fetch.schedule()
+					self._task_queues.fetch.add(prefetcher)
 
 	def _create_prefetcher(self, pkg):
 		"""



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  2:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  2:10 UTC (permalink / raw
  To: gentoo-commits

commit:     cda8009b77feda580ee57f576d6fcaadc9ca65fc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 02:10:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 02:10:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cda8009b

PollScheduler: remove EventLoop._schedule hook

PollScheduler and subclasses be should already be calling
self._schedule() when necessary.

---
 pym/_emerge/PollScheduler.py |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index ee00f10..ab65054 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -46,10 +46,6 @@ class EventLoop(object):
 		self._poll_obj = create_poll_instance()
 		self._polling = False		
 
-	def _schedule(self):
-		pass
-
-
 	def _poll(self, timeout=None):
 		if self._polling:
 			return
@@ -107,12 +103,11 @@ class EventLoop(object):
 		StopIteration if timeout is None and there are
 		no file descriptors to poll.
 		"""
-		if not self._poll_event_handlers:
-			self._schedule()
-			if timeout is None and \
-				not self._poll_event_handlers:
-				raise StopIteration(
-					"timeout is None and there are no poll() event handlers")
+
+		if timeout is None and \
+			not self._poll_event_handlers:
+			raise StopIteration(
+				"timeout is None and there are no poll() event handlers")
 
 		# The following error is known to occur with Linux kernel versions
 		# less than 2.6.24:
@@ -367,7 +362,6 @@ class PollScheduler(object):
 			"source_remove", "timeout_add", "unregister")
 
 	def __init__(self):
-		super(PollScheduler, self).__init__()
 		self._terminated = threading.Event()
 		self._terminated_tasks = False
 		self._max_jobs = 1
@@ -376,7 +370,6 @@ class PollScheduler(object):
 		self._scheduling = False
 		self._background = False
 		self._event_loop = EventLoop()
-		self._event_loop._schedule = self._schedule
 		self.sched_iface = self._sched_iface_class(
 			idle_add=self._event_loop.idle_add,
 			io_add_watch=self._event_loop.io_add_watch,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  4:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  4:04 UTC (permalink / raw
  To: gentoo-commits

commit:     6823977b783a7205154af5f4234fe02982c62666
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 04:04:09 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 04:04:09 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6823977b

PollScheduler: remove _poll_loop

We can use iteration() instead, and _poll_loop's exit behavior doesn't
seem practical to emulate with glib.MainLoop.

---
 pym/_emerge/MetadataRegen.py |    9 ++++++---
 pym/_emerge/PollScheduler.py |   24 ++----------------------
 pym/_emerge/Scheduler.py     |   13 +++++--------
 3 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 07fd397..1ebc532 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -33,6 +33,7 @@ class MetadataRegen(PollScheduler):
 		self.returncode = os.EX_OK
 		self._error_count = 0
 		self._running_tasks = set()
+		self._remaining_tasks = True
 
 	def _terminate_tasks(self):
 		while self._running_tasks:
@@ -87,11 +88,12 @@ class MetadataRegen(PollScheduler):
 		from portage.cache.cache_errors import CacheError
 		dead_nodes = {}
 
-		while self._schedule():
-			self.sched_iface.run()
+		self._schedule()
+		while self._remaining_tasks and not self._terminated_tasks:
+			self.sched_iface.iteration()
 
 		while self._jobs:
-			self.sched_iface.run()
+			self.sched_iface.iteration()
 
 		if self._terminated_tasks:
 			self.returncode = 1
@@ -151,6 +153,7 @@ class MetadataRegen(PollScheduler):
 			try:
 				metadata_process = next(self._process_iter)
 			except StopIteration:
+				self._remaining_tasks = False
 				return False
 
 			self._jobs += 1

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index ab65054..018188b 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -130,9 +130,8 @@ class EventLoop(object):
 
 	def _next_poll_event(self, timeout=None):
 		"""
-		Since the _schedule_wait() loop is called by event
-		handlers from _poll_loop(), maintain a central event
-		queue for both of them to share events from a single
+		Since iteration() can be called recursively, maintain
+		a central event queue to share events from a single
 		poll() call. In order to avoid endless blocking, this
 		raises StopIteration if timeout is None and there are
 		no file descriptors to poll.
@@ -143,24 +142,6 @@ class EventLoop(object):
 				raise StopIteration()
 		return self._poll_event_queue.pop()
 
-	def _poll_loop(self):
-
-		event_handlers = self._poll_event_handlers
-		event_handled = False
-
-		try:
-			while event_handlers:
-				f, event = self._next_poll_event()
-				x = event_handlers[f]
-				if not x.callback(f, event, *x.args):
-					self.source_remove(x.source_id)
-				event_handled = True
-		except StopIteration:
-			event_handled = True
-
-		if not event_handled:
-			raise AssertionError("tight loop")
-
 	def iteration(self, *args):
 		"""
 		Like glib.MainContext.iteration(), runs a single iteration.
@@ -376,7 +357,6 @@ class PollScheduler(object):
 			iteration=self._event_loop.iteration,
 			output=self._task_output,
 			register=self._event_loop.io_add_watch,
-			run=self._event_loop._poll_loop,
 			source_remove=self._event_loop.source_remove,
 			timeout_add=self._event_loop.timeout_add,
 			unregister=self._event_loop.source_remove)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6502f71..12f0871 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -222,7 +222,6 @@ class Scheduler(PollScheduler):
 			io_add_watch=self._event_loop.io_add_watch,
 			iteration=self._event_loop.iteration,
 			register=self._event_loop.io_add_watch,
-			schedule=self._event_loop._poll_loop,
 			scheduleSetup=self._schedule_setup,
 			scheduleUnpack=self._schedule_unpack,
 			source_remove=self._event_loop.source_remove,
@@ -1492,14 +1491,12 @@ class Scheduler(PollScheduler):
 		if self._opts_no_background.intersection(self.myopts):
 			self._set_max_jobs(1)
 
-		while self._schedule():
-			self.sched_iface.run()
+		self._schedule()
+		while self._keep_scheduling():
+			self.sched_iface.iteration()
 
-		while True:
-			self._schedule()
-			if not self._is_work_scheduled():
-				break
-			self.sched_iface.run()
+		while self._is_work_scheduled():
+			self.sched_iface.iteration()
 
 	def _keep_scheduling(self):
 		return bool(not self._terminated_tasks and self._pkg_queue and \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  6:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  6:23 UTC (permalink / raw
  To: gentoo-commits

commit:     c45bcf6145fe0a0a0bbc047a0739c3e9f6619d9a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 06:23:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 06:23:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c45bcf61

Use AbstractPollTask._wait_loop() more.

---
 pym/_emerge/AsynchronousLock.py |    6 ++----
 pym/_emerge/FifoIpcDaemon.py    |    6 +-----
 pym/_emerge/PipeReader.py       |    5 +----
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 2c4fe10..3cf0acb 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -152,8 +152,7 @@ class _LockThread(AbstractPollTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-		while self._registered:
-			self.scheduler.iteration()
+		self._wait_loop()
 		return self.returncode
 
 	def unlock(self):
@@ -264,8 +263,7 @@ class _LockProcess(AbstractPollTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-		while self._registered:
-			self.scheduler.iteration()
+		self._wait_loop()
 		return self.returncode
 
 	def _output_handler(self, f, event):

diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index cbe8058..fcc4ab4 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -51,13 +51,9 @@ class FifoIpcDaemon(AbstractPollTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-
-		while self._registered:
-			self.scheduler.iteration()
-
+		self._wait_loop()
 		if self.returncode is None:
 			self.returncode = os.EX_OK
-
 		return self.returncode
 
 	def _input_handler(self, fd, event):

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 54c6eb7..90febdf 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -43,10 +43,7 @@ class PipeReader(AbstractPollTask):
 	def _wait(self):
 		if self.returncode is not None:
 			return self.returncode
-
-		while self._registered:
-			self.scheduler.iteration()
-
+		self._wait_loop()
 		self.returncode = os.EX_OK
 		return self.returncode
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  8:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  8:21 UTC (permalink / raw
  To: gentoo-commits

commit:     31fc2c97563eaa57ebf890d728f45f859c5520bf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 08:21:24 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 08:21:24 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=31fc2c97

QueueScheduler: fix for IpcDaemonTestCase

Use a StopIteration exception to jump out of EventLoop.iterate()
before the poll loop.

---
 pym/_emerge/QueueScheduler.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index 99cfb23..e34758a 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -38,7 +38,7 @@ class QueueScheduler(PollScheduler):
 		if timeout is not None:
 			def timeout_callback():
 				timeout_callback.timed_out = True
-				return False
+				raise StopIteration()
 			timeout_callback.timed_out = False
 			timeout_callback.timeout_id = self.sched_iface.timeout_add(
 				timeout, timeout_callback)
@@ -53,6 +53,8 @@ class QueueScheduler(PollScheduler):
 				timeout_callback.timed_out) and self._running_job_count():
 				self.sched_iface.iteration()
 
+		except StopIteration:
+			pass
 		finally:
 			if timeout_callback is not None:
 				self.sched_iface.unregister(timeout_callback.timeout_id)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-09  9:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-09  9:13 UTC (permalink / raw
  To: gentoo-commits

commit:     7a6c34cc6bd6eb20a97e05347f87a0157f4ae58a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 09:12:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 09:12:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a6c34cc

AsynchronousTask: exit listeners reverse order

This should fix a Scheduler hang which is triggered when that merge
queue, a SequentialTaskQueue, doesn't decrement its merge count until
after other exit listeners have already run.

---
 pym/_emerge/AsynchronousTask.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 4aa5980..d57ccab 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -129,7 +129,11 @@ class AsynchronousTask(SlotObject):
 			self._exit_listener_stack = self._exit_listeners
 			self._exit_listeners = None
 
-			self._exit_listener_stack.reverse()
+			# Execute exit listeners in reverse order, so that
+			# the last added listener is executed first. This
+			# allows SequentialTaskQueue to decrement its running
+			# task count as soon as one of its tasks exits, so that
+			# the value is accurate when other listeners execute.
 			while self._exit_listener_stack:
 				self._exit_listener_stack.pop()(self)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-10 19:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-10 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     57a1219ba81b8f7d9c9beecf27ed500da6239b3a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 10 19:47:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 10 19:47:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=57a1219b

EbuildMerge: add exit_hook to unlock build dir

This is needed since commit 7a6c34cc6bd6eb20a97e05347f87a0157f4ae58a in
order to ensure that the build dir is unlocked before exit listeners
are called. It fixes failures in catalyst stage 1 builds where two
instances of the same package, built sequentially for separate roots,
interfere with eachother's build dir lock.

---
 pym/_emerge/Binpkg.py      |    4 ++--
 pym/_emerge/EbuildBuild.py |    4 ++--
 pym/_emerge/EbuildMerge.py |    4 +++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 6c70b19..395a506 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -373,13 +373,13 @@ class Binpkg(CompositeTask):
 		self._build_dir.unlock()
 
 	def create_install_task(self):
-		task = EbuildMerge(find_blockers=self.find_blockers,
+		task = EbuildMerge(exit_hook=self._install_exit,
+			find_blockers=self.find_blockers,
 			ldpath_mtimes=self.ldpath_mtimes, logger=self.logger,
 			pkg=self.pkg, pkg_count=self.pkg_count,
 			pkg_path=self._pkg_path, scheduler=self.scheduler,
 			settings=self.settings, tree=self._tree,
 			world_atom=self.world_atom)
-		task.addExitListener(self._install_exit)
 		return task
 
 	def _install_exit(self, task):

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index d44dcf3..6e37cda 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -360,7 +360,8 @@ class EbuildBuild(CompositeTask):
 		ebuild_path = self._ebuild_path
 		tree = self._tree
 
-		task = EbuildMerge(find_blockers=self.find_blockers,
+		task = EbuildMerge(exit_hook=self._install_exit,
+			find_blockers=self.find_blockers,
 			ldpath_mtimes=ldpath_mtimes, logger=logger, pkg=pkg,
 			pkg_count=pkg_count, pkg_path=ebuild_path,
 			scheduler=self.scheduler,
@@ -373,7 +374,6 @@ class EbuildBuild(CompositeTask):
 			(pkg_count.curval, pkg_count.maxval, pkg.cpv)
 		logger.log(msg, short_msg=short_msg)
 
-		task.addExitListener(self._install_exit)
 		return task
 
 	def _install_exit(self, task):

diff --git a/pym/_emerge/EbuildMerge.py b/pym/_emerge/EbuildMerge.py
index 9c35988..df0778c 100644
--- a/pym/_emerge/EbuildMerge.py
+++ b/pym/_emerge/EbuildMerge.py
@@ -7,7 +7,7 @@ from portage.dbapi._MergeProcess import MergeProcess
 
 class EbuildMerge(CompositeTask):
 
-	__slots__ = ("find_blockers", "logger", "ldpath_mtimes",
+	__slots__ = ("exit_hook", "find_blockers", "logger", "ldpath_mtimes",
 		"pkg", "pkg_count", "pkg_path", "pretend",
 		"settings", "tree", "world_atom")
 
@@ -35,6 +35,7 @@ class EbuildMerge(CompositeTask):
 
 	def _merge_exit(self, merge_task):
 		if self._final_exit(merge_task) != os.EX_OK:
+			self.exit_hook(self)
 			self.wait()
 			return
 
@@ -53,4 +54,5 @@ class EbuildMerge(CompositeTask):
 		logger.log(" ::: completed emerge (%s of %s) %s to %s" % \
 			(pkg_count.curval, pkg_count.maxval, pkg.cpv, pkg.root))
 
+		self.exit_hook(self)
 		self.wait()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-10 21:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-10 21:58 UTC (permalink / raw
  To: gentoo-commits

commit:     8384ee6a6116a9055601fe7729026af2024f4fa0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 10 21:58:17 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 10 21:58:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8384ee6a

Scheduler: cleanup timeout after _main_loop

The way we don't leave an leak a reference to the Scheduler instance
in the global EventLoop instance.

---
 pym/_emerge/Scheduler.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 674a11e..100d89d 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -196,8 +196,6 @@ class Scheduler(PollScheduler):
 
 		self._status_display = JobStatusDisplay(
 			xterm_titles=('notitles' not in settings.features))
-		self.sched_iface.timeout_add(self._max_display_latency,
-			self._status_display.display)
 		self._max_load = myopts.get("--load-average")
 		max_jobs = myopts.get("--jobs")
 		if max_jobs is None:
@@ -1354,6 +1352,8 @@ class Scheduler(PollScheduler):
 		failed_pkgs = self._failed_pkgs
 		portage.locks._quiet = self._background
 		portage.elog.add_listener(self._elog_listener)
+		display_timeout_id = self.sched_iface.timeout_add(
+			self._max_display_latency, self._status_display.display)
 		rval = os.EX_OK
 
 		try:
@@ -1362,6 +1362,7 @@ class Scheduler(PollScheduler):
 			self._main_loop_cleanup()
 			portage.locks._quiet = False
 			portage.elog.remove_listener(self._elog_listener)
+			self.sched_iface.source_remove(display_timeout_id)
 			if failed_pkgs:
 				rval = failed_pkgs[-1].returncode
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-11  2:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-11  2:10 UTC (permalink / raw
  To: gentoo-commits

commit:     613486a70464ca8c6bd2fdbf68514168e3014b47
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 02:10:07 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 02:10:07 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=613486a7

PollScheduler: add generic _main_loop()

---
 pym/_emerge/MetadataRegen.py  |   10 ++++------
 pym/_emerge/PollScheduler.py  |   22 ++++++++++++++++++++++
 pym/_emerge/QueueScheduler.py |   10 +---------
 pym/_emerge/Scheduler.py      |   15 +++------------
 4 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 1ebc532..3404001 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -82,18 +82,16 @@ class MetadataRegen(PollScheduler):
 					portdb=portdb, repo_path=repo_path,
 					settings=portdb.doebuild_settings)
 
+	def _keep_scheduling(self):
+		return self._remaining_tasks and not self._terminated_tasks
+
 	def run(self):
 
 		portdb = self._portdb
 		from portage.cache.cache_errors import CacheError
 		dead_nodes = {}
 
-		self._schedule()
-		while self._remaining_tasks and not self._terminated_tasks:
-			self.sched_iface.iteration()
-
-		while self._jobs:
-			self.sched_iface.iteration()
+		self._main_loop()
 
 		if self._terminated_tasks:
 			self.returncode = 1

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index eafb8a2..3b3ef67 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -109,6 +109,28 @@ class PollScheduler(object):
 		finally:
 			self._scheduling = False
 
+	def _main_loop(self):
+		# Populate initial event sources. We only need to do
+		# this once here, since it can be called during the
+		# loop from within event handlers.
+		self._schedule()
+
+		# Loop while there are jobs to be scheduled.
+		while self._keep_scheduling():
+			self.sched_iface.iteration()
+
+		# Clean shutdown of previously scheduled jobs. In the
+		# case of termination, this allows for basic cleanup
+		# such as flushing of buffered output to logs.
+		while self._is_work_scheduled():
+			self.sched_iface.iteration()
+
+	def _keep_scheduling(self):
+		return False
+
+	def _is_work_scheduled(self):
+		return bool(self._running_job_count())
+
 	def _running_job_count(self):
 		return self._jobs
 

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index e34758a..ba740c1 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -44,15 +44,7 @@ class QueueScheduler(PollScheduler):
 				timeout, timeout_callback)
 
 		try:
-
-			while not (timeout_callback is not None and
-				timeout_callback.timed_out) and self._schedule():
-				self.sched_iface.iteration()
-
-			while not (timeout_callback is not None and
-				timeout_callback.timed_out) and self._running_job_count():
-				self.sched_iface.iteration()
-
+			self._main_loop()
 		except StopIteration:
 			pass
 		finally:

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 100d89d..66d76b1 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1347,6 +1347,9 @@ class Scheduler(PollScheduler):
 
 	def _merge(self):
 
+		if self._opts_no_background.intersection(self.myopts):
+			self._set_max_jobs(1)
+
 		self._add_prefetchers()
 		self._add_packages()
 		failed_pkgs = self._failed_pkgs
@@ -1493,18 +1496,6 @@ class Scheduler(PollScheduler):
 	def _deallocate_config(self, settings):
 		self._config_pool[settings['EROOT']].append(settings)
 
-	def _main_loop(self):
-
-		if self._opts_no_background.intersection(self.myopts):
-			self._set_max_jobs(1)
-
-		self._schedule()
-		while self._keep_scheduling():
-			self.sched_iface.iteration()
-
-		while self._is_work_scheduled():
-			self.sched_iface.iteration()
-
 	def _keep_scheduling(self):
 		return bool(not self._terminated_tasks and self._pkg_queue and \
 			not (self._failed_pkgs and not self._build_opts.fetchonly))



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-11  3:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-11  3:19 UTC (permalink / raw
  To: gentoo-commits

commit:     2d08e6c4520556e5acc0055cdb3d68028eed3243
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 03:18:57 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 03:18:57 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2d08e6c4

display_autounmask: highlight config changes

As suggested here:

http://archives.gentoo.org/gentoo-dev/msg_06a47ad55977f4d16bfe18769c6c38b8.xml

---
 pym/_emerge/depgraph.py |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6d0ba1c..cdc5098 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6054,6 +6054,14 @@ class depgraph(object):
 
 			write_to_file = not problems
 
+		def format_msg(lines):
+			lines = lines[:]
+			for i, line in enumerate(lines):
+				if line.startswith("#"):
+					continue
+				lines[i] = colorize("INFORM", line.rstrip()) + "\n"
+			return "".join(lines)
+
 		for root in roots:
 			settings = self._frozen_config.roots[root].settings
 			abs_user_config = os.path.join(
@@ -6065,22 +6073,22 @@ class depgraph(object):
 			if root in unstable_keyword_msg:
 				writemsg_stdout("\nThe following " + colorize("BAD", "keyword changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout("".join(unstable_keyword_msg[root]), noiselevel=-1)
+				writemsg_stdout(format_msg(unstable_keyword_msg[root]), noiselevel=-1)
 
 			if root in p_mask_change_msg:
 				writemsg_stdout("\nThe following " + colorize("BAD", "mask changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout("".join(p_mask_change_msg[root]), noiselevel=-1)
+				writemsg_stdout(format_msg(p_mask_change_msg[root]), noiselevel=-1)
 
 			if root in use_changes_msg:
 				writemsg_stdout("\nThe following " + colorize("BAD", "USE changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout("".join(use_changes_msg[root]), noiselevel=-1)
+				writemsg_stdout(format_msg(use_changes_msg[root]), noiselevel=-1)
 
 			if root in license_msg:
 				writemsg_stdout("\nThe following " + colorize("BAD", "license changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout("".join(license_msg[root]), noiselevel=-1)
+				writemsg_stdout(format_msg(license_msg[root]), noiselevel=-1)
 
 		protect_obj = {}
 		if write_to_file:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-11 19:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-11 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     78ccc379fb914d7604603e08ca4ac9fc30fcfc26
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 19:48:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 19:48:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=78ccc379

QueueScheduler: timeout compat for GlibEventLoop

Raising StopIteration doesn't work with GlibEventLoop, since it catches
all exceptions and logs them. So, just use a boolean expression to
terminate the while loop. This depends on commit
dcb9fab8463996542d06d29bc383f5933bf0d677 so that IpcDaemonTestCase
timeouts work correctly with both EventLoop and GlibEventLoop.

---
 pym/_emerge/QueueScheduler.py |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index ba740c1..5f8cf26 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -38,15 +38,26 @@ class QueueScheduler(PollScheduler):
 		if timeout is not None:
 			def timeout_callback():
 				timeout_callback.timed_out = True
-				raise StopIteration()
+				return False
 			timeout_callback.timed_out = False
 			timeout_callback.timeout_id = self.sched_iface.timeout_add(
 				timeout, timeout_callback)
 
 		try:
-			self._main_loop()
-		except StopIteration:
-			pass
+			self._schedule()
+
+			while self._keep_scheduling() and \
+				not (timeout_callback is not None and
+				timeout_callback.timed_out):
+				# We don't have any callbacks to trigger _schedule(),
+				# so we have to call it explicitly here.
+				self._schedule()
+				self.sched_iface.iteration()
+
+			while self._is_work_scheduled() and \
+				not (timeout_callback is not None and
+				timeout_callback.timed_out):
+				self.sched_iface.iteration()
 		finally:
 			if timeout_callback is not None:
 				self.sched_iface.unregister(timeout_callback.timeout_id)
@@ -58,7 +69,7 @@ class QueueScheduler(PollScheduler):
 			False otherwise.
 		"""
 		if self._terminated_tasks:
-			return False
+			return
 
 		while self._can_add_job():
 			n = self._max_jobs - self._running_job_count()
@@ -66,12 +77,10 @@ class QueueScheduler(PollScheduler):
 				break
 
 			if not self._start_next_job(n):
-				return False
+				return
 
-		for q in self._queues:
-			if q:
-				return True
-		return False
+	def _keep_scheduling(self):
+		return not self._terminated_tasks and any(self._queues)
 
 	def _running_job_count(self):
 		job_count = 0



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-11 20:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-11 20:05 UTC (permalink / raw
  To: gentoo-commits

commit:     0f55a5a75c410d73779f7090784d06e40e03a1c9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 20:05:17 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 20:05:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f55a5a7

PollScheduler: return None from _schedule_tasks

The _keep_scheduling() template method is used instead.

---
 pym/_emerge/MetadataRegen.py |   10 ++--------
 pym/_emerge/PollScheduler.py |   15 ++++++++++-----
 pym/_emerge/Scheduler.py     |    2 --
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 3404001..efe3004 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -139,27 +139,21 @@ class MetadataRegen(PollScheduler):
 						pass
 
 	def _schedule_tasks(self):
-		"""
-		@rtype: bool
-		@returns: True if there may be remaining tasks to schedule,
-			False otherwise.
-		"""
 		if self._terminated_tasks:
-			return False
+			return
 
 		while self._can_add_job():
 			try:
 				metadata_process = next(self._process_iter)
 			except StopIteration:
 				self._remaining_tasks = False
-				return False
+				return
 
 			self._jobs += 1
 			self._running_tasks.add(metadata_process)
 			metadata_process.scheduler = self.sched_iface
 			metadata_process.addExitListener(self._metadata_exit)
 			metadata_process.start()
-		return True
 
 	def _metadata_exit(self, metadata_process):
 		self._jobs -= 1

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 3b3ef67..e270e6a 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -70,6 +70,14 @@ class PollScheduler(object):
 		"""
 		raise NotImplementedError()
 
+	def _keep_scheduling(self):
+		"""
+		@rtype: bool
+		@returns: True if there may be remaining tasks to schedule,
+			False otherwise.
+		"""
+		return False
+
 	def _schedule_tasks(self):
 		"""
 		This is called from inside the _schedule() method, which
@@ -83,7 +91,7 @@ class PollScheduler(object):
 		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
+		should return immediately (since there's no need to
 		schedule anything after _terminate_tasks() has been called).
 		"""
 		pass
@@ -105,7 +113,7 @@ class PollScheduler(object):
 				self._terminated_tasks = True
 				self._terminate_tasks()
 
-			return self._schedule_tasks()
+			self._schedule_tasks()
 		finally:
 			self._scheduling = False
 
@@ -125,9 +133,6 @@ class PollScheduler(object):
 		while self._is_work_scheduled():
 			self.sched_iface.iteration()
 
-	def _keep_scheduling(self):
-		return False
-
 	def _is_work_scheduled(self):
 		return bool(self._running_job_count())
 

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 66d76b1..5bb4fe8 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1542,8 +1542,6 @@ class Scheduler(PollScheduler):
 				not self._task_queues.merge)):
 				break
 
-		return self._keep_scheduling()
-
 	def _job_delay(self):
 		"""
 		@rtype: bool



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-11 22:17 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-02-11 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     7f605a874487e42b856d9a2ffd30fc0e587bae3f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Feb 11 22:14:43 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sat Feb 11 22:14:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7f605a87

_emerge.MetadataRegen.MetadataRegen._iter_metadata_processes():
Regenerate metadata for given cpv in each repository.

---
 pym/_emerge/MetadataRegen.py |   44 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index efe3004..e0c8092 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -1,8 +1,9 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import portage
 from portage import os
+from portage.dep import _repo_separator
 from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
 from _emerge.PollScheduler import PollScheduler
 
@@ -61,26 +62,27 @@ class MetadataRegen(PollScheduler):
 				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_tasks:
-					break
-				valid_pkgs.add(cpv)
-				ebuild_path, repo_path = portdb.findname2(cpv)
-				if ebuild_path is None:
-					raise AssertionError("ebuild not found for '%s'" % cpv)
-				metadata, ebuild_hash = portdb._pull_valid_cache(
-					cpv, ebuild_path, repo_path)
-				if metadata is not None:
-					if consumer is not None:
-						consumer(cpv, repo_path, metadata, ebuild_hash)
-					continue
-
-				yield EbuildMetadataPhase(cpv=cpv,
-					ebuild_hash=ebuild_hash,
-					metadata_callback=portdb._metadata_callback,
-					portdb=portdb, repo_path=repo_path,
-					settings=portdb.doebuild_settings)
+			for repo in portdb.repositories:
+				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
+				for cpv in cpv_list:
+					if self._terminated_tasks:
+						break
+					valid_pkgs.add(cpv)
+					ebuild_path, repo_path = portdb.findname2(cpv, myrepo=repo.name)
+					if ebuild_path is None:
+						raise AssertionError("ebuild not found for '%s%s%s'" % (cpv, _repo_separator, repo.name))
+					metadata, ebuild_hash = portdb._pull_valid_cache(
+						cpv, ebuild_path, repo_path)
+					if metadata is not None:
+						if consumer is not None:
+							consumer(cpv, repo_path, metadata, ebuild_hash)
+						continue
+
+					yield EbuildMetadataPhase(cpv=cpv,
+						ebuild_hash=ebuild_hash,
+						metadata_callback=portdb._metadata_callback,
+						portdb=portdb, repo_path=repo_path,
+						settings=portdb.doebuild_settings)
 
 	def _keep_scheduling(self):
 		return self._remaining_tasks and not self._terminated_tasks



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-11 23:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-11 23:02 UTC (permalink / raw
  To: gentoo-commits

commit:     33d82be6f57cb845ae957309be9a4ab4303de0de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 23:01:55 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 23:01:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=33d82be6

MetadataRegen: use porttrees

---
 pym/_emerge/MetadataRegen.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index e0c8092..b4c98dc 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -62,7 +62,10 @@ class MetadataRegen(PollScheduler):
 				break
 			cp_set.add(cp)
 			portage.writemsg_stdout("Processing %s\n" % cp)
-			for repo in portdb.repositories:
+			# We iterate over portdb.porttrees, since it's common to
+			# tweak this attribute in order to adjust repo selection.
+			for mytree in portdb.porttrees:
+				repo = portdb.repositories.get_repo_for_location(mytree)
 				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
 				for cpv in cpv_list:
 					if self._terminated_tasks:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-12  0:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-12  0:05 UTC (permalink / raw
  To: gentoo-commits

commit:     71b3466c9bc7c00835bf4665765d05b14c2c5c49
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 00:05:14 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 00:05:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71b3466c

QueueScheduler: tweak run loop logic

---
 pym/_emerge/QueueScheduler.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index 5f8cf26..731a677 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -44,15 +44,15 @@ class QueueScheduler(PollScheduler):
 				timeout, timeout_callback)
 
 		try:
-			self._schedule()
-
-			while self._keep_scheduling() and \
-				not (timeout_callback is not None and
+			while not (timeout_callback is not None and
 				timeout_callback.timed_out):
 				# We don't have any callbacks to trigger _schedule(),
 				# so we have to call it explicitly here.
 				self._schedule()
-				self.sched_iface.iteration()
+				if self._keep_scheduling():
+					self.sched_iface.iteration()
+				else:
+					break
 
 			while self._is_work_scheduled() and \
 				not (timeout_callback is not None and



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-12  4:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-12  4:09 UTC (permalink / raw
  To: gentoo-commits

commit:     fc42d39d0ac9043b7a480d914b12fa679e4e2785
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 04:08:59 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 04:08:59 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc42d39d

AbstractPollTask: merge _wait from subclass

---
 pym/_emerge/AbstractPollTask.py |    6 ++++++
 pym/_emerge/AsynchronousLock.py |   12 ------------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 68282ef..af1c3ff 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -127,6 +127,12 @@ class AbstractPollTask(AsynchronousTask):
 				self._unregister()
 				self.wait()
 
+	def _wait(self):
+		if self.returncode is not None:
+			return self.returncode
+		self._wait_loop()
+		return self.returncode
+
 	def _wait_loop(self, timeout=None):
 
 		if timeout is None:

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index c07df0b..587aa46 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -148,12 +148,6 @@ class _LockThread(AbstractPollTask):
 		# There's currently no way to force thread termination.
 		pass
 
-	def _wait(self):
-		if self.returncode is not None:
-			return self.returncode
-		self._wait_loop()
-		return self.returncode
-
 	def unlock(self):
 		if self._lock_obj is None:
 			raise AssertionError('not locked')
@@ -259,12 +253,6 @@ class _LockProcess(AbstractPollTask):
 			self._proc.poll()
 		return self.returncode
 
-	def _wait(self):
-		if self.returncode is not None:
-			return self.returncode
-		self._wait_loop()
-		return self.returncode
-
 	def _output_handler(self, f, event):
 		buf = None
 		if event & self.scheduler.IO_IN:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-12  5:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-12  5:36 UTC (permalink / raw
  To: gentoo-commits

commit:     c36768027d04f10f7af4402f642e93144d1b353b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 05:36:18 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 05:36:18 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c3676802

EbuildIpcDaemon: handle POLLHUP, bug #401919

---
 pym/_emerge/EbuildIpcDaemon.py |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/EbuildIpcDaemon.py b/pym/_emerge/EbuildIpcDaemon.py
index 5795bfb..8414d20 100644
--- a/pym/_emerge/EbuildIpcDaemon.py
+++ b/pym/_emerge/EbuildIpcDaemon.py
@@ -5,7 +5,9 @@ import errno
 import logging
 import pickle
 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.FifoIpcDaemon import FifoIpcDaemon
 
@@ -83,6 +85,28 @@ class EbuildIpcDaemon(FifoIpcDaemon):
 				if reply_hook is not None:
 					reply_hook()
 
+		elif event & self.scheduler.IO_HUP:
+			# This can be triggered due to a race condition which happens when
+			# the previous _reopen_input() call occurs before the writer has
+			# closed the pipe (see bug #401919). It's not safe to re-open
+			# without a lock here, since it's possible that another writer will
+			# write something to the pipe just before we close it, and in that
+			# case the write will be lost. Therefore, try for a non-blocking
+			# lock, and only re-open the pipe if the lock is acquired.
+			lock_filename = os.path.join(
+				os.path.dirname(self.input_fifo), '.ipc_lock')
+			try:
+				lock_obj = lockfile(lock_filename, unlinkfile=True,
+					flags=os.O_NONBLOCK)
+			except TryAgain:
+				# We'll try again when another IO_HUP event arrives.
+				pass
+			else:
+				try:
+					self._reopen_input()
+				finally:
+					unlockfile(lock_obj)
+
 		return True
 
 	def _send_reply(self, reply):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-12  6:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-12  6:17 UTC (permalink / raw
  To: gentoo-commits

commit:     cb941c1a7567d42441340b57cbc4ed8c5ae38f71
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 06:16:57 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:16:57 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb941c1a

Scheduler: simplify _sched_iface construction

---
 pym/_emerge/Scheduler.py |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5bb4fe8..b84f7bb 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -215,22 +215,11 @@ class Scheduler(PollScheduler):
 		fetch_iface = self._fetch_iface_class(log_file=self._fetch_log,
 			schedule=self._schedule_fetch)
 		self._sched_iface = self._iface_class(
-			IO_ERR=self._event_loop.IO_ERR,
-			IO_HUP=self._event_loop.IO_HUP,
-			IO_IN=self._event_loop.IO_IN,
-			IO_NVAL=self._event_loop.IO_NVAL,
-			IO_OUT=self._event_loop.IO_OUT,
-			IO_PRI=self._event_loop.IO_PRI,
-			fetch=fetch_iface, output=self._task_output,
-			idle_add=self._event_loop.idle_add,
-			io_add_watch=self._event_loop.io_add_watch,
-			iteration=self._event_loop.iteration,
-			register=self._event_loop.io_add_watch,
+			fetch=fetch_iface,
 			scheduleSetup=self._schedule_setup,
 			scheduleUnpack=self._schedule_unpack,
-			source_remove=self._event_loop.source_remove,
-			timeout_add=self._event_loop.timeout_add,
-			unregister=self._event_loop.source_remove)
+			**dict((k, getattr(self.sched_iface, k))
+			for k in self.sched_iface.__slots__))
 
 		self._prefetchers = weakref.WeakValueDictionary()
 		self._pkg_queue = []



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-13  6:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-13  6:44 UTC (permalink / raw
  To: gentoo-commits

commit:     8346a62a08c91de8b7672faa0ebfb91d0e647fa0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 13 06:43:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 13 06:43:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8346a62a

PollScheduler: use idle_add to check termination

This fixes a regression in termination signal handling since commit
8c1fcf5a9ba9fa4d406a4d0cc284fe73a84f5a63, which cause termination
signals to be ignored until a running job had exited. This regression
is not really noticeable for Ctrl-C handling, since in that case the
SIGINT propagets to subprocesses, causing them to exit and trigger a
_schedule() call whichtriggers a termination check.

---
 pym/_emerge/PollScheduler.py  |   61 ++++++++++++++++++++++++++---------------
 pym/_emerge/QueueScheduler.py |    2 +
 2 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index e270e6a..1db6807 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -59,11 +59,30 @@ class PollScheduler(object):
 		"""
 		self._terminated.set()
 
+	def _termination_check(self):
+		"""
+		Calls _terminate_tasks() if appropriate. It's guaranteed not to
+		call it while _schedule_tasks() is being called. The check should
+		be executed for each iteration of the event loop, for response to
+		termination signals at the earliest opportunity. It always returns
+		True, for continuous scheduling via idle_add.
+		"""
+		if not self._scheduling and \
+			self._terminated.is_set() and \
+			not self._terminated_tasks:
+			self._scheduling = True
+			try:
+				self._terminated_tasks = True
+				self._terminate_tasks()
+			finally:
+				self._scheduling = False
+		return True
+
 	def _terminate_tasks(self):
 		"""
 		Send signals to terminate all tasks. This is called once
-		from self._schedule() in the event dispatching thread. This
-		prevents it from being called while the _schedule_tasks()
+		from _keep_scheduling() or _is_work_scheduled() in the event
+		dispatching thread. It will not be 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.
@@ -107,31 +126,29 @@ 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()
-
 			self._schedule_tasks()
 		finally:
 			self._scheduling = False
 
 	def _main_loop(self):
-		# Populate initial event sources. We only need to do
-		# this once here, since it can be called during the
-		# loop from within event handlers.
-		self._schedule()
-
-		# Loop while there are jobs to be scheduled.
-		while self._keep_scheduling():
-			self.sched_iface.iteration()
-
-		# Clean shutdown of previously scheduled jobs. In the
-		# case of termination, this allows for basic cleanup
-		# such as flushing of buffered output to logs.
-		while self._is_work_scheduled():
-			self.sched_iface.iteration()
+		term_check_id = self.sched_iface.idle_add(self._termination_check)
+		try:
+			# Populate initial event sources. We only need to do
+			# this once here, since it can be called during the
+			# loop from within event handlers.
+			self._schedule()
+
+			# Loop while there are jobs to be scheduled.
+			while self._keep_scheduling():
+				self.sched_iface.iteration()
+
+			# Clean shutdown of previously scheduled jobs. In the
+			# case of termination, this allows for basic cleanup
+			# such as flushing of buffered output to logs.
+			while self._is_work_scheduled():
+				self.sched_iface.iteration()
+		finally:
+			self.sched_iface.source_remove(term_check_id)
 
 	def _is_work_scheduled(self):
 		return bool(self._running_job_count())

diff --git a/pym/_emerge/QueueScheduler.py b/pym/_emerge/QueueScheduler.py
index 731a677..730bd78 100644
--- a/pym/_emerge/QueueScheduler.py
+++ b/pym/_emerge/QueueScheduler.py
@@ -43,6 +43,7 @@ class QueueScheduler(PollScheduler):
 			timeout_callback.timeout_id = self.sched_iface.timeout_add(
 				timeout, timeout_callback)
 
+		term_check_id = self.sched_iface.idle_add(self._termination_check)
 		try:
 			while not (timeout_callback is not None and
 				timeout_callback.timed_out):
@@ -59,6 +60,7 @@ class QueueScheduler(PollScheduler):
 				timeout_callback.timed_out):
 				self.sched_iface.iteration()
 		finally:
+			self.sched_iface.source_remove(term_check_id)
 			if timeout_callback is not None:
 				self.sched_iface.unregister(timeout_callback.timeout_id)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-14 23:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-14 23:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c7bf6ba4f18952ad903036234082e784aa29d43e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 23:25:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 23:25:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c7bf6ba4

AsynchronousTask: skip cancelled check in _start

These checks should be irrelevant, since the cancel() method is never
called on anything that hasn't been started already.

---
 pym/_emerge/BinpkgFetcher.py |    3 ---
 pym/_emerge/SpawnProcess.py  |    3 ---
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index baea4d6..f415e2e 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -28,9 +28,6 @@ class BinpkgFetcher(SpawnProcess):
 
 	def _start(self):
 
-		if self.cancelled:
-			return
-
 		pkg = self.pkg
 		pretend = self.pretend
 		bintree = pkg.root_config.trees["bintree"]

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 411e7c6..3e8945b 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -33,9 +33,6 @@ class SpawnProcess(SubProcess):
 
 	def _start(self):
 
-		if self.cancelled:
-			return
-
 		if self.fd_pipes is None:
 			self.fd_pipes = {}
 		fd_pipes = self.fd_pipes



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-14 23:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-14 23:51 UTC (permalink / raw
  To: gentoo-commits

commit:     174da53469886a2d42e55326377d59e453b696c2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 23:51:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 23:51:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=174da534

SubProcess._wait: add debug code for bug #403697

---
 pym/_emerge/SubProcess.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 17a3e8f..926efa7 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -81,6 +81,12 @@ class SubProcess(AbstractPollTask):
 			if self.returncode is not None:
 				return self.returncode
 
+		if not isinstance(self.pid, int):
+			# Get debug info for bug #403697.
+			raise AssertionError(
+				"%s: pid is non-integer: %s" %
+				(self.__class__.__name__, repr(self.pid)))
+
 		try:
 			# With waitpid and WNOHANG, only check the
 			# first element of the tuple since the second



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-15  1:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-15  1:17 UTC (permalink / raw
  To: gentoo-commits

commit:     b1adb04939ce95ed522934e81c064046f6047c84
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 15 01:17:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 01:17:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b1adb049

SpawnProcess: for stdout use os.write, not fdopen

---
 pym/_emerge/SpawnProcess.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 3e8945b..05c4768 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -91,7 +91,7 @@ class SpawnProcess(SubProcess):
 				mode=0o660)
 
 			if not self.background:
-				files.stdout = os.fdopen(os.dup(fd_pipes_orig[1]), 'wb')
+				files.stdout = os.dup(fd_pipes_orig[1])
 
 			output_handler = self._output_handler
 
@@ -180,11 +180,10 @@ class SpawnProcess(SubProcess):
 					while True:
 						try:
 							if not write_successful:
-								files.stdout.write(buf)
+								os.write(files.stdout, buf)
 								write_successful = True
-							files.stdout.flush()
 							break
-						except IOError as e:
+						except OSError as e:
 							if e.errno != errno.EAGAIN:
 								raise
 							del e
@@ -206,8 +205,8 @@ class SpawnProcess(SubProcess):
 							# inherit stdio file descriptors from portage
 							# (maybe it can't be avoided with
 							# PROPERTIES=interactive).
-							fcntl.fcntl(files.stdout.fileno(), fcntl.F_SETFL,
-								fcntl.fcntl(files.stdout.fileno(),
+							fcntl.fcntl(files.stdout, fcntl.F_SETFL,
+								fcntl.fcntl(files.stdout,
 								fcntl.F_GETFL) ^ os.O_NONBLOCK)
 
 				files.log.write(buf)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-15  3:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-15  3:01 UTC (permalink / raw
  To: gentoo-commits

commit:     a16c54c0d5b891655bce89e5779e6b9221131ba7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 15 03:01:16 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 03:01:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a16c54c0

Scheduler: PyPy WeakValueDictionary.pop KeyError

KeyError observed from WeakValueDictionary.pop() with PyPy 1.8,
despite None given as default. Note that PyPy 1.8 has the same
WeakValueDictionary code as CPython 2.7, so it may be possible for
CPython to raise KeyError here as well.

---
 pym/_emerge/Scheduler.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 4b37026..c797c32 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1620,7 +1620,14 @@ class Scheduler(PollScheduler):
 					"installed", pkg.root_config, installed=True,
 					operation="uninstall")
 
-		prefetcher = self._prefetchers.pop(pkg, None)
+		try:
+			prefetcher = self._prefetchers.pop(pkg, None)
+		except KeyError:
+			# KeyError observed with PyPy 1.8, despite None given as default.
+			# Note that PyPy 1.8 has the same WeakValueDictionary code as
+			# CPython 2.7, so it may be possible for CPython to raise KeyError
+			# here as well.
+			prefetcher = None
 		if prefetcher is not None and not prefetcher.isAlive():
 			try:
 				self._task_queues.fetch._task_queue.remove(prefetcher)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-16  0:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-16  0:25 UTC (permalink / raw
  To: gentoo-commits

commit:     4862a0c5627e13cb3618779b41ef0fe0edae148b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 16 00:25:31 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 16 00:25:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4862a0c5

SpawnProcess: use os.open for /dev/null input

---
 pym/_emerge/SpawnProcess.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 05c4768..9fbc964 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -59,8 +59,8 @@ class SpawnProcess(SubProcess):
 			# access to stdin. Until then, use /dev/null so that any
 			# attempts to read from stdin will immediately return EOF
 			# instead of blocking indefinitely.
-			null_input = open('/dev/null', 'rb')
-			fd_pipes[0] = null_input.fileno()
+			null_input = os.open('/dev/null', os.O_RDWR)
+			fd_pipes[0] = null_input
 
 		fd_pipes.setdefault(0, sys.stdin.fileno())
 		fd_pipes.setdefault(1, sys.stdout.fileno())
@@ -123,7 +123,7 @@ class SpawnProcess(SubProcess):
 
 		os.close(slave_fd)
 		if null_input is not None:
-			null_input.close()
+			os.close(null_input)
 
 		if isinstance(retval, int):
 			# spawn failed



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-16  5:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-16  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     9c664779a16f6cbca8a5ffe7f6b0c68572819723
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 16 05:13:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 16 05:13:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c664779

SubProcess: use non-blocking waitpid

This ensures that the EventLoop will not stop due to a waitpid call
blocking forever.

---
 pym/_emerge/SubProcess.py |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 926efa7..01004a8 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -20,6 +20,9 @@ class SubProcess(AbstractPollTask):
 	# we've sent a kill signal to our subprocess.
 	_cancel_timeout = 1000 # 1 second
 
+	# Poll interval for process exit status.
+	_waitpid_interval = 1000 # 1 second
+
 	def _poll(self):
 		if self.returncode is not None:
 			return self.returncode
@@ -77,7 +80,7 @@ class SubProcess(AbstractPollTask):
 						self._orphan_process_warn()
 			else:
 				self._wait_loop()
-			self._unregister()
+
 			if self.returncode is not None:
 				return self.returncode
 
@@ -87,6 +90,25 @@ class SubProcess(AbstractPollTask):
 				"%s: pid is non-integer: %s" %
 				(self.__class__.__name__, repr(self.pid)))
 
+		self._waitpid_loop()
+
+		return self.returncode
+
+	def _waitpid_loop(self):
+		if not self._waitpid_cb():
+			return
+
+		timeout_id = self.scheduler.timeout_add(
+			self._waitpid_interval, self._waitpid_cb)
+		try:
+			while self.returncode is None:
+				self.scheduler.iteration()
+		finally:
+			self.scheduler.source_remove(timeout_id)
+
+	def _waitpid_cb(self):
+		if self.returncode is not None:
+			return False
 		try:
 			# With waitpid and WNOHANG, only check the
 			# first element of the tuple since the second
@@ -97,21 +119,13 @@ class SubProcess(AbstractPollTask):
 				raise
 			del e
 			self._set_returncode((self.pid, 1 << 8))
+			return False
 		else:
 			if wait_retval[0] != 0:
 				self._set_returncode(wait_retval)
-			else:
-				try:
-					wait_retval = os.waitpid(self.pid, 0)
-				except OSError as e:
-					if e.errno != errno.ECHILD:
-						raise
-					del e
-					self._set_returncode((self.pid, 1 << 8))
-				else:
-					self._set_returncode(wait_retval)
+				return False
 
-		return self.returncode
+		return True
 
 	def _orphan_process_warn(self):
 		pass
@@ -141,6 +155,7 @@ class SubProcess(AbstractPollTask):
 		subprocess.Popen.returncode: A negative value -N indicates
 		that the child was terminated by signal N (Unix only).
 		"""
+		self._unregister()
 
 		pid, status = wait_retval
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-16 21:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-16 21:00 UTC (permalink / raw
  To: gentoo-commits

commit:     1979a6cdfcd8c6bae4565982d82d862be07ba5be
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 16 20:58:29 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 16 20:59:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1979a6cd

SubProcess: use child_watch_add

This fixes performance issues introduced by commit
9c664779a16f6cbca8a5ffe7f6b0c68572819723.

---
 pym/_emerge/SubProcess.py |   36 +++++++-----------------------------
 1 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 01004a8..9c033c5 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -20,9 +20,6 @@ class SubProcess(AbstractPollTask):
 	# we've sent a kill signal to our subprocess.
 	_cancel_timeout = 1000 # 1 second
 
-	# Poll interval for process exit status.
-	_waitpid_interval = 1000 # 1 second
-
 	def _poll(self):
 		if self.returncode is not None:
 			return self.returncode
@@ -95,37 +92,18 @@ class SubProcess(AbstractPollTask):
 		return self.returncode
 
 	def _waitpid_loop(self):
-		if not self._waitpid_cb():
-			return
-
-		timeout_id = self.scheduler.timeout_add(
-			self._waitpid_interval, self._waitpid_cb)
+		source_id = self.scheduler.child_watch_add(
+			self.pid, self._waitpid_cb)
 		try:
 			while self.returncode is None:
 				self.scheduler.iteration()
 		finally:
-			self.scheduler.source_remove(timeout_id)
-
-	def _waitpid_cb(self):
-		if self.returncode is not None:
-			return False
-		try:
-			# With waitpid and WNOHANG, only check the
-			# first element of the tuple since the second
-			# element may vary (bug #337465).
-			wait_retval = os.waitpid(self.pid, os.WNOHANG)
-		except OSError as e:
-			if e.errno != errno.ECHILD:
-				raise
-			del e
-			self._set_returncode((self.pid, 1 << 8))
-			return False
-		else:
-			if wait_retval[0] != 0:
-				self._set_returncode(wait_retval)
-				return False
+			self.scheduler.source_remove(source_id)
 
-		return True
+	def _waitpid_cb(self, pid, condition, user_data):
+		if pid != self.pid:
+			raise AssertionError("expected pid %s, got %s" % (self.pid, pid))
+		self._set_returncode((pid, condition))
 
 	def _orphan_process_warn(self):
 		pass



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-17 10:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-17 10:05 UTC (permalink / raw
  To: gentoo-commits

commit:     8c6f5e6c2d341953ea5574974cecf906ddb67e71
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 17 10:04:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 10:04:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8c6f5e6c

SubProcess._waitpid_cb: fix args for glib compat

---
 pym/_emerge/SubProcess.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 9c033c5..76b313f 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -100,7 +100,7 @@ class SubProcess(AbstractPollTask):
 		finally:
 			self.scheduler.source_remove(source_id)
 
-	def _waitpid_cb(self, pid, condition, user_data):
+	def _waitpid_cb(self, pid, condition, user_data=None):
 		if pid != self.pid:
 			raise AssertionError("expected pid %s, got %s" % (self.pid, pid))
 		self._set_returncode((pid, condition))



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-17 22:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-17 22:31 UTC (permalink / raw
  To: gentoo-commits

commit:     17f1186cb6788c8978b8d231393a03736edc2dfd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 17 22:31:37 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 22:31:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=17f1186c

SlotObject: validate __slots__ and keyword args

---
 pym/_emerge/SlotObject.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/SlotObject.py b/pym/_emerge/SlotObject.py
index fdc6f35..a59dfc1 100644
--- a/pym/_emerge/SlotObject.py
+++ b/pym/_emerge/SlotObject.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 class SlotObject(object):
@@ -15,9 +15,18 @@ class SlotObject(object):
 			if not slots:
 				continue
 			for myattr in slots:
-				myvalue = kwargs.get(myattr, None)
+				myvalue = kwargs.pop(myattr, None)
+				if myvalue is None and getattr(self, myattr, None) is not None:
+					raise AssertionError(
+						"class '%s' duplicates '%s' value in __slots__ of base class '%s'" %
+						(self.__class__.__name__, myattr, c.__name__))
 				setattr(self, myattr, myvalue)
 
+		if kwargs:
+			raise TypeError(
+				"'%s' is an invalid keyword argument for this constructor" %
+				(next(iter(kwargs)),))
+
 	def copy(self):
 		"""
 		Create a new instance and copy all attributes



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-20 11:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-20 11:01 UTC (permalink / raw
  To: gentoo-commits

commit:     9d9fe96df2af7cb504ba25f8681322de71d64434
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 20 11:01:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 11:01:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9d9fe96d

Scheduler: hang in _schedule_tasks, bug 404995

This is triggered whenever emerge bails out while parallel-fetch is
running in the background.

---
 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 b76d9ee..520b140 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1523,8 +1523,9 @@ class Scheduler(PollScheduler):
 			if self._failed_pkgs and not self._build_opts.fetchonly and \
 				not self._is_work_scheduled() and \
 				self._task_queues.fetch:
+				# Since this happens asynchronously, and it doesn't count in
+				# state_change (counting it triggers an infinite loop).
 				self._task_queues.fetch.clear()
-				state_change += 1
 
 			if not (state_change or \
 				(self._merge_wait_queue and not self._jobs and



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-20 11:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-20 11:05 UTC (permalink / raw
  To: gentoo-commits

commit:     e465dbc4a726034a173407f3edfffc56e9ad8639
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 20 11:01:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 11:04:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e465dbc4

Scheduler: hang in _schedule_tasks, bug 404995

This is triggered whenever emerge bails out while parallel-fetch is
running in the background.

---
 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 b76d9ee..62b3589 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1523,8 +1523,9 @@ class Scheduler(PollScheduler):
 			if self._failed_pkgs and not self._build_opts.fetchonly and \
 				not self._is_work_scheduled() and \
 				self._task_queues.fetch:
+				# Since this happens asynchronously, it doesn't count in
+				# state_change (counting it triggers an infinite loop).
 				self._task_queues.fetch.clear()
-				state_change += 1
 
 			if not (state_change or \
 				(self._merge_wait_queue and not self._jobs and



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-24 21:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-24 21:55 UTC (permalink / raw
  To: gentoo-commits

commit:     0279590c2351cf4e757e15bbbfc5546205e16533
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Fri Feb 24 21:13:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 24 21:53:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0279590c

autounmask: Fix USE change messages to display the correct parent

Fixes bug 399863.

---
 pym/_emerge/depgraph.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index cdc5098..bb3bf4a 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2814,6 +2814,10 @@ class depgraph(object):
 			elif node is not start_node:
 				for ppkg, patom in all_parents[child]:
 					if ppkg == node:
+						if child is start_node and unsatisfied_dependency and \
+							InternalPackageSet(initial_atoms=(patom,)).findAtomForPackage(child):
+							# This atom is satisfied by child, there must be another atom.
+							continue
 						atom = patom.unevaluated_atom
 						break
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-26 10:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-26 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     c9a0df701f983b41fd0f1aac7bb4536f771846cb
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Sun Feb 26 08:49:13 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 09:44:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c9a0df70

Reorganize how autounmask allows changes to be made

This patch does not change emerge's behaviour.

---
 pym/_emerge/depgraph.py |  109 ++++++++++++++++++++++++----------------------
 1 files changed, 57 insertions(+), 52 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index bb3bf4a..a05c17e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3504,42 +3504,63 @@ class depgraph(object):
 				return False
 		return True
 
+	class _AutounmaskLevel(object):
+		__slots__ = ("allow_use_changes", "allow_unstable_keywords", "allow_license_changes", "allow_unmasks")
+
+		def __init__(self):
+			self.allow_use_changes = False
+			self.allow_unstable_keywords = False
+			self.allow_license_changes = False
+			self.allow_unmasks = False
+
+	def _autounmask_levels(self):
+
+		if self._dynamic_config._autounmask is not True:
+			return
+
+		autounmask_keep_masks = self._frozen_config.myopts.get("--autounmask-keep-masks", "n") != "n"
+		autounmask_level = self._AutounmaskLevel()
+
+		autounmask_level.allow_use_changes = True
+
+		for only_use_changes in (True, False):
+
+			autounmask_level.allow_unstable_keywords = (not only_use_changes)
+			autounmask_level.allow_license_changes = (not only_use_changes)
+
+			for allow_unmasks in (False, True):
+				if allow_unmasks and (only_use_changes or autounmask_keep_masks):
+					continue
+
+				autounmask_level.allow_unmasks = allow_unmasks
+
+				yield autounmask_level
+
+
 	def _select_pkg_highest_available_imp(self, root, atom, onlydeps=False):
 		pkg, existing = self._wrapped_select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps)
 
 		default_selection = (pkg, existing)
 
-		autounmask_keep_masks = self._frozen_config.myopts.get("--autounmask-keep-masks", "n") != "n"
-
-		if self._dynamic_config._autounmask is True:
+		def reset_pkg(pkg):
 			if pkg is not None and \
 				pkg.installed and \
 				not self._want_installed_pkg(pkg):
 				pkg = None
 
-			for only_use_changes in True, False:
+		if self._dynamic_config._autounmask is True:
+			reset_pkg(pkg)
+
+			for autounmask_level in self._autounmask_levels():
 				if pkg is not None:
 					break
 
-				for allow_unmasks in (False, True):
-					if allow_unmasks and (only_use_changes or autounmask_keep_masks):
-						continue
-
-					if pkg is not None:
-						break
+				pkg, existing = \
+					self._wrapped_select_pkg_highest_available_imp(
+						root, atom, onlydeps=onlydeps,
+						autounmask_level=autounmask_level)
 
-					pkg, existing = \
-						self._wrapped_select_pkg_highest_available_imp(
-							root, atom, onlydeps=onlydeps,
-							allow_use_changes=True,
-							allow_unstable_keywords=(not only_use_changes),
-							allow_license_changes=(not only_use_changes),
-							allow_unmasks=allow_unmasks)
-
-					if pkg is not None and \
-						pkg.installed and \
-						not self._want_installed_pkg(pkg):
-						pkg = None
+				reset_pkg(pkg)
 			
 			if self._dynamic_config._need_restart:
 				return None, None
@@ -3551,8 +3572,7 @@ class depgraph(object):
 
 		return pkg, existing
 
-	def _pkg_visibility_check(self, pkg, allow_unstable_keywords=False,
-		allow_license_changes=False, allow_unmasks=False, trust_graph=True):
+	def _pkg_visibility_check(self, pkg, autounmask_level=None, trust_graph=True):
 
 		if pkg.visible:
 			return True
@@ -3565,7 +3585,7 @@ class depgraph(object):
 			# as though they are visible.
 			return True
 
-		if not self._dynamic_config._autounmask:
+		if not self._dynamic_config._autounmask or autounmask_level is None:
 			return False
 
 		pkgsettings = self._frozen_config.pkgsettings[pkg.root]
@@ -3615,10 +3635,10 @@ class depgraph(object):
 			return True
 
 		#We treat missing keywords in the same way as masks.
-		if (masked_by_unstable_keywords and not allow_unstable_keywords) or \
-			(masked_by_missing_keywords and not allow_unmasks) or \
-			(masked_by_p_mask and not allow_unmasks) or \
-			(missing_licenses and not allow_license_changes):
+		if (masked_by_unstable_keywords and not autounmask_level.allow_unstable_keywords) or \
+			(masked_by_missing_keywords and not autounmask_level.allow_unmasks) or \
+			(masked_by_p_mask and not autounmask_level.allow_unmasks) or \
+			(missing_licenses and not autounmask_level.allow_license_changes):
 			#We are not allowed to do the needed changes.
 			return False
 
@@ -3733,8 +3753,7 @@ class depgraph(object):
 				self._dynamic_config._need_restart = True
 		return new_use
 
-	def _wrapped_select_pkg_highest_available_imp(self, root, atom, onlydeps=False, \
-		allow_use_changes=False, allow_unstable_keywords=False, allow_license_changes=False, allow_unmasks=False):
+	def _wrapped_select_pkg_highest_available_imp(self, root, atom, onlydeps=False, autounmask_level=None):
 		root_config = self._frozen_config.roots[root]
 		pkgsettings = self._frozen_config.pkgsettings[root]
 		dbs = self._dynamic_config._filtered_trees[root]["dbs"]
@@ -3861,10 +3880,7 @@ class depgraph(object):
 						# _dep_check_composite_db, in order to prevent
 						# incorrect choices in || deps like bug #351828.
 
-						if not self._pkg_visibility_check(pkg, \
-							allow_unstable_keywords=allow_unstable_keywords,
-							allow_license_changes=allow_license_changes,
-							allow_unmasks=allow_unmasks):
+						if not self._pkg_visibility_check(pkg, autounmask_level):
 							continue
 
 						# Enable upgrade or downgrade to a version
@@ -3904,19 +3920,13 @@ class depgraph(object):
 										pkg_eb_visible = False
 										for pkg_eb in self._iter_match_pkgs(pkg.root_config,
 											"ebuild", Atom("=%s" % (pkg.cpv,))):
-											if self._pkg_visibility_check(pkg_eb, \
-												allow_unstable_keywords=allow_unstable_keywords,
-												allow_license_changes=allow_license_changes,
-												allow_unmasks=allow_unmasks):
+											if self._pkg_visibility_check(pkg_eb, autounmask_level):
 												pkg_eb_visible = True
 												break
 										if not pkg_eb_visible:
 											continue
 									else:
-										if not self._pkg_visibility_check(pkg_eb, \
-											allow_unstable_keywords=allow_unstable_keywords,
-											allow_license_changes=allow_license_changes,
-											allow_unmasks=allow_unmasks):
+										if not self._pkg_visibility_check(pkg_eb, autounmask_level):
 											continue
 
 					# Calculation of USE for unbuilt ebuilds is relatively
@@ -3946,7 +3956,7 @@ class depgraph(object):
 					if atom.use:
 
 						matched_pkgs_ignore_use.append(pkg)
-						if allow_use_changes and not pkg.built:
+						if autounmask_level and autounmask_level.allow_use_changes and not pkg.built:
 							target_use = {}
 							for flag in atom.use.enabled:
 								target_use[flag] = True
@@ -4169,21 +4179,16 @@ class depgraph(object):
 
 			if avoid_update:
 				for pkg in matched_packages:
-					if pkg.installed and self._pkg_visibility_check(pkg, \
-						allow_unstable_keywords=allow_unstable_keywords,
-						allow_license_changes=allow_license_changes,
-						allow_unmasks=allow_unmasks):
+					if pkg.installed and self._pkg_visibility_check(pkg, autounmask_level):
 						return pkg, existing_node
 
 			visible_matches = []
 			if matched_oldpkg:
 				visible_matches = [pkg.cpv for pkg in matched_oldpkg \
-					if self._pkg_visibility_check(pkg, allow_unstable_keywords=allow_unstable_keywords,
-						allow_license_changes=allow_license_changes, allow_unmasks=allow_unmasks)]
+					if self._pkg_visibility_check(pkg, autounmask_level)]
 			if not visible_matches:
 				visible_matches = [pkg.cpv for pkg in matched_packages \
-					if self._pkg_visibility_check(pkg, allow_unstable_keywords=allow_unstable_keywords,
-						allow_license_changes=allow_license_changes, allow_unmasks=allow_unmasks)]
+					if self._pkg_visibility_check(pkg, autounmask_level)]
 			if visible_matches:
 				bestmatch = portage.best(visible_matches)
 			else:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-02-29 15:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-02-29 15:49 UTC (permalink / raw
  To: gentoo-commits

commit:     e1abe799a73594f35a2088a923a8b4ce7e4cdb07
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 29 15:49:25 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 15:49:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e1abe799

action_build: return 1 for "no" --ask answer

---
 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 31d53f9..096dc3a 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -367,7 +367,7 @@ def action_build(settings, trees, mtimedb,
 			print()
 			print("Quitting.")
 			print()
-			return os.EX_OK
+			return 1
 		# Don't ask again (e.g. when auto-cleaning packages after merge)
 		myopts.pop("--ask", None)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-09  2:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-09  2:54 UTC (permalink / raw
  To: gentoo-commits

commit:     f1475a5cb14539fc412d8fca393b7473399d9a5b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  9 02:54:02 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar  9 02:54:02 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f1475a5c

Use Popen to avoid unnecessary shell.

---
 pym/_emerge/actions.py |   53 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 096dc3a..090d9e1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -27,7 +27,6 @@ portage.proxy.lazyimport.lazyimport(globals(),
 
 from portage import os
 from portage import shutil
-from portage import subprocess_getstatusoutput
 from portage import _unicode_decode
 from portage.cache.cache_errors import CacheError
 from portage.const import GLOBAL_CONFIG_PATH
@@ -1357,7 +1356,14 @@ def action_info(settings, trees, myopts, myfiles):
 		lastSync = "Unknown"
 	append("Timestamp of tree: %s" % (lastSync,))
 
-	output=subprocess_getstatusoutput("distcc --version")
+	try:
+		proc = subprocess.Popen(["distcc", "--version"],
+			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+	except OSError:
+		output = (1, None)
+	else:
+		output = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+		output = (proc.wait(), output)
 	if output[0] == os.EX_OK:
 		distcc_str = output[1].split("\n", 1)[0]
 		if "distcc" in settings.features:
@@ -1366,7 +1372,14 @@ def action_info(settings, trees, myopts, myfiles):
 			distcc_str += " [disabled]"
 		append(distcc_str)
 
-	output=subprocess_getstatusoutput("ccache -V")
+	try:
+		proc = subprocess.Popen(["ccache", "-V"],
+			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+	except OSError:
+		output = (1, None)
+	else:
+		output = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+		output = (proc.wait(), output)
 	if output[0] == os.EX_OK:
 		ccache_str = output[1].split("\n", 1)[0]
 		if "ccache" in settings.features:
@@ -3038,7 +3051,7 @@ def getgccversion(chost):
 	return:  the current in-use gcc version
 	"""
 
-	gcc_ver_command = 'gcc -dumpversion'
+	gcc_ver_command = ['gcc', '-dumpversion']
 	gcc_ver_prefix = 'gcc-'
 
 	gcc_not_found_error = red(
@@ -3047,16 +3060,40 @@ def getgccversion(chost):
 	"!!! other terminals also.\n"
 	)
 
-	mystatus, myoutput = subprocess_getstatusoutput("gcc-config -c")
+	try:
+		proc = subprocess.Popen(["gcc-config", "-c"],
+			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+	except OSError:
+		myoutput = None
+		mystatus = 1
+	else:
+		myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+		mystatus = proc.wait()
 	if mystatus == os.EX_OK and myoutput.startswith(chost + "-"):
 		return myoutput.replace(chost + "-", gcc_ver_prefix, 1)
 
-	mystatus, myoutput = subprocess_getstatusoutput(
-		chost + "-" + gcc_ver_command)
+	try:
+		proc = subprocess.Popen(
+			[chost + "-" + gcc_ver_command[0]] + gcc_ver_command[1:],
+			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+	except OSError:
+		myoutput = None
+		mystatus = 1
+	else:
+		myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+		mystatus = proc.wait()
 	if mystatus == os.EX_OK:
 		return gcc_ver_prefix + myoutput
 
-	mystatus, myoutput = subprocess_getstatusoutput(gcc_ver_command)
+	try:
+		proc = subprocess.Popen(gcc_ver_command,
+			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+	except OSError:
+		myoutput = None
+		mystatus = 1
+	else:
+		myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+		mystatus = proc.wait()
 	if mystatus == os.EX_OK:
 		return gcc_ver_prefix + myoutput
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-09  5:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-09  5:08 UTC (permalink / raw
  To: gentoo-commits

commit:     badeb48eae2a1d429902f654c2de60d67283ded7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  9 05:08:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar  9 05:08:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=badeb48e

Exit after killed while waiting on prefetch.

---
 pym/_emerge/AsynchronousTask.py |   15 +++++++++++++++
 pym/_emerge/Binpkg.py           |    6 +++++-
 pym/_emerge/EbuildBuild.py      |    6 +++++-
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index df72bae..7a193ce 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -1,6 +1,8 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import signal
+
 from portage import os
 from portage.util.SlotObject import SlotObject
 
@@ -18,6 +20,8 @@ class AsynchronousTask(SlotObject):
 		("_exit_listeners", "_exit_listener_stack", "_start_listeners",
 		"_waiting")
 
+	_cancelled_returncode = - signal.SIGINT
+
 	def start(self):
 		"""
 		Start an asynchronous task and then return as soon as possible.
@@ -76,6 +80,17 @@ class AsynchronousTask(SlotObject):
 		"""
 		pass
 
+	def _was_cancelled(self):
+		"""
+		If cancelled, set returncode if necessary and return True.
+		Otherwise, return False.
+		"""
+		if self.cancelled:
+			if self.returncode is None:
+				self.returncode = self._cancelled_returncode
+			return True
+		return False
+
 	def addStartListener(self, f):
 		"""
 		The function will be called with one argument, a reference to self.

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 395a506..ea8a1ad 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildPhase import EbuildPhase
@@ -104,6 +104,10 @@ class Binpkg(CompositeTask):
 
 	def _prefetch_exit(self, prefetcher):
 
+		if self._was_cancelled():
+			self.wait()
+			return
+
 		pkg = self.pkg
 		pkg_count = self.pkg_count
 		if not (self.opts.pretend or self.opts.fetchonly):

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 6e37cda..27aa7ca 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildExecuter import EbuildExecuter
@@ -107,6 +107,10 @@ class EbuildBuild(CompositeTask):
 
 	def _prefetch_exit(self, prefetcher):
 
+		if self._was_cancelled():
+			self.wait()
+			return
+
 		opts = self.opts
 		pkg = self.pkg
 		settings = self.settings



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-09  6:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-09  6:35 UTC (permalink / raw
  To: gentoo-commits

commit:     c0177a6e01e0919164f373c3cc130a265e8cf27c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  9 06:35:43 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar  9 06:35:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0177a6e

install-info: avoid unnecessary shell

---
 pym/_emerge/main.py |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 45ca6f5..c1adced 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -6,6 +6,7 @@ from __future__ import print_function
 import logging
 import signal
 import stat
+import subprocess
 import sys
 import textwrap
 import platform
@@ -179,11 +180,21 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
 									raise
 								del e
 					processed_count += 1
-					myso = portage.subprocess_getstatusoutput(
-						"LANG=C LANGUAGE=C /usr/bin/install-info " +
-						"--dir-file=%s/dir %s/%s" % (inforoot, inforoot, x))[1]
+					try:
+						proc = subprocess.Popen(
+							['/usr/bin/install-info',
+							'--dir-file=%s' % os.path.join(inforoot, "dir"),
+							os.path.join(inforoot, x)],
+							env=dict(os.environ, LANG="C", LANGUAGE="C"),
+							stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+					except OSError:
+						myso = None
+					else:
+						myso = _unicode_decode(
+							proc.communicate()[0]).rstrip("\n")
+						proc.wait()
 					existsstr="already exists, for file `"
-					if myso!="":
+					if myso:
 						if re.search(existsstr,myso):
 							# Already exists... Don't increment the count for this.
 							pass



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-19 16:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-19 16:29 UTC (permalink / raw
  To: gentoo-commits

commit:     884993c7f4b9e7e9ede690f5fab81742915fc942
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 19 16:29:29 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 19 16:29:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=884993c7

depgraph: reset pkgsettings after setcpv

This should prevent doebuild_environment from incorrectly using the
CATEGORY from the previous setcpv call, as reported in bug #408817.

---
 pym/_emerge/depgraph.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e4310b4..4d1bc33 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4075,6 +4075,7 @@ class depgraph(object):
 						forced_flags = set()
 						forced_flags.update(pkgsettings.useforce)
 						forced_flags.update(pkgsettings.usemask)
+						pkgsettings.reset()
 						cur_iuse = iuses
 						if myeb and not usepkgonly and not useoldpkg:
 							cur_iuse = myeb.iuse.all



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-19 17:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-19 17:07 UTC (permalink / raw
  To: gentoo-commits

commit:     a2b5e7cff4e0cee92491c750179520a6fb30b14d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 19 17:06:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 19 17:06:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2b5e7cf

Revert "depgraph: reset pkgsettings after setcpv"

This reverts commit 884993c7f4b9e7e9ede690f5fab81742915fc942.
Calling reset is expensive and is not really needed since commit
3ca5f0cc08d233a3e229e78b573c7aab7d46cb9c.

---
 pym/_emerge/depgraph.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4d1bc33..e4310b4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4075,7 +4075,6 @@ class depgraph(object):
 						forced_flags = set()
 						forced_flags.update(pkgsettings.useforce)
 						forced_flags.update(pkgsettings.usemask)
-						pkgsettings.reset()
 						cur_iuse = iuses
 						if myeb and not usepkgonly and not useoldpkg:
 							cur_iuse = myeb.iuse.all



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-21  7:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-21  7:18 UTC (permalink / raw
  To: gentoo-commits

commit:     500e0567432019835ef56e69d60266f9189c6700
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 21 07:16:54 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 21 07:16:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=500e0567

Map emerge --buildpkg=n to FEATURES=-buildpkg.

This will fix bug #409085.

---
 pym/_emerge/EbuildBuild.py |    5 +++--
 pym/_emerge/Scheduler.py   |    2 +-
 pym/_emerge/actions.py     |    5 ++++-
 pym/_emerge/main.py        |    2 --
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 27aa7ca..784a3e2 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -228,9 +228,10 @@ class EbuildBuild(CompositeTask):
 		#buildsyspkg: Check if we need to _force_ binary package creation
 		self._issyspkg = "buildsyspkg" in features and \
 				system_set.findAtomForPackage(pkg) and \
-				not opts.buildpkg
+				"buildpkg" not in features and \
+				opts.buildpkg != 'n'
 
-		if (opts.buildpkg or "buildpkg" in features or self._issyspkg) \
+		if ("buildpkg" in features or self._issyspkg) \
 			and not self.opts.buildpkg_exclude.findAtomForPackage(pkg):
 
 			self._buildpkg = True

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 62b3589..bde6cf3 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -155,7 +155,7 @@ class Scheduler(PollScheduler):
 		self._build_opts = self._build_opts_class()
 
 		for k in self._build_opts.__slots__:
-			setattr(self._build_opts, k, "--" + k.replace("_", "-") in myopts)
+			setattr(self._build_opts, k, myopts.get("--" + k.replace("_", "-")))
 		self._build_opts.buildpkg_exclude = InternalPackageSet( \
 			initial_atoms=" ".join(myopts.get("--buildpkg-exclude", [])).split(), \
 			allow_wildcard=True, allow_repo=True)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 090d9e1..cd3fd9f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2727,8 +2727,11 @@ def adjust_config(myopts, settings):
 	settings["EMERGE_WARNING_DELAY"] = str(EMERGE_WARNING_DELAY)
 	settings.backup_changes("EMERGE_WARNING_DELAY")
 
-	if "--buildpkg" in myopts:
+	buildpkg = myopts.get("--buildpkg")
+	if buildpkg is True:
 		settings.features.add("buildpkg")
+	elif buildpkg == 'n':
+		settings.features.discard("buildpkg")
 
 	if "--quiet" in myopts:
 		settings["PORTAGE_QUIET"]="1"

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index c1adced..cf5f332 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1005,8 +1005,6 @@ def parse_opts(tmpcmdline, silent=False):
 
 	if myoptions.buildpkg in true_y:
 		myoptions.buildpkg = True
-	else:
-		myoptions.buildpkg = None
 
 	if myoptions.buildpkg_exclude:
 		bad_atoms = _find_bad_atoms(myoptions.buildpkg_exclude, less_strict=True)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-25 21:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-25 21:48 UTC (permalink / raw
  To: gentoo-commits

commit:     42ae47a871f674027147d3885a466c0a0effd998
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 25 21:48:25 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 25 21:48:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=42ae47a8

emerge --sync: use yellow for portage update msg

---
 pym/_emerge/actions.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index cd3fd9f..e9d6bd6 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -40,6 +40,7 @@ from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
 	red, yellow
 good = create_color_func("GOOD")
 bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.package.ebuild._ipc.QueryCommand import QueryCommand
 from portage.package.ebuild.doebuild import _check_temp_dir
 from portage._sets import load_default_config, SETPREFIX
@@ -2510,10 +2511,10 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 
 	if(mybestpv != mypvs) and not "--quiet" in myopts:
 		print()
-		print(red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended")
-		print(red(" * ")+"that you update portage now, before any other packages are updated.")
+		print(warn(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended")
+		print(warn(" * ")+"that you update portage now, before any other packages are updated.")
 		print()
-		print(red(" * ")+"To update portage, run 'emerge portage' now.")
+		print(warn(" * ")+"To update portage, run 'emerge portage' now.")
 		print()
 
 	display_news_notification(root_config, myopts)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-26  3:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-26  3:49 UTC (permalink / raw
  To: gentoo-commits

commit:     774f387710bfcd14ffb270375bce3b310c2609ee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 26 03:49:47 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 26 03:49:47 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=774f3877

unmerge: fix return code for bug #409647

---
 pym/_emerge/actions.py |   10 +++-------
 pym/_emerge/unmerge.py |   11 ++++++-----
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 0fb4944..afb62bb 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -586,12 +586,9 @@ def action_depclean(settings, trees, ldpath_mtimes,
 		return rval
 
 	if cleanlist:
-		if unmerge(root_config, myopts, "unmerge",
+		rval = unmerge(root_config, myopts, "unmerge",
 			cleanlist, ldpath_mtimes, ordered=ordered,
-			scheduler=scheduler):
-			rval = os.EX_OK
-		else:
-			rval = 1
+			scheduler=scheduler)
 
 	if action == "prune":
 		return rval
@@ -2674,10 +2671,9 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 		(action == 'prune' and "--nodeps" in opts):
 		# When given a list of atoms, unmerge them in the order given.
 		ordered = action == 'unmerge'
-		unmerge(trees[settings['EROOT']]['root_config'], opts, action,
+		rval = unmerge(trees[settings['EROOT']]['root_config'], opts, action,
 			valid_atoms, ldpath_mtimes, ordered=ordered,
 			scheduler=sched._sched_iface)
-		rval = os.EX_OK
 	else:
 		rval = action_depclean(settings, trees, ldpath_mtimes,
 			opts, action, valid_atoms, spinner, scheduler=sched._sched_iface)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index c76afdf..c8a7e55 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -503,7 +503,8 @@ def unmerge(root_config, myopts, unmerge_action,
 	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.
+	Returns os.EX_OK if no errors occur, 1 if an error occurrs, and
+	130 if interrupted due to a 'no' answer for --ask.
 	"""
 
 	if clean_world:
@@ -515,7 +516,7 @@ def unmerge(root_config, myopts, unmerge_action,
 		writemsg_level=writemsg_level)
 
 	if rval != os.EX_OK:
-		return 0
+		return rval
 
 	enter_invalid = '--ask-enter-invalid' in myopts
 	vartree = root_config.trees["vartree"]
@@ -526,7 +527,7 @@ def unmerge(root_config, myopts, unmerge_action,
 
 	if "--pretend" in myopts:
 		#we're done... return
-		return 1
+		return os.EX_OK
 	if "--ask" in myopts:
 		if userquery("Would you like to unmerge these packages?",
 			enter_invalid) == "No":
@@ -535,7 +536,7 @@ def unmerge(root_config, myopts, unmerge_action,
 			print()
 			print("Quitting.")
 			print()
-			return 0
+			return 128 + signal.SIGINT
 	#the real unmerging begins, after a short delay....
 	if clean_delay and not autoclean:
 		countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging")
@@ -574,5 +575,5 @@ def unmerge(root_config, myopts, unmerge_action,
 			sets["selected"].remove(SETPREFIX + s)
 		sets["selected"].unlock()
 
-	return 1
+	return os.EX_OK
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-26  3:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-26  3:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4e2abb474f0fc624c51948f0939e3123f6382992
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 26 03:49:47 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 26 03:53:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4e2abb47

unmerge: fix return code for bug #409647

---
 pym/_emerge/actions.py |   10 +++-------
 pym/_emerge/unmerge.py |   14 ++++++++------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 0fb4944..afb62bb 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -586,12 +586,9 @@ def action_depclean(settings, trees, ldpath_mtimes,
 		return rval
 
 	if cleanlist:
-		if unmerge(root_config, myopts, "unmerge",
+		rval = unmerge(root_config, myopts, "unmerge",
 			cleanlist, ldpath_mtimes, ordered=ordered,
-			scheduler=scheduler):
-			rval = os.EX_OK
-		else:
-			rval = 1
+			scheduler=scheduler)
 
 	if action == "prune":
 		return rval
@@ -2674,10 +2671,9 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 		(action == 'prune' and "--nodeps" in opts):
 		# When given a list of atoms, unmerge them in the order given.
 		ordered = action == 'unmerge'
-		unmerge(trees[settings['EROOT']]['root_config'], opts, action,
+		rval = unmerge(trees[settings['EROOT']]['root_config'], opts, action,
 			valid_atoms, ldpath_mtimes, ordered=ordered,
 			scheduler=sched._sched_iface)
-		rval = os.EX_OK
 	else:
 		rval = action_depclean(settings, trees, ldpath_mtimes,
 			opts, action, valid_atoms, spinner, scheduler=sched._sched_iface)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index c76afdf..0acdf99 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -1,9 +1,10 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
 import logging
+import signal
 import sys
 import textwrap
 import portage
@@ -503,7 +504,8 @@ def unmerge(root_config, myopts, unmerge_action,
 	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.
+	Returns os.EX_OK if no errors occur, 1 if an error occurs, and
+	130 if interrupted due to a 'no' answer for --ask.
 	"""
 
 	if clean_world:
@@ -515,7 +517,7 @@ def unmerge(root_config, myopts, unmerge_action,
 		writemsg_level=writemsg_level)
 
 	if rval != os.EX_OK:
-		return 0
+		return rval
 
 	enter_invalid = '--ask-enter-invalid' in myopts
 	vartree = root_config.trees["vartree"]
@@ -526,7 +528,7 @@ def unmerge(root_config, myopts, unmerge_action,
 
 	if "--pretend" in myopts:
 		#we're done... return
-		return 1
+		return os.EX_OK
 	if "--ask" in myopts:
 		if userquery("Would you like to unmerge these packages?",
 			enter_invalid) == "No":
@@ -535,7 +537,7 @@ def unmerge(root_config, myopts, unmerge_action,
 			print()
 			print("Quitting.")
 			print()
-			return 0
+			return 128 + signal.SIGINT
 	#the real unmerging begins, after a short delay....
 	if clean_delay and not autoclean:
 		countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging")
@@ -574,5 +576,5 @@ def unmerge(root_config, myopts, unmerge_action,
 			sets["selected"].remove(SETPREFIX + s)
 		sets["selected"].unlock()
 
-	return 1
+	return os.EX_OK
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-27 15:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-27 15:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c00f2636efb087f844c23e1196da825bf172c9ff
Author:     Greg Turner <gmturner007 <AT> ameritech <DOT> net>
AuthorDate: Tue Mar 27 15:32:56 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 27 15:32:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c00f2636

Localize config update messages, bug #409835.

---
 pym/_emerge/actions.py |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index afb62bb..22c3e26 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -25,6 +25,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 	'portage.news:count_unread_news,display_news_notifications',
 )
 
+from portage.localization import _
 from portage import os
 from portage import shutil
 from portage import _unicode_decode
@@ -3016,26 +3017,27 @@ def chk_updated_cfg_files(eroot, config_protect):
 		portage.util.find_updated_config_files(target_root, config_protect))
 
 	for x in result:
-		writemsg_level("\n %s " % (colorize("WARN", "* IMPORTANT:"),),
+		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],
+			writemsg_level( _("config file '%s' needs updating.\n") % x[0],
 				level=logging.INFO, noiselevel=-1)
 		else: # it's a protected dir
 			if len(x[1]) == 1:
 				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,
+				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" % \
+				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")\
-				+ " section of the " + bold("emerge"))
-		print(" "+yellow("*")+" man page to learn how to update config files.")
+		print(" "+yellow("*")+ " See the "+colorize("INFORM", _("CONFIGURATION FILES"))\
+				+ " " + _("section of the") + " " + bold("emerge"))
+		print(" "+yellow("*")+ " " + _("man page to learn how to update config files."))
+
 
 def display_news_notification(root_config, myopts):
 	if "news" not in root_config.settings.features:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-03-27 18:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-03-27 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     ea26df1ef9b3dcb7a6a45b487342cc7149a77be5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 27 18:56:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 27 18:56:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ea26df1e

emerge: suggest dispatch-conf for bug #398843

---
 pym/_emerge/depgraph.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 072a5ea..c01dc72 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -6143,7 +6143,7 @@ class depgraph(object):
 				if protect_obj[root].isprotected(file_to_write_to):
 					# We want to force new_protect_filename to ensure
 					# that the user will see all our changes via
-					# etc-update, even if file_to_write_to doesn't
+					# dispatch-conf, even if file_to_write_to doesn't
 					# exist yet, so we specify force=True.
 					file_to_write_to = new_protect_filename(file_to_write_to,
 						force=True)
@@ -6197,7 +6197,7 @@ class depgraph(object):
 				noiselevel=-1)
 			writemsg_stdout("".join(problems), noiselevel=-1)
 		elif write_to_file and roots:
-			writemsg_stdout("\nAutounmask changes successfully written. Remember to run etc-update.\n", \
+			writemsg_stdout("\nAutounmask changes successfully written. Remember to run dispatch-conf.\n", \
 				noiselevel=-1)
 		elif not pretend and not autounmask_write and roots:
 			writemsg_stdout("\nUse --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).\n", \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-03 17:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-03 17:57 UTC (permalink / raw
  To: gentoo-commits

commit:     784c94ac3520a1fe0659be53fab07becaad6274b
Author:     Boris Minev <borisminev <AT> abv <DOT> bg>
AuthorDate: Tue Apr  3 17:56:48 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr  3 17:56:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=784c94ac

unmerge: display progress counter, bug #386901

---
 pym/_emerge/unmerge.py |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 0acdf99..89eae08 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -542,10 +542,23 @@ def unmerge(root_config, myopts, unmerge_action,
 	if clean_delay and not autoclean:
 		countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging")
 
+	all_selected = set()
+	all_selected.update(*[x["selected"] for x in pkgmap])
+
+	# Set counter variables
+	curval = 1
+	maxval = len(all_selected)
+
 	for x in range(len(pkgmap)):
 		for y in pkgmap[x]["selected"]:
-			writemsg_level(">>> Unmerging "+y+"...\n", noiselevel=-1)
 			emergelog(xterm_titles, "=== Unmerging... ("+y+")")
+			message = ">>> Unmerging ({0} of {1}) {2}...\n".format(
+				colorize("MERGE_LIST_PROGRESS", str(curval)),
+				colorize("MERGE_LIST_PROGRESS", str(maxval)),
+				y)
+			writemsg_level(message, noiselevel=-1)
+			curval += 1
+
 			mysplit = y.split("/")
 			#unmerge...
 			retval = portage.unmerge(mysplit[0], mysplit[1],



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-05 18:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-05 18:09 UTC (permalink / raw
  To: gentoo-commits

commit:     a9de7a29a25c876caab34b288cf87629514c7ac2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  5 18:08:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr  5 18:08:52 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a9de7a29

depgraph._load_vdb: optimize --root-deps

---
 pym/_emerge/depgraph.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index c01dc72..b7fa297 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -519,6 +519,10 @@ class depgraph(object):
 			preload_installed_pkgs = \
 				"--nodeps" not in self._frozen_config.myopts
 
+			if self._frozen_config.myopts.get("--root-deps") is not None and \
+				myroot != self._frozen_config.target_root:
+				continue
+
 			fake_vartree = self._frozen_config.trees[myroot]["vartree"]
 			if not fake_vartree.dbapi:
 				# This needs to be called for the first depgraph, but not for



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-05 18:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-05 18:23 UTC (permalink / raw
  To: gentoo-commits

commit:     e9740bcd93e01633695dee32425d1bab38e607c7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  5 18:22:49 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr  5 18:22:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9740bcd

depgraph._validate_blockers: optimize --root-deps

---
 pym/_emerge/depgraph.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b7fa297..e9cb22b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4470,6 +4470,11 @@ class depgraph(object):
 			# are already built.
 			dep_keys = ["RDEPEND", "PDEPEND"]
 			for myroot in self._frozen_config.trees:
+
+				if self._frozen_config.myopts.get("--root-deps") is not None and \
+					myroot != self._frozen_config.target_root:
+					continue
+
 				vardb = self._frozen_config.trees[myroot]["vartree"].dbapi
 				pkgsettings = self._frozen_config.pkgsettings[myroot]
 				root_config = self._frozen_config.roots[myroot]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-05 18:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-05 18:53 UTC (permalink / raw
  To: gentoo-commits

commit:     001b0184cf72159a7d3c57501eb685205481ad3f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  5 18:52:51 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr  5 18:52:51 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=001b0184

Scheduler: optimize action_uninstall

---
 pym/_emerge/Scheduler.py |    6 +++++-
 pym/_emerge/actions.py   |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 8d6ab9f..5500acf 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -135,7 +135,8 @@ class Scheduler(PollScheduler):
 			portage.exception.PortageException.__init__(self, value)
 
 	def __init__(self, settings, trees, mtimedb, myopts,
-		spinner, mergelist=None, favorites=None, graph_config=None):
+		spinner, mergelist=None, favorites=None, graph_config=None,
+		uninstall_only=False):
 		PollScheduler.__init__(self)
 
 		if mergelist is not None:
@@ -151,6 +152,7 @@ class Scheduler(PollScheduler):
 		self._spinner = spinner
 		self._mtimedb = mtimedb
 		self._favorites = favorites
+		self._uninstall_only = uninstall_only
 		self._args_set = InternalPackageSet(favorites, allow_repo=True)
 		self._build_opts = self._build_opts_class()
 
@@ -327,6 +329,8 @@ class Scheduler(PollScheduler):
 		self._blocker_db = {}
 		dynamic_deps = self.myopts.get("--dynamic-deps", "y") != "n"
 		for root in self.trees:
+			if self._uninstall_only:
+				continue
 			if graph_config is None:
 				fake_vartree = FakeVartree(self.trees[root]["root_config"],
 					pkg_cache=self._pkg_cache, dynamic_deps=dynamic_deps)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 22c3e26..9c87120 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2657,7 +2657,7 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 	# redirection of ebuild phase output to logs as required for
 	# options such as --quiet.
 	sched = Scheduler(settings, trees, None, opts,
-		spinner)
+		spinner, uninstall_only=True)
 	sched._background = sched._background_mode()
 	sched._status_display.quiet = True
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-05 21:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-05 21:37 UTC (permalink / raw
  To: gentoo-commits

commit:     f241cdb50b0f8a448216a1e5155dba8d0abddf56
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  5 21:37:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr  5 21:37:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f241cdb5

depgraph._complete_graph: fix for --root-deps

---
 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 e9cb22b..e77c0e8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4329,7 +4329,8 @@ class depgraph(object):
 		args = self._dynamic_config._initial_arg_list[:]
 		for root in self._frozen_config.roots:
 			if root != self._frozen_config.target_root and \
-				"remove" in self._dynamic_config.myparams:
+				("remove" in self._dynamic_config.myparams or
+				self._frozen_config.myopts.get("--root-deps") is not None):
 				# Only pull in deps for the relevant root.
 				continue
 			depgraph_sets = self._dynamic_config.sets[root]



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-13 19:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-13 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     54597d1ce55bd3d67c22a1cc5c7e915a02406477
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 13 19:30:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 13 19:30:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=54597d1c

EbuildBinpkg: remove temp file on failure

---
 pym/_emerge/EbuildBinpkg.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildBinpkg.py b/pym/_emerge/EbuildBinpkg.py
index b7d43ba..34a6aef 100644
--- a/pym/_emerge/EbuildBinpkg.py
+++ b/pym/_emerge/EbuildBinpkg.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.CompositeTask import CompositeTask
@@ -34,6 +34,10 @@ class EbuildBinpkg(CompositeTask):
 
 		self.settings.pop("PORTAGE_BINPKG_TMPFILE", None)
 		if self._default_exit(package_phase) != os.EX_OK:
+			try:
+				os.unlink(self._binpkg_tmpfile)
+			except OSError:
+				pass
 			self.wait()
 			return
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-16  7:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-16  7:17 UTC (permalink / raw
  To: gentoo-commits

commit:     b61f053253076873e7c181e4cfad2038aa6f7283
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 16 07:15:56 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 16 07:15:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b61f0532

Avoid redundant news display for bug #412161.

---
 pym/_emerge/main.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 0fbc4b7..7fbe84f 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -381,7 +381,9 @@ def post_emerge(myaction, myopts, myfiles,
 	_flush_elog_mod_echo()
 
 	if not vardbapi._pkgs_changed:
-		display_news_notification(root_config, myopts)
+		# GLEP 42 says to display news *after* an emerge --pretend
+		if "--pretend" in myopts:
+			display_news_notification(root_config, myopts)
 		# If vdb state has not changed then there's nothing else to do.
 		return
 
@@ -2033,6 +2035,7 @@ def emerge_main(args=None):
 				level=logging.ERROR, noiselevel=-1)
 			return 1
 
+		# GLEP 42 says to display news *after* an emerge --pretend
 		if "--pretend" not in myopts:
 			display_news_notification(root_config, myopts)
 		retval = action_build(settings, trees, mtimedb,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-04-21  1:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-04-21  1:02 UTC (permalink / raw
  To: gentoo-commits

commit:     92a8357ca98d4a42e7747abd2cf4b390381fc6bc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 01:01:30 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 21 01:01:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=92a8357c

Show config updates later for bug #412845.

---
 pym/_emerge/main.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 7fbe84f..c52a3ea 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -404,11 +404,10 @@ def post_emerge(myaction, myopts, myfiles,
 			if vdb_lock:
 				vardbapi.unlock()
 
+	display_preserved_libs(vardbapi, myopts)
 	chk_updated_cfg_files(settings['EROOT'], config_protect)
 
 	display_news_notification(root_config, myopts)
-	if retval in (None, os.EX_OK) or (not "--pretend" in myopts):
-		display_preserved_libs(vardbapi, myopts)	
 
 	postemerge = os.path.join(settings["PORTAGE_CONFIGROOT"],
 		portage.USER_CONFIG_PATH, "bin", "post_emerge")



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-03  1:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-03  1:32 UTC (permalink / raw
  To: gentoo-commits

commit:     e9ba65f66dbc59b89d6133b8a909f58fa41bf760
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May  3 01:32:33 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May  3 01:32:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9ba65f6

composite_db._visible: fix AttributeError

---
 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 e624559..dfc9be9 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6858,7 +6858,7 @@ class _dep_check_composite_db(dbapi):
 			# Note: highest_visible is not necessarily the real highest
 			# visible, especially when --update is not enabled, so use
 			# < operator instead of !=.
-			if pkg < highest_visible:
+			if highest_visible is not None and pkg < highest_visible:
 				return False
 		elif in_graph != pkg:
 			# Mask choices for packages that would trigger a slot



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-09 18:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-09 18:11 UTC (permalink / raw
  To: gentoo-commits

commit:     92b45cbc29b3375a96c404f3ff46bcf389e85943
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  9 18:10:56 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  9 18:10:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=92b45cbc

Show unsatisfied REQUIRED_USE for bug #415125.

---
 pym/_emerge/depgraph.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index dfc9be9..2df29f7 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1117,7 +1117,8 @@ class depgraph(object):
 				if atom is None:
 					atom = Atom("=" + pkg.cpv)
 				self._dynamic_config._unsatisfied_deps_for_display.append(
-					((pkg.root, atom), {"myparent":dep.parent}))
+					((pkg.root, atom),
+					{"myparent" : dep.parent, "show_req_use" : pkg}))
 				self._dynamic_config._skip_restart = True
 				return 0
 
@@ -2928,7 +2929,7 @@ class depgraph(object):
 
 
 	def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None,
-		check_backtrack=False, check_autounmask_breakage=False):
+		check_backtrack=False, check_autounmask_breakage=False, show_req_use=None):
 		"""
 		When check_backtrack=True, no output is produced and
 		the method either returns or raises _backtrack_mask if
@@ -3209,12 +3210,16 @@ class depgraph(object):
 
 		mask_docs = False
 
-		if required_use_unsatisfied:
+		if show_req_use is None and required_use_unsatisfied:
 			# We have an unmasked package that only requires USE adjustment
 			# in order to satisfy REQUIRED_USE, and nothing more. We assume
 			# that the user wants the latest version, so only the first
 			# instance is displayed.
-			pkg = required_use_unsatisfied[0]
+			show_req_use = required_use_unsatisfied[0]
+
+		if show_req_use is not None:
+
+			pkg = show_req_use
 			output_cpv = pkg.cpv + _repo_separator + pkg.repo
 			writemsg_stdout("\n!!! " + \
 				colorize("BAD", "The ebuild selected to satisfy ") + \



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-09 20:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-09 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     caceafbca156fdd1e5cc64d1e24a6bdc39022945
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  9 20:31:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  9 20:31:52 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=caceafbc

EbuildMetadataPhase: handle empty EAPI from bash

---
 pym/_emerge/EbuildMetadataPhase.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index b7af69d..7f9bd3b 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -158,7 +158,8 @@ class EbuildMetadataPhase(SubProcess):
 				parsed_eapi = self._eapi
 				if parsed_eapi is None:
 					parsed_eapi = "0"
-				if portage.eapi_is_supported(metadata["EAPI"]) and \
+				if (not metadata["EAPI"] or
+					portage.eapi_is_supported(metadata["EAPI"])) and \
 					metadata["EAPI"] != parsed_eapi:
 					self._eapi_invalid(metadata)
 					if 'parse-eapi-ebuild-head' in self.settings.features:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-13  7:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-13  7:32 UTC (permalink / raw
  To: gentoo-commits

commit:     0903cf2a1544d970b286a3e7e1f3276daa4eab9c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 13 07:32:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 13 07:32:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0903cf2a

depgraph: minimize match_from_list operations

In _iter_match_pkgs, call match_from_list on one cpv at a time, in
order to avoid unnecessary match_from_list comparisons on versions that
are never yielded from this method.

---
 pym/_emerge/depgraph.py |  122 ++++++++++++++++++++++++----------------------
 1 files changed, 64 insertions(+), 58 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4d3b04c..5152d5c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -18,8 +18,10 @@ from portage import os, OrderedDict
 from portage import _unicode_decode, _unicode_encode, _encodings
 from portage.const import PORTAGE_PACKAGE_ATOM, USER_CONFIG_PATH
 from portage.dbapi import dbapi
+from portage.dbapi.dep_expand import dep_expand
 from portage.dep import Atom, best_match_to_list, extract_affecting_use, \
-	check_required_use, human_readable_required_use, _repo_separator
+	check_required_use, human_readable_required_use, match_from_list, \
+	_repo_separator
 from portage.eapi import eapi_has_strong_blocks, eapi_has_required_use
 from portage.exception import InvalidAtom, InvalidDependString, PortageException
 from portage.output import colorize, create_color_func, \
@@ -3382,60 +3384,12 @@ class depgraph(object):
 		"""
 
 		db = root_config.trees[self.pkg_tree_map[pkg_type]].dbapi
-
-		if hasattr(db, "xmatch"):
-			# For portdbapi we match only against the cpv, in order
-			# to bypass unnecessary cache access for things like IUSE
-			# and SLOT. Later, we cache the metadata in a Package
-			# instance, and use that for further matching. This
-			# optimization is especially relevant since
-			# pordbapi.aux_get() does not cache calls that have
-			# myrepo or mytree arguments.
-			cpv_list = db.xmatch("match-all-cpv-only", atom)
-		else:
-			cpv_list = db.match(atom)
-
-		# USE=multislot can make an installed package appear as if
-		# it doesn't satisfy a slot dependency. Rebuilding the ebuild
-		# won't do any good as long as USE=multislot is enabled since
-		# the newly built package still won't have the expected slot.
-		# Therefore, assume that such SLOT dependencies are already
-		# satisfied rather than forcing a rebuild.
+		atom_exp = dep_expand(atom, mydb=db, settings=root_config.settings)
+		cp_list = db.cp_list(atom_exp.cp)
+		matched_something = False
 		installed = pkg_type == 'installed'
-		if installed and not cpv_list and atom.slot:
 
-			if "remove" in self._dynamic_config.myparams:
-				# We need to search the portdbapi, which is not in our
-				# normal dbs list, in order to find the real SLOT.
-				portdb = self._frozen_config.trees[root_config.root]["porttree"].dbapi
-				db_keys = list(portdb._aux_cache_keys)
-				dbs = [(portdb, "ebuild", False, False, db_keys)]
-			else:
-				dbs = self._dynamic_config._filtered_trees[root_config.root]["dbs"]
-
-			for cpv in db.match(atom.cp):
-				slot_available = False
-				for other_db, other_type, other_built, \
-					other_installed, other_keys in dbs:
-					try:
-						if atom.slot == \
-							other_db.aux_get(cpv, ["SLOT"])[0]:
-							slot_available = True
-							break
-					except KeyError:
-						pass
-				if not slot_available:
-					continue
-				inst_pkg = self._pkg(cpv, "installed",
-					root_config, installed=installed, myrepo = atom.repo)
-				# Remove the slot from the atom and verify that
-				# the package matches the resulting atom.
-				if portage.match_from_list(
-					atom.without_slot, [inst_pkg]):
-					yield inst_pkg
-					return
-
-		if cpv_list:
+		if cp_list:
 			atom_set = InternalPackageSet(initial_atoms=(atom,),
 				allow_repo=True)
 			if atom.repo is None and hasattr(db, "getRepositories"):
@@ -3444,8 +3398,13 @@ class depgraph(object):
 				repo_list = [atom.repo]
 
 			# descending order
-			cpv_list.reverse()
-			for cpv in cpv_list:
+			cp_list.reverse()
+			for cpv in cp_list:
+				# Call match_from_list on one cpv at a time, in order
+				# to avoid unnecessary match_from_list comparisons on
+				# versions that are never yielded from this method.
+				if not match_from_list(atom_exp, [cpv]):
+					continue
 				for repo in repo_list:
 
 					try:
@@ -3462,14 +3421,61 @@ class depgraph(object):
 						# Make sure that cpv from the current repo satisfies the atom.
 						# This might not be the case if there are several repos with
 						# the same cpv, but different metadata keys, like SLOT.
-						# Also, for portdbapi, parts of the match that require
-						# metadata access are deferred until we have cached the
-						# metadata in a Package instance.
+						# Also, parts of the match that require metadata access
+						# are deferred until we have cached the metadata in a
+						# Package instance.
 						if not atom_set.findAtomForPackage(pkg,
 							modified_use=self._pkg_use_enabled(pkg)):
 							continue
+						matched_something = True
 						yield pkg
 
+		# USE=multislot can make an installed package appear as if
+		# it doesn't satisfy a slot dependency. Rebuilding the ebuild
+		# won't do any good as long as USE=multislot is enabled since
+		# the newly built package still won't have the expected slot.
+		# Therefore, assume that such SLOT dependencies are already
+		# satisfied rather than forcing a rebuild.
+		if not matched_something and installed and atom.slot is not None:
+
+			if "remove" in self._dynamic_config.myparams:
+				# We need to search the portdbapi, which is not in our
+				# normal dbs list, in order to find the real SLOT.
+				portdb = self._frozen_config.trees[root_config.root]["porttree"].dbapi
+				db_keys = list(portdb._aux_cache_keys)
+				dbs = [(portdb, "ebuild", False, False, db_keys)]
+			else:
+				dbs = self._dynamic_config._filtered_trees[root_config.root]["dbs"]
+
+			cp_list = db.cp_list(atom_exp.cp)
+			if cp_list:
+				atom_set = InternalPackageSet(
+					initial_atoms=(atom.without_slot,), allow_repo=True)
+				atom_exp_without_slot = atom_exp.without_slot
+				cp_list.reverse()
+				for cpv in cp_list:
+					if not match_from_list(atom_exp_without_slot, [cpv]):
+						continue
+					slot_available = False
+					for other_db, other_type, other_built, \
+						other_installed, other_keys in dbs:
+						try:
+							if atom.slot == \
+								other_db.aux_get(cpv, ["SLOT"])[0]:
+								slot_available = True
+								break
+						except KeyError:
+							pass
+					if not slot_available:
+						continue
+					inst_pkg = self._pkg(cpv, "installed",
+						root_config, installed=installed, myrepo=atom.repo)
+					# Remove the slot from the atom and verify that
+					# the package matches the resulting atom.
+					if atom_set.findAtomForPackage(inst_pkg):
+						yield inst_pkg
+						return
+
 	def _select_pkg_highest_available(self, root, atom, onlydeps=False):
 		cache_key = (root, atom, atom.unevaluated_atom, onlydeps)
 		ret = self._dynamic_config._highest_pkg_cache.get(cache_key)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-13 22:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-13 22:35 UTC (permalink / raw
  To: gentoo-commits

commit:     a5152139f76cdf605a26aa286c8fa2383bef8738
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 13 22:35:16 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 13 22:35:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a5152139

unmerge: use cpv_sort_key instead of pkgcmp

---
 pym/_emerge/unmerge.py |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 89eae08..b46b89c 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -13,7 +13,7 @@ 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 portage.versions import cpv_sort_key, _pkg_str
 
 from _emerge.emergelog import emergelog
 from _emerge.Package import Package
@@ -468,20 +468,22 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 			if not quiet:
 				writemsg_level((mytype + ": ").rjust(14), noiselevel=-1)
 			if pkgmap[x][mytype]:
-				sorted_pkgs = [portage.catpkgsplit(mypkg)[1:] for mypkg in pkgmap[x][mytype]]
-				sorted_pkgs.sort(key=cmp_sort_key(portage.pkgcmp))
-				for pn, ver, rev in sorted_pkgs:
-					if rev == "r0":
-						myversion = ver
-					else:
-						myversion = ver + "-" + rev
+				sorted_pkgs = []
+				for mypkg in pkgmap[x][mytype]:
+					try:
+						sorted_pkgs.append(mypkg.cpv)
+					except AttributeError:
+						sorted_pkgs.append(_pkg_str(mypkg))
+				sorted_pkgs.sort(key=cpv_sort_key())
+				for mypkg in sorted_pkgs:
 					if mytype == "selected":
 						writemsg_level(
-							colorize("UNMERGE_WARN", myversion + " "),
+							colorize("UNMERGE_WARN", mypkg.version + " "),
 							noiselevel=-1)
 					else:
 						writemsg_level(
-							colorize("GOOD", myversion + " "), noiselevel=-1)
+							colorize("GOOD", mypkg.version + " "),
+							noiselevel=-1)
 			else:
 				writemsg_level("none ", noiselevel=-1)
 			if not quiet:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-14  6:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-14  6:28 UTC (permalink / raw
  To: gentoo-commits

commit:     2dc778ce4b8590fb57dcc59508b3babda8513c87
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 06:28:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 14 06:28:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2dc778ce

BlockerCache: use _unicode() for pickled atoms

---
 pym/_emerge/BlockerCache.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/BlockerCache.py b/pym/_emerge/BlockerCache.py
index 3ec63ce..fce81f8 100644
--- a/pym/_emerge/BlockerCache.py
+++ b/pym/_emerge/BlockerCache.py
@@ -162,8 +162,8 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
 		@param blocker_data: An object with counter and atoms attributes.
 		@type blocker_data: BlockerData
 		"""
-		self._cache_data["blockers"][_unicode(cpv)] = \
-			(blocker_data.counter, tuple(str(x) for x in blocker_data.atoms))
+		self._cache_data["blockers"][_unicode(cpv)] = (blocker_data.counter,
+			tuple(_unicode(x) for x in blocker_data.atoms))
 		self._modified.add(cpv)
 
 	def __iter__(self):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-14 18:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-14 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     2ec3f2d22da444fc8c40370ed2be64d39db8c9e2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 18:48:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 14 18:48:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2ec3f2d2

depgraph: send output to stderr when appropriate

This also removes the stderr -> stdout redirect from display_problems,
since the app-portage/autounmask program is no longer supported, and
that will fix bug #406867.

---
 pym/_emerge/depgraph.py |  118 +++++++++++++++++++----------------------------
 1 files changed, 48 insertions(+), 70 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5152d5c..572cea7 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -615,7 +615,7 @@ class depgraph(object):
 		for line in msg:
 			if line:
 				line = colorize("INFORM", line)
-			writemsg_stdout(line + "\n", noiselevel=-1)
+			writemsg(line + "\n", noiselevel=-1)
 
 	def _show_missed_update(self):
 
@@ -3223,55 +3223,55 @@ class depgraph(object):
 
 			pkg = show_req_use
 			output_cpv = pkg.cpv + _repo_separator + pkg.repo
-			writemsg_stdout("\n!!! " + \
+			writemsg("\n!!! " + \
 				colorize("BAD", "The ebuild selected to satisfy ") + \
 				colorize("INFORM", xinfo) + \
 				colorize("BAD", " has unmet requirements.") + "\n",
 				noiselevel=-1)
 			use_display = pkg_use_display(pkg, self._frozen_config.myopts)
-			writemsg_stdout("- %s %s\n" % (output_cpv, use_display),
+			writemsg("- %s %s\n" % (output_cpv, use_display),
 				noiselevel=-1)
-			writemsg_stdout("\n  The following REQUIRED_USE flag constraints " + \
+			writemsg("\n  The following REQUIRED_USE flag constraints " + \
 				"are unsatisfied:\n", noiselevel=-1)
 			reduced_noise = check_required_use(
 				pkg.metadata["REQUIRED_USE"],
 				self._pkg_use_enabled(pkg),
 				pkg.iuse.is_valid_flag).tounicode()
-			writemsg_stdout("    %s\n" % \
+			writemsg("    %s\n" % \
 				human_readable_required_use(reduced_noise),
 				noiselevel=-1)
 			normalized_required_use = \
 				" ".join(pkg.metadata["REQUIRED_USE"].split())
 			if reduced_noise != normalized_required_use:
-				writemsg_stdout("\n  The above constraints " + \
+				writemsg("\n  The above constraints " + \
 					"are a subset of the following complete expression:\n",
 					noiselevel=-1)
-				writemsg_stdout("    %s\n" % \
+				writemsg("    %s\n" % \
 					human_readable_required_use(normalized_required_use),
 					noiselevel=-1)
-			writemsg_stdout("\n", noiselevel=-1)
+			writemsg("\n", noiselevel=-1)
 
 		elif show_missing_use:
-			writemsg_stdout("\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+".\n", noiselevel=-1)
-			writemsg_stdout("!!! One of the following packages is required to complete your request:\n", noiselevel=-1)
+			writemsg("\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+			writemsg("!!! One of the following packages is required to complete your request:\n", noiselevel=-1)
 			for pkg, mreasons in show_missing_use:
-				writemsg_stdout("- "+pkg.cpv+_repo_separator+pkg.repo+" ("+", ".join(mreasons)+")\n", noiselevel=-1)
+				writemsg("- "+pkg.cpv+_repo_separator+pkg.repo+" ("+", ".join(mreasons)+")\n", noiselevel=-1)
 
 		elif masked_packages:
-			writemsg_stdout("\n!!! " + \
+			writemsg("\n!!! " + \
 				colorize("BAD", "All ebuilds that could satisfy ") + \
 				colorize("INFORM", xinfo) + \
 				colorize("BAD", " have been masked.") + "\n", noiselevel=-1)
-			writemsg_stdout("!!! One of the following masked packages is required to complete your request:\n", noiselevel=-1)
+			writemsg("!!! One of the following masked packages is required to complete your request:\n", noiselevel=-1)
 			have_eapi_mask = show_masked_packages(masked_packages)
 			if have_eapi_mask:
-				writemsg_stdout("\n", noiselevel=-1)
+				writemsg("\n", noiselevel=-1)
 				msg = ("The current version of portage supports " + \
 					"EAPI '%s'. You must upgrade to a newer version" + \
 					" of portage before EAPI masked packages can" + \
 					" be installed.") % portage.const.EAPI
-				writemsg_stdout("\n".join(textwrap.wrap(msg, 75)), noiselevel=-1)
-			writemsg_stdout("\n", noiselevel=-1)
+				writemsg("\n".join(textwrap.wrap(msg, 75)), noiselevel=-1)
+			writemsg("\n", noiselevel=-1)
 			mask_docs = True
 		else:
 			cp_exists = False
@@ -3281,7 +3281,7 @@ class depgraph(object):
 					cp_exists = True
 					break
 
-			writemsg_stdout("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+			writemsg("\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(
@@ -3291,7 +3291,7 @@ class depgraph(object):
 				if cat == "null":
 					cat = None
 
-				writemsg_stdout("\nemerge: searching for similar names..."
+				writemsg("\nemerge: searching for similar names..."
 					, noiselevel=-1)
 
 				all_cp = set()
@@ -3339,16 +3339,16 @@ class depgraph(object):
 				matches = matches_orig_case
 
 				if len(matches) == 1:
-					writemsg_stdout("\nemerge: Maybe you meant " + matches[0] + "?\n"
+					writemsg("\nemerge: Maybe you meant " + matches[0] + "?\n"
 						, noiselevel=-1)
 				elif len(matches) > 1:
-					writemsg_stdout(
+					writemsg(
 						"\nemerge: Maybe you meant any of these: %s?\n" % \
 						(", ".join(matches),), noiselevel=-1)
 				else:
 					# Generally, this would only happen if
 					# all dbapis are empty.
-					writemsg_stdout(" nothing similar found.\n"
+					writemsg(" nothing similar found.\n"
 						, noiselevel=-1)
 		msg = []
 		if not isinstance(myparent, AtomArg):
@@ -3361,12 +3361,12 @@ class depgraph(object):
 						(node)), node_type))
 
 		if msg:
-			writemsg_stdout("\n".join(msg), noiselevel=-1)
-			writemsg_stdout("\n", noiselevel=-1)
+			writemsg("\n".join(msg), noiselevel=-1)
+			writemsg("\n", noiselevel=-1)
 
 		if mask_docs:
 			show_mask_docs()
-			writemsg_stdout("\n", noiselevel=-1)
+			writemsg("\n", noiselevel=-1)
 
 	def _iter_match_pkgs_any(self, root_config, atom, onlydeps=False):
 		for db, pkg_type, built, installed, db_keys in \
@@ -6115,27 +6115,27 @@ class depgraph(object):
 				settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)
 
 			if len(roots) > 1:
-				writemsg_stdout("\nFor %s:\n" % abs_user_config, noiselevel=-1)
+				writemsg("\nFor %s:\n" % abs_user_config, noiselevel=-1)
 
 			if root in unstable_keyword_msg:
-				writemsg_stdout("\nThe following " + colorize("BAD", "keyword changes") + \
+				writemsg("\nThe following " + colorize("BAD", "keyword changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout(format_msg(unstable_keyword_msg[root]), noiselevel=-1)
+				writemsg(format_msg(unstable_keyword_msg[root]), noiselevel=-1)
 
 			if root in p_mask_change_msg:
-				writemsg_stdout("\nThe following " + colorize("BAD", "mask changes") + \
+				writemsg("\nThe following " + colorize("BAD", "mask changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout(format_msg(p_mask_change_msg[root]), noiselevel=-1)
+				writemsg(format_msg(p_mask_change_msg[root]), noiselevel=-1)
 
 			if root in use_changes_msg:
-				writemsg_stdout("\nThe following " + colorize("BAD", "USE changes") + \
+				writemsg("\nThe following " + colorize("BAD", "USE changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout(format_msg(use_changes_msg[root]), noiselevel=-1)
+				writemsg(format_msg(use_changes_msg[root]), noiselevel=-1)
 
 			if root in license_msg:
-				writemsg_stdout("\nThe following " + colorize("BAD", "license changes") + \
+				writemsg("\nThe following " + colorize("BAD", "license changes") + \
 					" are necessary to proceed:\n", noiselevel=-1)
-				writemsg_stdout(format_msg(license_msg[root]), noiselevel=-1)
+				writemsg(format_msg(license_msg[root]), noiselevel=-1)
 
 		protect_obj = {}
 		if write_to_file:
@@ -6182,7 +6182,7 @@ class depgraph(object):
 			for line in msg:
 				if line:
 					line = colorize("INFORM", line)
-				writemsg_stdout(line + "\n", noiselevel=-1)
+				writemsg(line + "\n", noiselevel=-1)
 
 		if ask and write_to_file and file_to_write_to:
 			prompt = "\nWould you like to add these " + \
@@ -6214,14 +6214,14 @@ class depgraph(object):
 						file_to_write_to.get((abs_user_config, "package.license")))
 
 		if problems:
-			writemsg_stdout("\nThe following problems occurred while writing autounmask changes:\n", \
+			writemsg("\nThe following problems occurred while writing autounmask changes:\n", \
 				noiselevel=-1)
-			writemsg_stdout("".join(problems), noiselevel=-1)
+			writemsg("".join(problems), noiselevel=-1)
 		elif write_to_file and roots:
-			writemsg_stdout("\nAutounmask changes successfully written. Remember to run dispatch-conf.\n", \
+			writemsg("\nAutounmask changes successfully written. Remember to run dispatch-conf.\n", \
 				noiselevel=-1)
 		elif not pretend and not autounmask_write and roots:
-			writemsg_stdout("\nUse --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).\n", \
+			writemsg("\nUse --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).\n", \
 				noiselevel=-1)
 
 
@@ -6232,35 +6232,8 @@ class depgraph(object):
 		the merge list where it is most likely to be seen, but if display()
 		is not going to be called then this method should be called explicitly
 		to ensure that the user is notified of problems with the graph.
-
-		All output goes to stderr, except for unsatisfied dependencies which
-		go to stdout for parsing by programs such as autounmask.
 		"""
 
-		# Note that show_masked_packages() sends its output to
-		# stdout, and some programs such as autounmask parse the
-		# output in cases when emerge bails out. However, when
-		# show_masked_packages() is called for installed packages
-		# here, the message is a warning that is more appropriate
-		# to send to stderr, so temporarily redirect stdout to
-		# stderr. TODO: Fix output code so there's a cleaner way
-		# to redirect everything to stderr.
-		sys.stdout.flush()
-		sys.stderr.flush()
-		stdout = sys.stdout
-		try:
-			sys.stdout = sys.stderr
-			self._display_problems()
-		finally:
-			sys.stdout = stdout
-			sys.stdout.flush()
-			sys.stderr.flush()
-
-		# This goes to stdout for parsing by programs like autounmask.
-		for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display:
-			self._show_unsatisfied_dep(*pargs, **kwargs)
-
-	def _display_problems(self):
 		if self._dynamic_config._circular_deps_for_display is not None:
 			self._show_circular_deps(
 				self._dynamic_config._circular_deps_for_display)
@@ -6379,6 +6352,9 @@ class depgraph(object):
 			show_mask_docs()
 			writemsg("\n", noiselevel=-1)
 
+		for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display:
+			self._show_unsatisfied_dep(*pargs, **kwargs)
+
 	def saveNomergeFavorites(self):
 		"""Find atoms in favorites that are not in the mergelist and add them
 		to the world file if necessary."""
@@ -7192,10 +7168,11 @@ def show_masked_packages(masked_packages):
 				# above via mreasons.
 				pass
 
-		writemsg_stdout("- "+output_cpv+" (masked by: "+", ".join(mreasons)+")\n", noiselevel=-1)
+		writemsg("- "+output_cpv+" (masked by: "+", ".join(mreasons)+")\n",
+			noiselevel=-1)
 
 		if comment and comment not in shown_comments:
-			writemsg_stdout(filename + ":\n" + comment + "\n",
+			writemsg(filename + ":\n" + comment + "\n",
 				noiselevel=-1)
 			shown_comments.add(comment)
 		portdb = root_config.trees["porttree"].dbapi
@@ -7205,13 +7182,14 @@ def show_masked_packages(masked_packages):
 				continue
 			msg = ("A copy of the '%s' license" + \
 			" is located at '%s'.\n\n") % (l, l_path)
-			writemsg_stdout(msg, noiselevel=-1)
+			writemsg(msg, noiselevel=-1)
 			shown_licenses.add(l)
 	return have_eapi_mask
 
 def show_mask_docs():
-	writemsg_stdout("For more information, see the MASKED PACKAGES section in the emerge\n", noiselevel=-1)
-	writemsg_stdout("man page or refer to the Gentoo Handbook.\n", noiselevel=-1)
+	writemsg("For more information, see the MASKED PACKAGES "
+		"section in the emerge\n", noiselevel=-1)
+	writemsg("man page or refer to the Gentoo Handbook.\n", noiselevel=-1)
 
 def show_blocker_docs_link():
 	writemsg("\nFor more information about " + bad("Blocked Packages") + ", please refer to the following\n", noiselevel=-1)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-05-30 20:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-05-30 20:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b6fa4dbba0297226ade42ad86b8ca95a5764e34b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 30 20:25:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 30 20:25:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b6fa4dbb

_wildcard_set: specify allow_repo=False

This make is behave as it did prior to the change in Atom constructor
behavior in commit 587cce4816afc7d57b3edf0be6c0670ec0be89c9.

---
 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 572cea7..be49b0f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -85,9 +85,9 @@ def _wildcard_set(atoms):
 	pkgs = InternalPackageSet(allow_wildcard=True)
 	for x in atoms:
 		try:
-			x = Atom(x, allow_wildcard=True)
+			x = Atom(x, allow_wildcard=True, allow_repo=False)
 		except portage.exception.InvalidAtom:
-			x = Atom("*/" + x, allow_wildcard=True)
+			x = Atom("*/" + x, allow_wildcard=True, allow_repo=False)
 		pkgs.add(x)
 	return pkgs
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-04  0:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-04  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     650c960be3170bade8bb63ddedcd4796c75ec374
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  4 00:36:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun  4 00:36:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=650c960b

FakeVartree: use KEYWORDS from unbuilt ebuild

This allows us to avoid triggering the code from bug #350285 (see
commit b7de3d1fb10e40b4ef03462f8a145968689ac587) in cases when the
KEYWORDS from the unbuilt ebuild would unmask the package.

---
 pym/_emerge/FakeVartree.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index d4dbe97..e8454e8 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -68,7 +68,7 @@ class FakeVartree(vartree):
 			self.dbapi.aux_get = self._aux_get_wrapper
 			self.dbapi.match = self._match_wrapper
 		self._aux_get_history = set()
-		self._portdb_keys = ["EAPI", "DEPEND", "RDEPEND", "PDEPEND"]
+		self._portdb_keys = ["EAPI", "KEYWORDS", "DEPEND", "RDEPEND", "PDEPEND"]
 		self._portdb = portdb
 		self._global_updates = None
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-04  1:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-04  1:19 UTC (permalink / raw
  To: gentoo-commits

commit:     5b723290dfc9b643fec3c437fb5f39ee2ece1a6f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  4 01:19:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun  4 01:19:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5b723290

Package: calc visiblity on demand

This delays visiblity calculations until after FakeVartree applies its
metadata tweaks, so commit 650c960be3170bade8bb63ddedcd4796c75ec374
will work as intended.

---
 pym/_emerge/Package.py |   49 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index c04fa1f..bdd4bc7 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -25,9 +25,9 @@ class Package(Task):
 		"installed", "metadata", "onlydeps", "operation",
 		"root_config", "type_name",
 		"category", "counter", "cp", "cpv_split",
-		"inherited", "invalid", "iuse", "masks", "mtime",
-		"pf", "root", "slot", "slot_atom", "version", "visible",) + \
-	("_raw_metadata", "_use",)
+		"inherited", "iuse", "mtime",
+		"pf", "root", "slot", "slot_atom", "version") + \
+	("_invalid", "_raw_metadata", "_masks", "_use", "_visible")
 
 	metadata_keys = [
 		"BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "EAPI",
@@ -73,9 +73,6 @@ class Package(Task):
 		if self.inherited is None:
 			self.inherited = frozenset()
 
-		self._validate_deps()
-		self.masks = self._masks()
-		self.visible = self._visible(self.masks)
 		if self.operation is None:
 			if self.onlydeps or self.installed:
 				self.operation = "nomerge"
@@ -89,6 +86,28 @@ class Package(Task):
 			type_name=self.type_name)
 		self._hash_value = hash(self._hash_key)
 
+	# These are calculated on-demand, so that they are calculated
+	# after FakeVartree applies its metadata tweaks.
+	@property
+	def invalid(self):
+		if self._invalid is None:
+			self._validate_deps()
+			if self._invalid is None:
+				self._invalid = False
+		return self._invalid
+
+	@property
+	def masks(self):
+		if self._masks is None:
+			self._masks = self._eval_masks()
+		return self._masks
+
+	@property
+	def visible(self):
+		if self._visible is None:
+			self._visible = self._eval_visiblity(self.masks)
+		return self._visible
+
 	@classmethod
 	def _gen_hash_key(cls, cpv=None, installed=None, onlydeps=None,
 		operation=None, repo_name=None, root_config=None,
@@ -205,11 +224,11 @@ class Package(Task):
 			onlydeps=self.onlydeps, operation=self.operation,
 			root_config=self.root_config, type_name=self.type_name)
 
-	def _masks(self):
+	def _eval_masks(self):
 		masks = {}
 		settings = self.root_config.settings
 
-		if self.invalid is not None:
+		if self.invalid is not False:
 			masks['invalid'] = self.invalid
 
 		if not settings._accept_chost(self.cpv, self.metadata):
@@ -249,13 +268,13 @@ class Package(Task):
 			pass
 
 		if not masks:
-			masks = None
+			masks = False
 
 		return masks
 
-	def _visible(self, masks):
+	def _eval_visiblity(self, masks):
 
-		if masks is not None:
+		if masks is not False:
 
 			if 'EAPI.unsupported' in masks:
 				return False
@@ -338,12 +357,12 @@ class Package(Task):
 				_unicode_decode("%s: %s in '%s'") % (k, e, path))
 
 	def _invalid_metadata(self, msg_type, msg):
-		if self.invalid is None:
-			self.invalid = {}
-		msgs = self.invalid.get(msg_type)
+		if self._invalid is None:
+			self._invalid = {}
+		msgs = self._invalid.get(msg_type)
 		if msgs is None:
 			msgs = []
-			self.invalid[msg_type] = msgs
+			self._invalid[msg_type] = msgs
 		msgs.append(msg)
 
 	def __str__(self):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-16 20:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-16 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     66c41adb5505545fde9654e196fd803c3e6c1c5d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 16 20:24:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 16 20:24:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=66c41adb

depgraph: _autounmask in _highest_pkg_cache key

---
 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 5eece98..83c17ac 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3465,7 +3465,7 @@ class depgraph(object):
 						return
 
 	def _select_pkg_highest_available(self, root, atom, onlydeps=False):
-		cache_key = (root, atom, atom.unevaluated_atom, onlydeps)
+		cache_key = (root, atom, atom.unevaluated_atom, onlydeps, self._dynamic_config._autounmask)
 		ret = self._dynamic_config._highest_pkg_cache.get(cache_key)
 		if ret is not None:
 			pkg, existing = ret



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-16 20:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-16 20:27 UTC (permalink / raw
  To: gentoo-commits

commit:     d3d4787ae25dc166f63cfabab97c4b8d70bf67ac
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 16 20:27:30 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 16 20:27:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3d4787a

depgraph: simplify _select_pkg_highest_available

This hunk of code is no longer needed since the content of
_highest_pkg_cache is discarded each time a package is added to the
graph.

---
 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 83c17ac..276a749 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3468,14 +3468,6 @@ class depgraph(object):
 		cache_key = (root, atom, atom.unevaluated_atom, onlydeps, self._dynamic_config._autounmask)
 		ret = self._dynamic_config._highest_pkg_cache.get(cache_key)
 		if ret is not None:
-			pkg, existing = ret
-			if pkg and not existing:
-				existing = self._dynamic_config._slot_pkg_map[root].get(pkg.slot_atom)
-				if existing and existing == pkg:
-					# Update the cache to reflect that the
-					# package has been added to the graph.
-					ret = pkg, pkg
-					self._dynamic_config._highest_pkg_cache[cache_key] = ret
 			return ret
 		ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps)
 		self._dynamic_config._highest_pkg_cache[cache_key] = ret



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17  3:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17  3:06 UTC (permalink / raw
  To: gentoo-commits

commit:     8838c798d771af7f5356cacf37e10d9f55ac6519
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 03:06:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 03:06:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8838c798

depgraph: split out _handle_slot_conflict method

---
 pym/_emerge/depgraph.py |  245 ++++++++++++++++++++++++-----------------------
 1 files changed, 125 insertions(+), 120 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 276a749..ec9434b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -833,6 +833,128 @@ class depgraph(object):
 					else:
 						self._dynamic_config._slot_conflict_parent_atoms.add(parent_atom)
 
+	def _handle_slot_conflict(self, existing_node, pkg, dep, arg_atoms):
+
+		debug = "--debug" in self._frozen_config.myopts
+		self._add_slot_conflict(pkg)
+
+		if dep.atom is not None and dep.parent is not None:
+			self._add_parent_atom(pkg, (dep.parent, dep.atom))
+
+		if arg_atoms:
+			for parent_atom in arg_atoms:
+				parent, atom = parent_atom
+				self._add_parent_atom(pkg, parent_atom)
+
+		# The existing node should not already be in
+		# runtime_pkg_mask, since that would trigger an
+		# infinite backtracking loop.
+		if self._dynamic_config._allow_backtracking and \
+			existing_node in self._dynamic_config._runtime_pkg_mask:
+			if debug:
+				writemsg_level(
+					"!!! backtracking loop detected: %s %s\n" % \
+					(existing_node,
+					self._dynamic_config._runtime_pkg_mask[existing_node]),
+					level=logging.DEBUG, noiselevel=-1)
+		elif self._dynamic_config._allow_backtracking and \
+			not self._accept_blocker_conflicts() and \
+			not self.need_restart():
+
+			self._process_slot_conflicts()
+
+			backtrack_data = []
+			fallback_data = []
+			all_parents = set()
+			# The ordering of backtrack_data can make
+			# a difference here, because both mask actions may lead
+			# to valid, but different, solutions and the one with
+			# 'existing_node' masked is usually the better one. Because
+			# of that, we choose an order such that
+			# the backtracker will first explore the choice with
+			# existing_node masked. The backtracker reverses the
+			# order, so the order it uses is the reverse of the
+			# order shown here. See bug #339606.
+			for to_be_selected, to_be_masked in (existing_node, pkg), (pkg, existing_node):
+				# For missed update messages, find out which
+				# atoms matched to_be_selected that did not
+				# match to_be_masked.
+				parent_atoms = \
+					self._dynamic_config._parent_atoms.get(to_be_selected, set())
+				if parent_atoms:
+					conflict_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
+					if conflict_atoms:
+						parent_atoms = conflict_atoms
+
+				all_parents.update(parent_atoms)
+
+				all_match = True
+				for parent, atom in parent_atoms:
+					i = InternalPackageSet(initial_atoms=(atom,),
+						allow_repo=True)
+					if not i.findAtomForPackage(to_be_masked):
+						all_match = False
+						break
+
+				fallback_data.append((to_be_masked, parent_atoms))
+
+				if all_match:
+					# 'to_be_masked' does not violate any parent atom, which means
+					# there is no point in masking it.
+					pass
+				else:
+					backtrack_data.append((to_be_masked, parent_atoms))
+
+			if not backtrack_data:
+				# This shouldn't happen, but fall back to the old
+				# behavior if this gets triggered somehow.
+				backtrack_data = fallback_data
+
+			if len(backtrack_data) > 1:
+				# NOTE: Generally, we prefer to mask the higher
+				# version since this solves common cases in which a
+				# lower version is needed so that all dependencies
+				# will be satisfied (bug #337178). However, if
+				# existing_node happens to be installed then we
+				# mask that since this is a common case that is
+				# triggered when --update is not enabled.
+				if existing_node.installed:
+					pass
+				elif pkg > existing_node:
+					backtrack_data.reverse()
+
+			to_be_masked = backtrack_data[-1][0]
+
+			self._dynamic_config._backtrack_infos["slot conflict"] = backtrack_data
+			self._dynamic_config._need_restart = True
+			if debug:
+				msg = []
+				msg.append("")
+				msg.append("")
+				msg.append("backtracking due to slot conflict:")
+				if backtrack_data is fallback_data:
+					msg.append("!!! backtrack_data fallback")
+				msg.append("   first package:  %s" % existing_node)
+				msg.append("   second package: %s" % pkg)
+				msg.append("  package to mask: %s" % to_be_masked)
+				msg.append("      slot: %s" % pkg.slot_atom)
+				msg.append("   parents: %s" % ", ".join( \
+					"(%s, '%s')" % (ppkg, atom) for ppkg, atom in all_parents))
+				msg.append("")
+				writemsg_level("".join("%s\n" % l for l in msg),
+					noiselevel=-1, level=logging.DEBUG)
+			return False
+
+		if debug:
+			writemsg_level(
+				"%s%s %s\n" % ("Slot Conflict:".ljust(15),
+				existing_node, pkg_use_display(existing_node,
+				self._frozen_config.myopts,
+				modified_use=self._pkg_use_enabled(existing_node))),
+				level=logging.DEBUG, noiselevel=-1)
+
+		return True
+
 	def _reinstall_for_flags(self, pkg, forced_flags,
 		orig_use, orig_iuse, cur_use, cur_iuse):
 		"""Return a set of flags that trigger reinstallation, or None if there
@@ -1152,128 +1274,11 @@ class depgraph(object):
 					return 1
 				else:
 					# A slot conflict has occurred. 
-					# The existing node should not already be in
-					# runtime_pkg_mask, since that would trigger an
-					# infinite backtracking loop.
-					if self._dynamic_config._allow_backtracking and \
-						existing_node in \
-						self._dynamic_config._runtime_pkg_mask:
-						if "--debug" in self._frozen_config.myopts:
-							writemsg(
-								"!!! backtracking loop detected: %s %s\n" % \
-								(existing_node,
-								self._dynamic_config._runtime_pkg_mask[
-								existing_node]), noiselevel=-1)
-					elif self._dynamic_config._allow_backtracking and \
-						not self._accept_blocker_conflicts() and \
-						not self.need_restart():
-
-						self._add_slot_conflict(pkg)
-						if dep.atom is not None and dep.parent is not None:
-							self._add_parent_atom(pkg, (dep.parent, dep.atom))
-
-						if arg_atoms:
-							for parent_atom in arg_atoms:
-								parent, atom = parent_atom
-								self._add_parent_atom(pkg, parent_atom)
-						self._process_slot_conflicts()
-
-						backtrack_data = []
-						fallback_data = []
-						all_parents = set()
-						# The ordering of backtrack_data can make
-						# a difference here, because both mask actions may lead
-						# to valid, but different, solutions and the one with
-						# 'existing_node' masked is usually the better one. Because
-						# of that, we choose an order such that
-						# the backtracker will first explore the choice with
-						# existing_node masked. The backtracker reverses the
-						# order, so the order it uses is the reverse of the
-						# order shown here. See bug #339606.
-						for to_be_selected, to_be_masked in (existing_node, pkg), (pkg, existing_node):
-							# For missed update messages, find out which
-							# atoms matched to_be_selected that did not
-							# match to_be_masked.
-							parent_atoms = \
-								self._dynamic_config._parent_atoms.get(to_be_selected, set())
-							if parent_atoms:
-								conflict_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
-								if conflict_atoms:
-									parent_atoms = conflict_atoms
-
-							all_parents.update(parent_atoms)
-
-							all_match = True
-							for parent, atom in parent_atoms:
-								i = InternalPackageSet(initial_atoms=(atom,),
-									allow_repo=True)
-								if not i.findAtomForPackage(to_be_masked):
-									all_match = False
-									break
-
-							fallback_data.append((to_be_masked, parent_atoms))
-
-							if all_match:
-								# 'to_be_masked' does not violate any parent atom, which means
-								# there is no point in masking it.
-								pass
-							else:
-								backtrack_data.append((to_be_masked, parent_atoms))
-
-						if not backtrack_data:
-							# This shouldn't happen, but fall back to the old
-							# behavior if this gets triggered somehow.
-							backtrack_data = fallback_data
-
-						if len(backtrack_data) > 1:
-							# NOTE: Generally, we prefer to mask the higher
-							# version since this solves common cases in which a
-							# lower version is needed so that all dependencies
-							# will be satisfied (bug #337178). However, if
-							# existing_node happens to be installed then we
-							# mask that since this is a common case that is
-							# triggered when --update is not enabled.
-							if existing_node.installed:
-								pass
-							elif pkg > existing_node:
-								backtrack_data.reverse()
-
-						to_be_masked = backtrack_data[-1][0]
-
-						self._dynamic_config._backtrack_infos["slot conflict"] = backtrack_data
-						self._dynamic_config._need_restart = True
-						if "--debug" in self._frozen_config.myopts:
-							msg = []
-							msg.append("")
-							msg.append("")
-							msg.append("backtracking due to slot conflict:")
-							if backtrack_data is fallback_data:
-								msg.append("!!! backtrack_data fallback")
-							msg.append("   first package:  %s" % existing_node)
-							msg.append("   second package: %s" % pkg)
-							msg.append("  package to mask: %s" % to_be_masked)
-							msg.append("      slot: %s" % pkg.slot_atom)
-							msg.append("   parents: %s" % ", ".join( \
-								"(%s, '%s')" % (ppkg, atom) for ppkg, atom in all_parents))
-							msg.append("")
-							writemsg_level("".join("%s\n" % l for l in msg),
-								noiselevel=-1, level=logging.DEBUG)
-						return 0
-
-					# A slot collision has occurred.  Sometimes this coincides
-					# with unresolvable blockers, so the slot collision will be
-					# shown later if there are no unresolvable blockers.
-					self._add_slot_conflict(pkg)
+					if not self._handle_slot_conflict(
+						existing_node, pkg, dep, arg_atoms):
+						return False
 					slot_collision = True
 
-					if debug:
-						writemsg_level(
-							"%s%s %s\n" % ("Slot Conflict:".ljust(15),
-							existing_node, pkg_use_display(existing_node,
-							self._frozen_config.myopts,
-							modified_use=self._pkg_use_enabled(existing_node))),
-							level=logging.DEBUG, noiselevel=-1)
-
 			if slot_collision:
 				# Now add this node to the graph so that self.display()
 				# can show use flags and --tree portage.output.  This node is



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17  3:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17  3:22 UTC (permalink / raw
  To: gentoo-commits

commit:     5122b9e5f3849a94bab73fd936ca95255af6ff59
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 03:06:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 03:22:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5122b9e5

depgraph: split out _handle_slot_conflict method

---
 pym/_emerge/depgraph.py |  249 ++++++++++++++++++++++++-----------------------
 1 files changed, 129 insertions(+), 120 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 276a749..3f6c9f8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -833,6 +833,132 @@ class depgraph(object):
 					else:
 						self._dynamic_config._slot_conflict_parent_atoms.add(parent_atom)
 
+	def _handle_slot_conflict(self, existing_node, pkg, dep, arg_atoms):
+
+		debug = "--debug" in self._frozen_config.myopts
+		self._add_slot_conflict(pkg)
+
+		if dep.atom is not None and dep.parent is not None:
+			self._add_parent_atom(pkg, (dep.parent, dep.atom))
+
+		if arg_atoms:
+			for parent_atom in arg_atoms:
+				parent, atom = parent_atom
+				self._add_parent_atom(pkg, parent_atom)
+
+		# The existing node should not already be in
+		# runtime_pkg_mask, since that would trigger an
+		# infinite backtracking loop.
+		if self._dynamic_config._allow_backtracking and \
+			existing_node in self._dynamic_config._runtime_pkg_mask:
+			if debug:
+				writemsg_level(
+					"!!! backtracking loop detected: %s %s\n" % \
+					(existing_node,
+					self._dynamic_config._runtime_pkg_mask[existing_node]),
+					level=logging.DEBUG, noiselevel=-1)
+		elif self._dynamic_config._allow_backtracking and \
+			not self._accept_blocker_conflicts() and \
+			not self.need_restart():
+			self._slot_confict_backtrack(existing_node, pkg)
+			return False
+
+		if debug:
+			writemsg_level(
+				"%s%s %s\n" % ("Slot Conflict:".ljust(15),
+				existing_node, pkg_use_display(existing_node,
+				self._frozen_config.myopts,
+				modified_use=self._pkg_use_enabled(existing_node))),
+				level=logging.DEBUG, noiselevel=-1)
+
+		return True
+
+	def _slot_confict_backtrack(self, existing_node, pkg):
+
+		debug = "--debug" in self._frozen_config.myopts
+		self._process_slot_conflicts()
+
+		backtrack_data = []
+		fallback_data = []
+		all_parents = set()
+		# The ordering of backtrack_data can make
+		# a difference here, because both mask actions may lead
+		# to valid, but different, solutions and the one with
+		# 'existing_node' masked is usually the better one. Because
+		# of that, we choose an order such that
+		# the backtracker will first explore the choice with
+		# existing_node masked. The backtracker reverses the
+		# order, so the order it uses is the reverse of the
+		# order shown here. See bug #339606.
+		for to_be_selected, to_be_masked in (existing_node, pkg), (pkg, existing_node):
+			# For missed update messages, find out which
+			# atoms matched to_be_selected that did not
+			# match to_be_masked.
+			parent_atoms = \
+				self._dynamic_config._parent_atoms.get(to_be_selected, set())
+			if parent_atoms:
+				conflict_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
+				if conflict_atoms:
+					parent_atoms = conflict_atoms
+
+			all_parents.update(parent_atoms)
+
+			all_match = True
+			for parent, atom in parent_atoms:
+				i = InternalPackageSet(initial_atoms=(atom,),
+					allow_repo=True)
+				if not i.findAtomForPackage(to_be_masked):
+					all_match = False
+					break
+
+			fallback_data.append((to_be_masked, parent_atoms))
+
+			if all_match:
+				# 'to_be_masked' does not violate any parent atom, which means
+				# there is no point in masking it.
+				pass
+			else:
+				backtrack_data.append((to_be_masked, parent_atoms))
+
+		if not backtrack_data:
+			# This shouldn't happen, but fall back to the old
+			# behavior if this gets triggered somehow.
+			backtrack_data = fallback_data
+
+		if len(backtrack_data) > 1:
+			# NOTE: Generally, we prefer to mask the higher
+			# version since this solves common cases in which a
+			# lower version is needed so that all dependencies
+			# will be satisfied (bug #337178). However, if
+			# existing_node happens to be installed then we
+			# mask that since this is a common case that is
+			# triggered when --update is not enabled.
+			if existing_node.installed:
+				pass
+			elif pkg > existing_node:
+				backtrack_data.reverse()
+
+		to_be_masked = backtrack_data[-1][0]
+
+		self._dynamic_config._backtrack_infos["slot conflict"] = backtrack_data
+		self._dynamic_config._need_restart = True
+		if debug:
+			msg = []
+			msg.append("")
+			msg.append("")
+			msg.append("backtracking due to slot conflict:")
+			if backtrack_data is fallback_data:
+				msg.append("!!! backtrack_data fallback")
+			msg.append("   first package:  %s" % existing_node)
+			msg.append("   second package: %s" % pkg)
+			msg.append("  package to mask: %s" % to_be_masked)
+			msg.append("      slot: %s" % pkg.slot_atom)
+			msg.append("   parents: %s" % ", ".join( \
+				"(%s, '%s')" % (ppkg, atom) for ppkg, atom in all_parents))
+			msg.append("")
+			writemsg_level("".join("%s\n" % l for l in msg),
+				noiselevel=-1, level=logging.DEBUG)
+
 	def _reinstall_for_flags(self, pkg, forced_flags,
 		orig_use, orig_iuse, cur_use, cur_iuse):
 		"""Return a set of flags that trigger reinstallation, or None if there
@@ -1152,128 +1278,11 @@ class depgraph(object):
 					return 1
 				else:
 					# A slot conflict has occurred. 
-					# The existing node should not already be in
-					# runtime_pkg_mask, since that would trigger an
-					# infinite backtracking loop.
-					if self._dynamic_config._allow_backtracking and \
-						existing_node in \
-						self._dynamic_config._runtime_pkg_mask:
-						if "--debug" in self._frozen_config.myopts:
-							writemsg(
-								"!!! backtracking loop detected: %s %s\n" % \
-								(existing_node,
-								self._dynamic_config._runtime_pkg_mask[
-								existing_node]), noiselevel=-1)
-					elif self._dynamic_config._allow_backtracking and \
-						not self._accept_blocker_conflicts() and \
-						not self.need_restart():
-
-						self._add_slot_conflict(pkg)
-						if dep.atom is not None and dep.parent is not None:
-							self._add_parent_atom(pkg, (dep.parent, dep.atom))
-
-						if arg_atoms:
-							for parent_atom in arg_atoms:
-								parent, atom = parent_atom
-								self._add_parent_atom(pkg, parent_atom)
-						self._process_slot_conflicts()
-
-						backtrack_data = []
-						fallback_data = []
-						all_parents = set()
-						# The ordering of backtrack_data can make
-						# a difference here, because both mask actions may lead
-						# to valid, but different, solutions and the one with
-						# 'existing_node' masked is usually the better one. Because
-						# of that, we choose an order such that
-						# the backtracker will first explore the choice with
-						# existing_node masked. The backtracker reverses the
-						# order, so the order it uses is the reverse of the
-						# order shown here. See bug #339606.
-						for to_be_selected, to_be_masked in (existing_node, pkg), (pkg, existing_node):
-							# For missed update messages, find out which
-							# atoms matched to_be_selected that did not
-							# match to_be_masked.
-							parent_atoms = \
-								self._dynamic_config._parent_atoms.get(to_be_selected, set())
-							if parent_atoms:
-								conflict_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
-								if conflict_atoms:
-									parent_atoms = conflict_atoms
-
-							all_parents.update(parent_atoms)
-
-							all_match = True
-							for parent, atom in parent_atoms:
-								i = InternalPackageSet(initial_atoms=(atom,),
-									allow_repo=True)
-								if not i.findAtomForPackage(to_be_masked):
-									all_match = False
-									break
-
-							fallback_data.append((to_be_masked, parent_atoms))
-
-							if all_match:
-								# 'to_be_masked' does not violate any parent atom, which means
-								# there is no point in masking it.
-								pass
-							else:
-								backtrack_data.append((to_be_masked, parent_atoms))
-
-						if not backtrack_data:
-							# This shouldn't happen, but fall back to the old
-							# behavior if this gets triggered somehow.
-							backtrack_data = fallback_data
-
-						if len(backtrack_data) > 1:
-							# NOTE: Generally, we prefer to mask the higher
-							# version since this solves common cases in which a
-							# lower version is needed so that all dependencies
-							# will be satisfied (bug #337178). However, if
-							# existing_node happens to be installed then we
-							# mask that since this is a common case that is
-							# triggered when --update is not enabled.
-							if existing_node.installed:
-								pass
-							elif pkg > existing_node:
-								backtrack_data.reverse()
-
-						to_be_masked = backtrack_data[-1][0]
-
-						self._dynamic_config._backtrack_infos["slot conflict"] = backtrack_data
-						self._dynamic_config._need_restart = True
-						if "--debug" in self._frozen_config.myopts:
-							msg = []
-							msg.append("")
-							msg.append("")
-							msg.append("backtracking due to slot conflict:")
-							if backtrack_data is fallback_data:
-								msg.append("!!! backtrack_data fallback")
-							msg.append("   first package:  %s" % existing_node)
-							msg.append("   second package: %s" % pkg)
-							msg.append("  package to mask: %s" % to_be_masked)
-							msg.append("      slot: %s" % pkg.slot_atom)
-							msg.append("   parents: %s" % ", ".join( \
-								"(%s, '%s')" % (ppkg, atom) for ppkg, atom in all_parents))
-							msg.append("")
-							writemsg_level("".join("%s\n" % l for l in msg),
-								noiselevel=-1, level=logging.DEBUG)
-						return 0
-
-					# A slot collision has occurred.  Sometimes this coincides
-					# with unresolvable blockers, so the slot collision will be
-					# shown later if there are no unresolvable blockers.
-					self._add_slot_conflict(pkg)
+					if not self._handle_slot_conflict(
+						existing_node, pkg, dep, arg_atoms):
+						return False
 					slot_collision = True
 
-					if debug:
-						writemsg_level(
-							"%s%s %s\n" % ("Slot Conflict:".ljust(15),
-							existing_node, pkg_use_display(existing_node,
-							self._frozen_config.myopts,
-							modified_use=self._pkg_use_enabled(existing_node))),
-							level=logging.DEBUG, noiselevel=-1)
-
 			if slot_collision:
 				# Now add this node to the graph so that self.display()
 				# can show use flags and --tree portage.output.  This node is



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17  4:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17  4:58 UTC (permalink / raw
  To: gentoo-commits

commit:     30b25033e67d2285f165d12e25903ea2cabf0235
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 04:58:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 04:58:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=30b25033

_process_slot_conflicts: do one slot at a time

This allows us to avoid redundant processing of slots that have
already been processed by a previous call.

---
 pym/_emerge/depgraph.py |   73 ++++++++++++++++++++++++-----------------------
 1 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3f6c9f8..a669166 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -371,7 +371,6 @@ class _dynamic_depgraph_config(object):
 		# blocker validation is only able to account for one package per slot.
 		self._slot_collision_nodes = set()
 		self._parent_atoms = {}
-		self._slot_conflict_parent_atoms = set()
 		self._slot_conflict_handler = None
 		self._circular_dependency_handler = None
 		self._serialized_tasks_cache = None
@@ -799,39 +798,43 @@ class depgraph(object):
 			writemsg(line + '\n', noiselevel=-1)
 		writemsg('\n', noiselevel=-1)
 
-	def _process_slot_conflicts(self):
+	def _process_slot_conflicts(self, root, slot_atom):
 		"""
 		Process slot conflict data to identify specific atoms which
 		lead to conflict. These atoms only match a subset of the
 		packages that have been pulled into a given slot.
 		"""
-		for (slot_atom, root), slot_nodes \
-			in self._dynamic_config._slot_collision_info.items():
+		slot_nodes = \
+			self._dynamic_config._slot_collision_info[(slot_atom, root)]
 
-			all_parent_atoms = set()
-			for pkg in slot_nodes:
-				parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
-				if not parent_atoms:
+		conflict_atoms = set()
+		slot_parent_atoms = set()
+		for pkg in slot_nodes:
+			parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
+			if not parent_atoms:
+				continue
+			slot_parent_atoms.update(parent_atoms)
+
+		for pkg in slot_nodes:
+			parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
+			if parent_atoms is None:
+				parent_atoms = set()
+				self._dynamic_config._parent_atoms[pkg] = parent_atoms
+			for parent_atom in slot_parent_atoms:
+				if parent_atom in parent_atoms:
 					continue
-				all_parent_atoms.update(parent_atoms)
+				# Use package set for matching since it will match via
+				# PROVIDE when necessary, while match_from_list does not.
+				parent, atom = parent_atom
+				atom_set = InternalPackageSet(
+					initial_atoms=(atom,), allow_repo=True)
+				if atom_set.findAtomForPackage(pkg,
+					modified_use=self._pkg_use_enabled(pkg)):
+					parent_atoms.add(parent_atom)
+				else:
+					conflict_atoms.add(parent_atom)
 
-			for pkg in slot_nodes:
-				parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
-				if parent_atoms is None:
-					parent_atoms = set()
-					self._dynamic_config._parent_atoms[pkg] = parent_atoms
-				for parent_atom in all_parent_atoms:
-					if parent_atom in parent_atoms:
-						continue
-					# Use package set for matching since it will match via
-					# PROVIDE when necessary, while match_from_list does not.
-					parent, atom = parent_atom
-					atom_set = InternalPackageSet(
-						initial_atoms=(atom,), allow_repo=True)
-					if atom_set.findAtomForPackage(pkg, modified_use=self._pkg_use_enabled(pkg)):
-						parent_atoms.add(parent_atom)
-					else:
-						self._dynamic_config._slot_conflict_parent_atoms.add(parent_atom)
+		return conflict_atoms
 
 	def _handle_slot_conflict(self, existing_node, pkg, dep, arg_atoms):
 
@@ -846,6 +849,9 @@ class depgraph(object):
 				parent, atom = parent_atom
 				self._add_parent_atom(pkg, parent_atom)
 
+		conflict_atoms = \
+			self._process_slot_conflicts(pkg.root, pkg.slot_atom)
+
 		# The existing node should not already be in
 		# runtime_pkg_mask, since that would trigger an
 		# infinite backtracking loop.
@@ -860,7 +866,7 @@ class depgraph(object):
 		elif self._dynamic_config._allow_backtracking and \
 			not self._accept_blocker_conflicts() and \
 			not self.need_restart():
-			self._slot_confict_backtrack(existing_node, pkg)
+			self._slot_confict_backtrack(existing_node, pkg, conflict_atoms)
 			return False
 
 		if debug:
@@ -873,11 +879,9 @@ class depgraph(object):
 
 		return True
 
-	def _slot_confict_backtrack(self, existing_node, pkg):
+	def _slot_confict_backtrack(self, existing_node, pkg, conflict_atoms):
 
 		debug = "--debug" in self._frozen_config.myopts
-		self._process_slot_conflicts()
-
 		backtrack_data = []
 		fallback_data = []
 		all_parents = set()
@@ -897,9 +901,9 @@ class depgraph(object):
 			parent_atoms = \
 				self._dynamic_config._parent_atoms.get(to_be_selected, set())
 			if parent_atoms:
-				conflict_atoms = self._dynamic_config._slot_conflict_parent_atoms.intersection(parent_atoms)
-				if conflict_atoms:
-					parent_atoms = conflict_atoms
+				p_conflict_atoms = conflict_atoms.intersection(parent_atoms)
+				if p_conflict_atoms:
+					parent_atoms = p_conflict_atoms
 
 			all_parents.update(parent_atoms)
 
@@ -4938,9 +4942,6 @@ class depgraph(object):
 			self._dynamic_config._skip_restart = True
 			raise self._unknown_internal_error()
 
-		if self._dynamic_config._slot_collision_info:
-			self._process_slot_conflicts()
-
 	def _serialize_tasks(self):
 
 		debug = "--debug" in self._frozen_config.myopts



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17 16:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17 16:16 UTC (permalink / raw
  To: gentoo-commits

commit:     525988ac9a74c75dff19a89887c44ea280628d3f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 16:16:15 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 16:16:15 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=525988ac

DependencyArg: add __slots__

---
 pym/_emerge/AtomArg.py       |    5 ++++-
 pym/_emerge/DependencyArg.py |    5 ++++-
 pym/_emerge/SetArg.py        |    5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/AtomArg.py b/pym/_emerge/AtomArg.py
index a929b43..343d7aa 100644
--- a/pym/_emerge/AtomArg.py
+++ b/pym/_emerge/AtomArg.py
@@ -1,10 +1,13 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage._sets.base import InternalPackageSet
 from _emerge.DependencyArg import DependencyArg
 
 class AtomArg(DependencyArg):
+
+	__slots__ = ('atom', 'pset')
+
 	def __init__(self, atom=None, **kwargs):
 		DependencyArg.__init__(self, **kwargs)
 		self.atom = atom

diff --git a/pym/_emerge/DependencyArg.py b/pym/_emerge/DependencyArg.py
index 861d837..fa1a47f 100644
--- a/pym/_emerge/DependencyArg.py
+++ b/pym/_emerge/DependencyArg.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import sys
@@ -6,6 +6,9 @@ import sys
 from portage import _encodings, _unicode_encode, _unicode_decode
 
 class DependencyArg(object):
+
+	__slots__ = ('arg', 'root_config')
+
 	def __init__(self, arg=None, root_config=None):
 		self.arg = arg
 		self.root_config = root_config

diff --git a/pym/_emerge/SetArg.py b/pym/_emerge/SetArg.py
index 94cf0a6..5c82975 100644
--- a/pym/_emerge/SetArg.py
+++ b/pym/_emerge/SetArg.py
@@ -1,9 +1,12 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.DependencyArg import DependencyArg
 from portage._sets import SETPREFIX
 class SetArg(DependencyArg):
+
+	__slots__ = ('name', 'pset')
+
 	def __init__(self, pset=None, **kwargs):
 		DependencyArg.__init__(self, **kwargs)
 		self.pset = pset



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17 17:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     eb401abc6a140aca85fc93c1744bc371f10ada10
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 17:52:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 17:52:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb401abc

depgraph: use package sets for rebuild/reinstall

---
 pym/_emerge/depgraph.py |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a669166..8aa53aa 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2268,7 +2268,24 @@ class depgraph(object):
 		self._dynamic_config._initial_arg_list = args[:]
 	
 		return self._resolve(myfavorites)
-	
+
+	def _gen_reinstall_sets(self):
+
+		atom_list = []
+		for root, atom in self._rebuild.rebuild_list:
+			atom_list.append((root, '__auto_rebuild__', atom))
+		for root, atom in self._rebuild.reinstall_list:
+			atom_list.append((root, '__auto_reinstall__', atom))
+
+		set_dict = {}
+		for root, set_name, atom in atom_list:
+			set_dict.setdefault((root, set_name), []).append(atom)
+
+		for (root, set_name), atoms in set_dict.items():
+			yield SetArg(arg=(SETPREFIX + set_name),
+				pset=InternalPackageSet(initial_atoms=atoms),
+				root_config=self._frozen_config.roots[root])
+
 	def _resolve(self, myfavorites):
 		"""Given self._dynamic_config._initial_arg_list, pull in the root nodes, 
 		call self._creategraph to process theier deps and return 
@@ -2280,10 +2297,9 @@ class depgraph(object):
 		pprovideddict = pkgsettings.pprovideddict
 		virtuals = pkgsettings.getvirtuals()
 		args = self._dynamic_config._initial_arg_list[:]
-		for root, atom in chain(self._rebuild.rebuild_list,
-			self._rebuild.reinstall_list):
-			args.append(AtomArg(arg=atom, atom=atom,
-				root_config=self._frozen_config.roots[root]))
+
+		args.extend(self._gen_reinstall_sets())
+
 		for arg in self._expand_set_args(args, add_to_digraph=True):
 			for atom in arg.pset.getAtoms():
 				self._spinner_update()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17 19:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17 19:45 UTC (permalink / raw
  To: gentoo-commits

commit:     3534887c798fcdb7c2569cfa0ce1c59c9871e27a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 19:44:56 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 19:44:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3534887c

depgraph._add_pkg: preserve previous pkg depth

---
 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 8aa53aa..963ea0c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1345,6 +1345,8 @@ class depgraph(object):
 		# If we are in --nodeps (no recursion) mode, we obviously only check 1 level of dependencies.
 		if arg_atoms:
 			depth = 0
+		if pkg.depth is not None:
+			depth = min(pkg.depth, depth)
 		pkg.depth = depth
 		deep = self._dynamic_config.myparams.get("deep", 0)
 		recurse = deep is True or depth + 1 <= deep



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-17 19:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-17 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     49ee1ca5ea9868f2f4feefcc9e72edb0dffff4c8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 19:44:56 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 19:47:48 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=49ee1ca5

depgraph._add_pkg: preserve previous pkg depth

---
 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 8aa53aa..9aa9d04 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1345,6 +1345,8 @@ class depgraph(object):
 		# If we are in --nodeps (no recursion) mode, we obviously only check 1 level of dependencies.
 		if arg_atoms:
 			depth = 0
+		if previously_added and pkg.depth is not None:
+			depth = min(pkg.depth, depth)
 		pkg.depth = depth
 		deep = self._dynamic_config.myparams.get("deep", 0)
 		recurse = deep is True or depth + 1 <= deep



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-19  0:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-19  0:40 UTC (permalink / raw
  To: gentoo-commits

commit:     40a8c90fb0d7ba1b057858bf06928f6b19ab1f7f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 19 00:40:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 19 00:40:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=40a8c90f

depgraph: defer slot conflict backtracking

Defer slot conflict backtracking until after _complete_graph is used to
complete the graph, so that all relevant reverse dependencies are
available for making informed backtracking decisions.

---
 pym/_emerge/depgraph.py |  166 +++++++++++++++++++++--------------------------
 1 files changed, 75 insertions(+), 91 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9aa9d04..071d058 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -798,16 +798,26 @@ class depgraph(object):
 			writemsg(line + '\n', noiselevel=-1)
 		writemsg('\n', noiselevel=-1)
 
-	def _process_slot_conflicts(self, root, slot_atom):
+	def _process_slot_conflicts(self):
+		"""
+		If there are any slot conflicts and backtracking is enabled,
+		_complete_graph should complete the graph before this method
+		is called, so that all relevant reverse dependencies are
+		available for use in backtracking decisions.
+		"""
+		for (slot_atom, root), slot_nodes in \
+			self._dynamic_config._slot_collision_info.items():
+			self._process_slot_conflict(root, slot_atom, slot_nodes)
+
+	def _process_slot_conflict(self, root, slot_atom, slot_nodes):
 		"""
 		Process slot conflict data to identify specific atoms which
 		lead to conflict. These atoms only match a subset of the
 		packages that have been pulled into a given slot.
 		"""
-		slot_nodes = \
-			self._dynamic_config._slot_collision_info[(slot_atom, root)]
 
-		conflict_atoms = set()
+		debug = "--debug" in self._frozen_config.myopts
+
 		slot_parent_atoms = set()
 		for pkg in slot_nodes:
 			parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
@@ -815,11 +825,24 @@ class depgraph(object):
 				continue
 			slot_parent_atoms.update(parent_atoms)
 
+		conflict_pkgs = []
 		for pkg in slot_nodes:
+
+			if self._dynamic_config._allow_backtracking and \
+				pkg in self._dynamic_config._runtime_pkg_mask:
+				if debug:
+					writemsg_level(
+						"!!! backtracking loop detected: %s %s\n" % \
+						(pkg,
+						self._dynamic_config._runtime_pkg_mask[pkg]),
+						level=logging.DEBUG, noiselevel=-1)
+
 			parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
 			if parent_atoms is None:
 				parent_atoms = set()
 				self._dynamic_config._parent_atoms[pkg] = parent_atoms
+
+			all_match = True
 			for parent_atom in slot_parent_atoms:
 				if parent_atom in parent_atoms:
 					continue
@@ -832,59 +855,23 @@ class depgraph(object):
 					modified_use=self._pkg_use_enabled(pkg)):
 					parent_atoms.add(parent_atom)
 				else:
-					conflict_atoms.add(parent_atom)
-
-		return conflict_atoms
-
-	def _handle_slot_conflict(self, existing_node, pkg, dep, arg_atoms):
-
-		debug = "--debug" in self._frozen_config.myopts
-		self._add_slot_conflict(pkg)
-
-		if dep.atom is not None and dep.parent is not None:
-			self._add_parent_atom(pkg, (dep.parent, dep.atom))
-
-		if arg_atoms:
-			for parent_atom in arg_atoms:
-				parent, atom = parent_atom
-				self._add_parent_atom(pkg, parent_atom)
-
-		conflict_atoms = \
-			self._process_slot_conflicts(pkg.root, pkg.slot_atom)
-
-		# The existing node should not already be in
-		# runtime_pkg_mask, since that would trigger an
-		# infinite backtracking loop.
-		if self._dynamic_config._allow_backtracking and \
-			existing_node in self._dynamic_config._runtime_pkg_mask:
-			if debug:
-				writemsg_level(
-					"!!! backtracking loop detected: %s %s\n" % \
-					(existing_node,
-					self._dynamic_config._runtime_pkg_mask[existing_node]),
-					level=logging.DEBUG, noiselevel=-1)
-		elif self._dynamic_config._allow_backtracking and \
-			not self._accept_blocker_conflicts() and \
-			not self.need_restart():
-			self._slot_confict_backtrack(existing_node, pkg, conflict_atoms)
-			return False
+					all_match = False
 
-		if debug:
-			writemsg_level(
-				"%s%s %s\n" % ("Slot Conflict:".ljust(15),
-				existing_node, pkg_use_display(existing_node,
-				self._frozen_config.myopts,
-				modified_use=self._pkg_use_enabled(existing_node))),
-				level=logging.DEBUG, noiselevel=-1)
+			if not all_match:
+				conflict_pkgs.append(pkg)
 
-		return True
+		if conflict_pkgs and \
+			self._dynamic_config._allow_backtracking and \
+			not self._accept_blocker_conflicts():
+			self._slot_confict_backtrack(root, slot_atom,
+				slot_parent_atoms, conflict_pkgs)
 
-	def _slot_confict_backtrack(self, existing_node, pkg, conflict_atoms):
+	def _slot_confict_backtrack(self, root, slot_atom,
+		all_parents, conflict_pkgs):
 
 		debug = "--debug" in self._frozen_config.myopts
+		existing_node = self._dynamic_config._slot_pkg_map[root][slot_atom]
 		backtrack_data = []
-		fallback_data = []
-		all_parents = set()
 		# The ordering of backtrack_data can make
 		# a difference here, because both mask actions may lead
 		# to valid, but different, solutions and the one with
@@ -894,40 +881,19 @@ class depgraph(object):
 		# existing_node masked. The backtracker reverses the
 		# order, so the order it uses is the reverse of the
 		# order shown here. See bug #339606.
-		for to_be_selected, to_be_masked in (existing_node, pkg), (pkg, existing_node):
+		if existing_node in conflict_pkgs and \
+			existing_node is not conflict_pkgs[-1]:
+			conflict_pkgs.remove(existing_node)
+			conflict_pkgs.append(existing_node)
+		for to_be_masked in conflict_pkgs:
 			# For missed update messages, find out which
 			# atoms matched to_be_selected that did not
 			# match to_be_masked.
 			parent_atoms = \
-				self._dynamic_config._parent_atoms.get(to_be_selected, set())
-			if parent_atoms:
-				p_conflict_atoms = conflict_atoms.intersection(parent_atoms)
-				if p_conflict_atoms:
-					parent_atoms = p_conflict_atoms
-
-			all_parents.update(parent_atoms)
-
-			all_match = True
-			for parent, atom in parent_atoms:
-				i = InternalPackageSet(initial_atoms=(atom,),
-					allow_repo=True)
-				if not i.findAtomForPackage(to_be_masked):
-					all_match = False
-					break
-
-			fallback_data.append((to_be_masked, parent_atoms))
-
-			if all_match:
-				# 'to_be_masked' does not violate any parent atom, which means
-				# there is no point in masking it.
-				pass
-			else:
-				backtrack_data.append((to_be_masked, parent_atoms))
-
-		if not backtrack_data:
-			# This shouldn't happen, but fall back to the old
-			# behavior if this gets triggered somehow.
-			backtrack_data = fallback_data
+				self._dynamic_config._parent_atoms.get(to_be_masked, set())
+			conflict_atoms = set(parent_atom for parent_atom in all_parents \
+				if parent_atom not in parent_atoms)
+			backtrack_data.append((to_be_masked, conflict_atoms))
 
 		if len(backtrack_data) > 1:
 			# NOTE: Generally, we prefer to mask the higher
@@ -939,24 +905,22 @@ class depgraph(object):
 			# triggered when --update is not enabled.
 			if existing_node.installed:
 				pass
-			elif pkg > existing_node:
+			elif any(pkg > existing_node for pkg in conflict_pkgs):
 				backtrack_data.reverse()
 
 		to_be_masked = backtrack_data[-1][0]
 
-		self._dynamic_config._backtrack_infos["slot conflict"] = backtrack_data
+		self._dynamic_config._backtrack_infos.setdefault(
+			"slot conflict", []).extend(backtrack_data)
 		self._dynamic_config._need_restart = True
 		if debug:
 			msg = []
 			msg.append("")
 			msg.append("")
 			msg.append("backtracking due to slot conflict:")
-			if backtrack_data is fallback_data:
-				msg.append("!!! backtrack_data fallback")
 			msg.append("   first package:  %s" % existing_node)
-			msg.append("   second package: %s" % pkg)
 			msg.append("  package to mask: %s" % to_be_masked)
-			msg.append("      slot: %s" % pkg.slot_atom)
+			msg.append("      slot: %s" % slot_atom)
 			msg.append("   parents: %s" % ", ".join( \
 				"(%s, '%s')" % (ppkg, atom) for ppkg, atom in all_parents))
 			msg.append("")
@@ -1281,10 +1245,15 @@ class depgraph(object):
 								(dep.parent, dep.atom))
 					return 1
 				else:
-					# A slot conflict has occurred. 
-					if not self._handle_slot_conflict(
-						existing_node, pkg, dep, arg_atoms):
-						return False
+					self._add_slot_conflict(pkg)
+					if debug:
+						writemsg_level(
+							"%s%s %s\n" % ("Slot Conflict:".ljust(15),
+							existing_node, pkg_use_display(existing_node,
+							self._frozen_config.myopts,
+							modified_use=self._pkg_use_enabled(existing_node))),
+							level=logging.DEBUG, noiselevel=-1)
+
 					slot_collision = True
 
 			if slot_collision:
@@ -2411,6 +2380,12 @@ class depgraph(object):
 		except self._unknown_internal_error:
 			return False, myfavorites
 
+		if (self._dynamic_config._slot_collision_info and
+			not self._accept_blocker_conflicts()) or \
+			(self._dynamic_config._allow_backtracking and
+			"slot conflict" in self._dynamic_config._backtrack_infos):
+			return False, myfavorites
+
 		digraph_nodes = self._dynamic_config.digraph.nodes
 
 		if any(x in digraph_nodes for x in
@@ -4953,9 +4928,18 @@ class depgraph(object):
 				root_config.root]["root_config"] = root_config
 
 	def _resolve_conflicts(self):
+
+		if "complete" not in self._dynamic_config.myparams and \
+			self._dynamic_config._allow_backtracking and \
+			self._dynamic_config._slot_collision_nodes and \
+			not self._accept_blocker_conflicts():
+			self._dynamic_config.myparams["complete"] = True
+
 		if not self._complete_graph():
 			raise self._unknown_internal_error()
 
+		self._process_slot_conflicts()
+
 		if not self._validate_blockers():
 			self._dynamic_config._skip_restart = True
 			raise self._unknown_internal_error()



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-20  4:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-20  4:55 UTC (permalink / raw
  To: gentoo-commits

commit:     fbc46ae218e70401749f43e5f99a17a0b04a0ff4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 04:30:00 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 04:53:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fbc46ae2

depgraph._iter_atoms_for_pkg: fix for --rebuild-*

The SetArg instances that are generated for --rebuild-if-* behvior need
to be passed into _set_args() in order for _iter_atoms_for_pkg to be
aware of these arguments.

---
 pym/_emerge/DependencyArg.py |   13 ++++++++++---
 pym/_emerge/depgraph.py      |   24 +++++++++++++++++-------
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/pym/_emerge/DependencyArg.py b/pym/_emerge/DependencyArg.py
index fa1a47f..ba36f78 100644
--- a/pym/_emerge/DependencyArg.py
+++ b/pym/_emerge/DependencyArg.py
@@ -7,10 +7,17 @@ from portage import _encodings, _unicode_encode, _unicode_decode
 
 class DependencyArg(object):
 
-	__slots__ = ('arg', 'root_config')
-
-	def __init__(self, arg=None, root_config=None):
+	__slots__ = ('arg', 'force_reinstall', 'reset_depth', 'root_config')
+
+	def __init__(self, arg=None, force_reinstall=False,
+		reset_depth=True, root_config=None):
+		"""
+		Use reset_depth=False for special arguments that should not interact
+		with depth calculations (see the emerge --deep=DEPTH option).
+		"""
 		self.arg = arg
+		self.force_reinstall = force_reinstall
+		self.reset_depth = reset_depth
 		self.root_config = root_config
 
 	def __eq__(self, other):

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 291080a..ad28d69 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1316,8 +1316,12 @@ class depgraph(object):
 		# Installing package A, we need to make sure package A's deps are met.
 		# emerge --deep <pkgspec>; we need to recursively check dependencies of pkgspec
 		# If we are in --nodeps (no recursion) mode, we obviously only check 1 level of dependencies.
-		if arg_atoms:
-			depth = 0
+		if arg_atoms and depth > 0:
+			for parent, atom in arg_atoms:
+				if parent.reset_depth:
+					depth = 0
+					break
+
 		if previously_added and pkg.depth is not None:
 			depth = min(pkg.depth, depth)
 		pkg.depth = depth
@@ -2226,6 +2230,7 @@ class depgraph(object):
 			args = revised_greedy_args
 			del revised_greedy_args
 
+		args.extend(self._gen_reinstall_sets())
 		self._set_args(args)
 
 		myfavorites = set(myfavorites)
@@ -2258,7 +2263,13 @@ class depgraph(object):
 
 		for (root, set_name), atoms in set_dict.items():
 			yield SetArg(arg=(SETPREFIX + set_name),
+				# Set reset_depth=False here, since we don't want these
+				# special sets to interact with depth calculations (see
+				# the emerge --deep=DEPTH option), though we want them
+				# to behave like normal arguments in most other respects.
 				pset=InternalPackageSet(initial_atoms=atoms),
+				force_reinstall=True,
+				reset_depth=False,
 				root_config=self._frozen_config.roots[root])
 
 	def _resolve(self, myfavorites):
@@ -2273,8 +2284,6 @@ class depgraph(object):
 		virtuals = pkgsettings.getvirtuals()
 		args = self._dynamic_config._initial_arg_list[:]
 
-		args.extend(self._gen_reinstall_sets())
-
 		for arg in self._expand_set_args(args, add_to_digraph=True):
 			for atom in arg.pset.getAtoms():
 				self._spinner_update()
@@ -3963,9 +3972,10 @@ class depgraph(object):
 					myarg = None
 					if root == self._frozen_config.target_root:
 						try:
-							myarg = next(self._iter_atoms_for_pkg(pkg))
-						except StopIteration:
-							pass
+							for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg):
+								if myarg.force_reinstall:
+									reinstall = True
+									break
 						except portage.exception.InvalidDependString:
 							if not installed:
 								# masked by corruption



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-20 23:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-20 23:01 UTC (permalink / raw
  To: gentoo-commits

commit:     5d2147c6dab5869ebdd0c27fa2e0b71513057da0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 23:01:01 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 23:01:01 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5d2147c6

depgraph._complete_graph: old virt sanity check

---
 pym/_emerge/depgraph.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ad28d69..0c014bc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4309,9 +4309,11 @@ class depgraph(object):
 				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 or inst_pkg[0] < node):
-					version_change = True
-					break
+				if inst_pkg and inst_pkg[0].cp == node.cp:
+					inst_pkg = inst_pkg[0]
+					if inst_pkg < node or node < inst_pkg:
+						version_change = True
+						break
 
 			if version_change:
 				self._dynamic_config.myparams["complete"] = True



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-21 21:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-21 21:58 UTC (permalink / raw
  To: gentoo-commits

commit:     3767f627d221cfab990482fef5b2336e9e2dbcf5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 21 21:58:02 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 21 21:58:02 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3767f627

action_build: always display_problems

---
 pym/_emerge/actions.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index eaf5a15..aaaf261 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -172,6 +172,7 @@ def action_build(settings, trees, mtimedb,
 	verbose = "--verbose" in myopts
 	quiet = "--quiet" in myopts
 	myparams = create_depgraph_params(myopts, myaction)
+	mergelist_shown = False
 
 	if pretend or fetchonly:
 		# make the mtimedb readonly
@@ -319,6 +320,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=tree),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 			prompt="Would you like to resume merging these packages?"
@@ -327,6 +329,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=("--tree" in myopts)),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 			mergecount=0
@@ -383,6 +386,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=tree),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 		else:
@@ -390,6 +394,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=("--tree" in myopts)),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 			if "--buildpkgonly" in myopts:
@@ -420,6 +425,11 @@ def action_build(settings, trees, mtimedb,
 				print("!!! Cannot merge requested packages. Merge deps and try again.\n")
 				return 1
 
+		if not mergelist_shown:
+			# If we haven't already shown the merge list above, at
+			# least show warnings about missed updates an such.
+			mydepgraph.display_problems()
+
 		if ("--resume" in myopts):
 			favorites=mtimedb["resume"]["favorites"]
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-21 22:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-21 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     3af7776a79fed618a9111d41e0c835deb02f960a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 21 21:58:02 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 21 22:17:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3af7776a

action_build: always display_problems

---
 pym/_emerge/actions.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index eaf5a15..a689b7b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -172,6 +172,7 @@ def action_build(settings, trees, mtimedb,
 	verbose = "--verbose" in myopts
 	quiet = "--quiet" in myopts
 	myparams = create_depgraph_params(myopts, myaction)
+	mergelist_shown = False
 
 	if pretend or fetchonly:
 		# make the mtimedb readonly
@@ -319,6 +320,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=tree),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 			prompt="Would you like to resume merging these packages?"
@@ -327,6 +329,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=("--tree" in myopts)),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 			mergecount=0
@@ -383,6 +386,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=tree),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 		else:
@@ -390,6 +394,7 @@ def action_build(settings, trees, mtimedb,
 				mydepgraph.altlist(reversed=("--tree" in myopts)),
 				favorites=favorites)
 			mydepgraph.display_problems()
+			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
 			if "--buildpkgonly" in myopts:
@@ -420,6 +425,11 @@ def action_build(settings, trees, mtimedb,
 				print("!!! Cannot merge requested packages. Merge deps and try again.\n")
 				return 1
 
+		if not mergelist_shown:
+			# If we haven't already shown the merge list above, at
+			# least show warnings about missed updates and such.
+			mydepgraph.display_problems()
+
 		if ("--resume" in myopts):
 			favorites=mtimedb["resume"]["favorites"]
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-22  7:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-22  7:18 UTC (permalink / raw
  To: gentoo-commits

commit:     003e95562216045408d8d2dd09afeac2311383fc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 07:18:11 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 07:18:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=003e9556

getportageversion: handle repo: in parent file

---
 pym/_emerge/actions.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a689b7b..7ad28e6 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2807,6 +2807,7 @@ def relative_profile_path(portdir, abs_profile):
 
 def getportageversion(portdir, _unused, profile, chost, vardb):
 	profilever = None
+	repositories = vardb.settings.repositories
 	if profile:
 		profilever = relative_profile_path(portdir, profile)
 		if profilever is None:
@@ -2817,6 +2818,20 @@ def getportageversion(portdir, _unused, profile, chost, vardb):
 						os.path.join(profile, parent))
 					if profilever is not None:
 						break
+					colon = parent.find(":")
+					if colon != -1:
+						p_repo_name = parent[:colon]
+						try:
+							p_repo_loc = \
+								repositories.get_location_for_name(p_repo_name)
+						except KeyError:
+							pass
+						else:
+							profilever = relative_profile_path(p_repo_loc,
+								os.path.join(p_repo_loc, 'profiles',
+									parent[colon+1:]))
+							if profilever is not None:
+								break
 			except portage.exception.PortageException:
 				pass
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23  1:23 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23  1:23 UTC (permalink / raw
  To: gentoo-commits

commit:     165ba13a74452fe52b24f5dd3724fe48190f3234
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 01:23:20 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 01:23:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=165ba13a

Package: save validated_atoms as tuple

---
 pym/_emerge/Package.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 7bf7181..14d0694 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -185,8 +185,8 @@ class Package(Task):
 			except InvalidDependString as e:
 				self._metadata_exception(k, e)
 
-		self._validated_atoms = frozenset(atom for atom in
-			validated_atoms if isinstance(atom, Atom))
+		self._validated_atoms = tuple(set(atom for atom in
+			validated_atoms if isinstance(atom, Atom)))
 
 		k = 'PROVIDE'
 		v = self.metadata.get(k)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23  2:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23  2:35 UTC (permalink / raw
  To: gentoo-commits

commit:     04f6d3402f671aae275a0408ee2a6cdd9cd74e7a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 02:35:42 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 02:35:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04f6d340

depgraph: fix bugs in force_reinstall handling

---
 pym/_emerge/depgraph.py |   86 ++++++++++++++++++++--------------------------
 1 files changed, 37 insertions(+), 49 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 92c1061..b3ea964 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1849,16 +1849,11 @@ class depgraph(object):
 				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:
-						myarg = next(self._iter_atoms_for_pkg(dep.child))
-					except StopIteration:
-						pass
-					except InvalidDependString:
-						if not dep.child.installed:
-							# This shouldn't happen since the package
-							# should have been masked.
-							raise
+				try:
+					myarg = next(self._iter_atoms_for_pkg(dep.child), None)
+				except InvalidDependString:
+					if not dep.child.installed:
+						raise
 
 				if myarg is None:
 					# Existing child selection may not be valid unless
@@ -1964,14 +1959,11 @@ class depgraph(object):
 					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:
-							myarg = next(self._iter_atoms_for_pkg(dep.child))
-						except StopIteration:
-							pass
-						except InvalidDependString:
-							if not dep.child.installed:
-								raise
+					try:
+						myarg = next(self._iter_atoms_for_pkg(dep.child), None)
+					except InvalidDependString:
+						if not dep.child.installed:
+							raise
 
 					if myarg is None:
 						ignored = True
@@ -3782,20 +3774,22 @@ class depgraph(object):
 		True if the user has not explicitly requested for this package
 		to be replaced (typically via an atom on the command line).
 		"""
-		if "selective" not in self._dynamic_config.myparams and \
-			pkg.root == self._frozen_config.target_root:
-			if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
-				modified_use=self._pkg_use_enabled(pkg)):
-				return True
-			try:
-				next(self._iter_atoms_for_pkg(pkg))
-			except StopIteration:
-				pass
-			except portage.exception.InvalidDependString:
-				pass
-			else:
-				return False
-		return True
+		if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
+			modified_use=self._pkg_use_enabled(pkg)):
+			return True
+
+		arg = False
+		try:
+			for arg, atom in self._iter_atoms_for_pkg(pkg):
+				if arg.force_reinstall:
+					return False
+		except InvalidDependString:
+			pass
+
+		if "selective" in self._dynamic_config.myparams:
+			return True
+
+		return not arg
 
 	class _AutounmaskLevel(object):
 		__slots__ = ("allow_use_changes", "allow_unstable_keywords", "allow_license_changes", \
@@ -4249,16 +4243,15 @@ class depgraph(object):
 					# above visibility checks are complete.
 
 					myarg = None
-					if root == self._frozen_config.target_root:
-						try:
-							for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg):
-								if myarg.force_reinstall:
-									reinstall = True
-									break
-						except portage.exception.InvalidDependString:
-							if not installed:
-								# masked by corruption
-								continue
+					try:
+						for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg):
+							if myarg.force_reinstall:
+								reinstall = True
+								break
+					except InvalidDependString:
+						if not installed:
+							# masked by corruption
+							continue
 					if not installed and myarg:
 						found_available_arg = True
 
@@ -7107,13 +7100,8 @@ class _dep_check_composite_db(dbapi):
 		return ret[:]
 
 	def _visible(self, pkg):
-		if pkg.installed and "selective" not in self._depgraph._dynamic_config.myparams:
-			try:
-				arg = next(self._depgraph._iter_atoms_for_pkg(pkg))
-			except (StopIteration, portage.exception.InvalidDependString):
-				arg = None
-			if arg:
-				return False
+		if pkg.installed and not self._depgraph._want_installed_pkg(pkg):
+			return False
 		if pkg.installed and \
 			(pkg.masks or not self._depgraph._pkg_visibility_check(pkg)):
 			# Account for packages with masks (like KEYWORDS masks)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23  2:47 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23  2:47 UTC (permalink / raw
  To: gentoo-commits

commit:     95193ff95c8268bdd61824214122c972940fdea2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 02:46:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 02:46:52 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=95193ff9

_slot_abi_update_probe: respect --exclude

---
 pym/_emerge/depgraph.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b3ea964..a2654aa 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1032,6 +1032,16 @@ class depgraph(object):
 			downgrade would be desirable is not implemented.
 		"""
 
+		if dep.child.installed and \
+			self._frozen_config.excluded_pkgs.findAtomForPackage(dep.child,
+			modified_use=self._pkg_use_enabled(dep.child)):
+			return None
+
+		if dep.parent.installed and \
+			self._frozen_config.excluded_pkgs.findAtomForPackage(dep.parent,
+			modified_use=self._pkg_use_enabled(dep.parent)):
+			return None
+
 		debug = "--debug" in self._frozen_config.myopts
 
 		for replacement_parent in self._iter_similar_available(dep.parent,



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23  3:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23  3:01 UTC (permalink / raw
  To: gentoo-commits

commit:     fa68712ab045dce1d0e50d9252e02329d2d9f75b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 03:01:43 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 03:01:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fa68712a

depgraph: fix broken _complete_mode assignment

---
 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 a2654aa..039dbdc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4626,7 +4626,7 @@ class depgraph(object):
 		# scheduled for replacement. Also, toggle the "deep"
 		# parameter so that all dependencies are traversed and
 		# accounted for.
-		self._complete_mode = True
+		self._dynamic_config._complete_mode = True
 		self._select_atoms = self._select_atoms_from_graph
 		if "remove" in self._dynamic_config.myparams:
 			self._select_package = self._select_pkg_from_installed



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23  5:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23  5:10 UTC (permalink / raw
  To: gentoo-commits

commit:     5497c9f1443f1f615f145ee645f17959ed20168c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 05:10:14 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 05:10:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5497c9f1

Fix success_without_autounmask logic wrt rebuilds

---
 pym/_emerge/depgraph.py |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 039dbdc..75e3500 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2658,20 +2658,6 @@ class depgraph(object):
 			"slot conflict" in self._dynamic_config._backtrack_infos):
 			return False, myfavorites
 
-		digraph_nodes = self._dynamic_config.digraph.nodes
-
-		if any(x in digraph_nodes for x in
-			self._dynamic_config._needed_unstable_keywords) or \
-			any(x in digraph_nodes for x in
-			self._dynamic_config._needed_p_mask_changes) or \
-			any(x in digraph_nodes for x in
-			self._dynamic_config._needed_use_config_changes) or \
-			any(x in digraph_nodes for x in
-			self._dynamic_config._needed_license_changes) :
-			#We failed if the user needs to change the configuration
-			self._dynamic_config._success_without_autounmask = True
-			return False, myfavorites
-
 		if self._rebuild.trigger_rebuilds():
 			backtrack_infos = self._dynamic_config._backtrack_infos
 			config = backtrack_infos.setdefault("config", {})
@@ -2686,6 +2672,26 @@ class depgraph(object):
 			self.need_restart():
 			return False, myfavorites
 
+		# Any failures except those due to autounmask *alone* should return
+		# before this point, since the success_without_autounmask flag that's
+		# set below is reserved for cases where there are *zero* other
+		# problems. For reference, see backtrack_depgraph, where it skips the
+		# get_best_run() call when success_without_autounmask is True.
+
+		digraph_nodes = self._dynamic_config.digraph.nodes
+
+		if any(x in digraph_nodes for x in
+			self._dynamic_config._needed_unstable_keywords) or \
+			any(x in digraph_nodes for x in
+			self._dynamic_config._needed_p_mask_changes) or \
+			any(x in digraph_nodes for x in
+			self._dynamic_config._needed_use_config_changes) or \
+			any(x in digraph_nodes for x in
+			self._dynamic_config._needed_license_changes) :
+			#We failed if the user needs to change the configuration
+			self._dynamic_config._success_without_autounmask = True
+			return False, myfavorites
+
 		# We're true here unless we are missing binaries.
 		return (True, myfavorites)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23  6:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23  6:38 UTC (permalink / raw
  To: gentoo-commits

commit:     f526e28f6151611a51a858c87ac2319e48f54e7f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 06:38:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 06:38:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f526e28f

slot_abi_mask_built: fix __eq__ for backtracking

---
 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 07d30e6..bdab7a6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1007,9 +1007,9 @@ class depgraph(object):
 		abi_masks = {}
 		if new_child_slot is None:
 			if not child.installed:
-				abi_masks.setdefault(child, {})["slot_abi_mask_built"] = dep
+				abi_masks.setdefault(child, {})["slot_abi_mask_built"] = None
 		if not dep.parent.installed:
-			abi_masks.setdefault(dep.parent, {})["slot_abi_mask_built"] = dep
+			abi_masks.setdefault(dep.parent, {})["slot_abi_mask_built"] = None
 		if abi_masks:
 			config.setdefault("slot_abi_mask_built", {}).update(abi_masks)
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-23 20:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-23 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     fc371676a0eb555321a77207321bdeab6e746c87
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 20:03:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 20:03:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc371676

Fix debug message wording of "to due".

---
 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 bdab7a6..480cb90 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -991,7 +991,7 @@ class depgraph(object):
 			msg = []
 			msg.append("")
 			msg.append("")
-			msg.append("backtracking to due missed slot abi update:")
+			msg.append("backtracking due to missed slot abi update:")
 			msg.append("   child package:  %s" % child)
 			if new_child_slot is not None:
 				msg.append("   new child slot package:  %s" % new_child_slot)



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-06-24  8:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-06-24  8:18 UTC (permalink / raw
  To: gentoo-commits

commit:     fe03b5fd790fc09bd6594c55bb174e80aaac1e5a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 24 08:18:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 24 08:18:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe03b5fd

PollScheduler: schedule inside loop if max_load

This will fix a case like that reported in bug #403895, triggered when
the --load-average option is used.

---
 pym/_emerge/PollScheduler.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 965dc20..5103e31 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -148,15 +148,22 @@ class PollScheduler(object):
 	def _main_loop(self):
 		term_check_id = self.sched_iface.idle_add(self._termination_check)
 		try:
-			# Populate initial event sources. We only need to do
-			# this once here, since it can be called during the
-			# loop from within event handlers.
+			# Populate initial event sources. Unless we're scheduling
+			# based on load average, we only need to do this once
+			# here, since it can be called during the loop from within
+			# event handlers.
 			self._schedule()
+			max_load = self._max_load
 
 			# Loop while there are jobs to be scheduled.
 			while self._keep_scheduling():
 				self.sched_iface.iteration()
 
+				if max_load is not None:
+					# We have to schedule periodically, in case the load
+					# average has changed since the last call.
+					self._schedule()
+
 			# Clean shutdown of previously scheduled jobs. In the
 			# case of termination, this allows for basic cleanup
 			# such as flushing of buffered output to logs.



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-07-03 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-07-03 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     f736935de2bb1370524302d9cfe915c16d922bb9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  3 21:52:20 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul  3 21:52:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f736935d

emerge: more helpful "non-existent set" message

---
 pym/_emerge/main.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 3540138..2a0e67f 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1494,6 +1494,12 @@ def expand_set_arguments(myfiles, myaction, root_config):
 					writemsg_level(("emerge: the given set '%s' " + \
 						"contains a non-existent set named '%s'.\n") % \
 						(s, e), level=logging.ERROR, noiselevel=-1)
+					if s in ('world', 'selected') and \
+						SETPREFIX + e.value in sets['selected']:
+						writemsg_level(("Use `emerge --deselect %s%s` to "
+							"remove this set from world_sets.\n") %
+							(SETPREFIX, e,), level=logging.ERROR,
+							noiselevel=-1)
 					return (None, 1)
 				if myaction in unmerge_actions and \
 						not sets[s].supportsOperation("unmerge"):



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-07-10 22:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-07-10 22:50 UTC (permalink / raw
  To: gentoo-commits

commit:     fdda543b51dde02483a40b9f867a35fc3521a135
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 10 22:50:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 10 22:50:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fdda543b

Fix --complete-graph-if-new-use for --autounmask.

---
 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 703720c..552d578 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4679,8 +4679,8 @@ class depgraph(object):
 						# to use.mask/force changes in the profile.
 						if complete_if_new_use and \
 							(node.iuse.all != inst_pkg.iuse.all or
-							node.use.enabled.intersection(node.iuse.all) !=
-							inst_pkg.use.enabled.intersection(inst_pkg.iuse.all)):
+							self._pkg_use_enabled(node).intersection(node.iuse.all) !=
+							self._pkg_use_enabled(inst_pkg).intersection(inst_pkg.iuse.all)):
 							use_change = True
 							break
 



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-07-18 17:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-07-18 17:19 UTC (permalink / raw
  To: gentoo-commits

commit:     ed4e91f0473b5cfcbb1d6de22991bbf3e270a6e3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 18 17:19:07 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul 18 17:19:07 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ed4e91f0

depgraph: __auto_rebuild__ KeyError, bug #427036

---
 pym/_emerge/DependencyArg.py |    5 +++--
 pym/_emerge/depgraph.py      |    7 ++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/DependencyArg.py b/pym/_emerge/DependencyArg.py
index ba36f78..80134c8 100644
--- a/pym/_emerge/DependencyArg.py
+++ b/pym/_emerge/DependencyArg.py
@@ -7,9 +7,9 @@ from portage import _encodings, _unicode_encode, _unicode_decode
 
 class DependencyArg(object):
 
-	__slots__ = ('arg', 'force_reinstall', 'reset_depth', 'root_config')
+	__slots__ = ('arg', 'force_reinstall', 'internal', 'reset_depth', 'root_config')
 
-	def __init__(self, arg=None, force_reinstall=False,
+	def __init__(self, arg=None, force_reinstall=False, internal=False,
 		reset_depth=True, root_config=None):
 		"""
 		Use reset_depth=False for special arguments that should not interact
@@ -17,6 +17,7 @@ class DependencyArg(object):
 		"""
 		self.arg = arg
 		self.force_reinstall = force_reinstall
+		self.internal = internal
 		self.reset_depth = reset_depth
 		self.root_config = root_config
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 552d578..0f3bc93 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2533,7 +2533,8 @@ class depgraph(object):
 			if isinstance(arg, (AtomArg, PackageArg)):
 				myfavorites.add(arg.atom)
 			elif isinstance(arg, SetArg):
-				myfavorites.add(arg.arg)
+				if not arg.internal:
+					myfavorites.add(arg.arg)
 		myfavorites = list(myfavorites)
 
 		if debug:
@@ -2566,6 +2567,7 @@ class depgraph(object):
 				# to behave like normal arguments in most other respects.
 				pset=InternalPackageSet(initial_atoms=atoms),
 				force_reinstall=True,
+				internal=True,
 				reset_depth=False,
 				root_config=self._frozen_config.roots[root])
 
@@ -6793,6 +6795,9 @@ class depgraph(object):
 				continue
 			if arg.root_config.root != root_config.root:
 				continue
+			if arg.internal:
+				# __auto_* sets
+				continue
 			k = arg.name
 			if k in ("selected", "world") or \
 				not root_config.sets[k].world_candidate:



^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-08-20 20:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-08-20 20:38 UTC (permalink / raw
  To: gentoo-commits

commit:     31b41fe7a20e6e0d19ff2383a746d61d8aa18b50
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 20 20:37:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 20 20:37:53 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=31b41fe7

Scheduler: only use poll timeout when needed

This avoids wasteful CPU consumption, as reported in bug #432024.

---
 pym/_emerge/Scheduler.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 0b72a4c..d40cedd 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1351,8 +1351,10 @@ class Scheduler(PollScheduler):
 		failed_pkgs = self._failed_pkgs
 		portage.locks._quiet = self._background
 		portage.elog.add_listener(self._elog_listener)
-		display_timeout_id = self.sched_iface.timeout_add(
-			self._max_display_latency, self._status_display.display)
+		display_timeout_id = None
+		if self._status_display._isatty and not self._status_display.quiet:
+			display_timeout_id = self.sched_iface.timeout_add(
+				self._max_display_latency, self._status_display.display)
 		rval = os.EX_OK
 
 		try:
@@ -1361,7 +1363,8 @@ class Scheduler(PollScheduler):
 			self._main_loop_cleanup()
 			portage.locks._quiet = False
 			portage.elog.remove_listener(self._elog_listener)
-			self.sched_iface.source_remove(display_timeout_id)
+			if display_timeout_id is not None:
+				self.sched_iface.source_remove(display_timeout_id)
 			if failed_pkgs:
 				rval = failed_pkgs[-1].returncode
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-08-21  3:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-08-21  3:29 UTC (permalink / raw
  To: gentoo-commits

commit:     b696337bf20fdc539ce7721df7a4b42b35999705
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 21 03:29:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 21 03:29:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b696337b

PollScheduler: use timeout for loadavg checks

This ensures that the code from commit
fe03b5fd790fc09bd6594c55bb174e80aaac1e5a behaves correctly even when
there are no poll events arriving for a long time (which might happen
if the running builds don't produce output for a long time).

---
 pym/_emerge/PollScheduler.py |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 5103e31..808fa6e 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -20,6 +20,9 @@ from _emerge.getloadavg import getloadavg
 
 class PollScheduler(object):
 
+	# max time between loadavg checks (milliseconds)
+	_loadavg_latency = 30000
+
 	class _sched_iface_class(SlotObject):
 		__slots__ = ("IO_ERR", "IO_HUP", "IO_IN", "IO_NVAL", "IO_OUT",
 			"IO_PRI", "child_watch_add",
@@ -147,23 +150,24 @@ class PollScheduler(object):
 
 	def _main_loop(self):
 		term_check_id = self.sched_iface.idle_add(self._termination_check)
+		loadavg_check_id = None
+		if self._max_load is not None:
+			# We have to schedule periodically, in case the load
+			# average has changed since the last call.
+			loadavg_check_id = self.sched_iface.timeout_add(
+				self._loadavg_latency, self._schedule)
+
 		try:
 			# Populate initial event sources. Unless we're scheduling
 			# based on load average, we only need to do this once
 			# here, since it can be called during the loop from within
 			# event handlers.
 			self._schedule()
-			max_load = self._max_load
 
 			# Loop while there are jobs to be scheduled.
 			while self._keep_scheduling():
 				self.sched_iface.iteration()
 
-				if max_load is not None:
-					# We have to schedule periodically, in case the load
-					# average has changed since the last call.
-					self._schedule()
-
 			# Clean shutdown of previously scheduled jobs. In the
 			# case of termination, this allows for basic cleanup
 			# such as flushing of buffered output to logs.
@@ -171,6 +175,8 @@ class PollScheduler(object):
 				self.sched_iface.iteration()
 		finally:
 			self.sched_iface.source_remove(term_check_id)
+			if loadavg_check_id is not None:
+				self.sched_iface.source_remove(loadavg_check_id)
 
 	def _is_work_scheduled(self):
 		return bool(self._running_job_count())


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-08-22 21:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-08-22 21:12 UTC (permalink / raw
  To: gentoo-commits

commit:     5335ccb6558f22ddc926714dcba4443cc7333b6a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 22 21:12:31 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 22 21:12:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5335ccb6

Optimize sys.std* flush code.

---
 pym/_emerge/EbuildMetadataPhase.py |    5 +++--
 pym/_emerge/SpawnProcess.py        |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index d49c51f..9ab03e2 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -78,11 +78,12 @@ class EbuildMetadataPhase(SubProcess):
 		fd_pipes.setdefault(2, sys.__stderr__.fileno())
 
 		# flush any pending output
+		stdout_filenos = (sys.__stdout__.fileno(), sys.__stderr__.fileno())
 		for fd in fd_pipes.values():
-			if fd == sys.__stdout__.fileno():
+			if fd in stdout_filenos:
 				sys.__stdout__.flush()
-			if fd == sys.__stderr__.fileno():
 				sys.__stderr__.flush()
+				break
 
 		self._files = self._files_dict()
 		files = self._files

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index dfcf088..c7863c1 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -67,11 +67,12 @@ class SpawnProcess(SubProcess):
 		fd_pipes.setdefault(2, sys.__stderr__.fileno())
 
 		# flush any pending output
+		stdout_filenos = (sys.__stdout__.fileno(), sys.__stderr__.fileno())
 		for fd in fd_pipes.values():
-			if fd == sys.__stdout__.fileno():
+			if fd in stdout_filenos:
 				sys.__stdout__.flush()
-			if fd == sys.__stderr__.fileno():
 				sys.__stderr__.flush()
+				break
 
 		if logfile is not None:
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-08-28  3:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-08-28  3:20 UTC (permalink / raw
  To: gentoo-commits

commit:     1db6048f29dad8da5c74da3143901edd006fc10a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 28 03:19:58 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 28 03:19:58 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1db6048f

Package: skip REQUIRED_USE validation if built

---
 pym/_emerge/Package.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 2087cbf..0da374a 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -221,7 +221,7 @@ class Package(Task):
 
 		k = 'REQUIRED_USE'
 		v = self.metadata.get(k)
-		if v:
+		if v and not self.built:
 			if not _get_eapi_attrs(eapi).required_use:
 				self._invalid_metadata('EAPI.incompatible',
 					"REQUIRED_USE set, but EAPI='%s' doesn't allow it" % eapi)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-04  3:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-04  3:07 UTC (permalink / raw
  To: gentoo-commits

commit:     ed68a1bdb22fec478ac39b377961508cd3a30617
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  4 03:07:29 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  4 03:07:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ed68a1bd

EbuildBuildDir: ignore rmdir failure, bug #400641

---
 pym/_emerge/EbuildBuildDir.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/EbuildBuildDir.py b/pym/_emerge/EbuildBuildDir.py
index 9773bd7..5d6a262 100644
--- a/pym/_emerge/EbuildBuildDir.py
+++ b/pym/_emerge/EbuildBuildDir.py
@@ -7,7 +7,6 @@ import portage
 from portage import os
 from portage.exception import PortageException
 from portage.util.SlotObject import SlotObject
-import errno
 
 class EbuildBuildDir(SlotObject):
 
@@ -98,10 +97,8 @@ class EbuildBuildDir(SlotObject):
 		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
+			except OSError:
+				pass
 			finally:
 				catdir_lock.unlock()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-04  3:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-04  3:28 UTC (permalink / raw
  To: gentoo-commits

commit:     12c142c529909acf1b755690404cef51d8de3fe4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  4 03:28:25 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  4 03:28:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12c142c5

Deprecate @installed for bug #387059.

---
 pym/_emerge/main.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 049c3ec..aff1d37 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1481,6 +1481,12 @@ def expand_set_arguments(myfiles, myaction, root_config):
 				if s not in sets:
 					display_missing_pkg_set(root_config, s)
 					return (None, 1)
+				if s == "installed":
+					msg = ("The @installed set is deprecated and will soon be "
+					"removed. Please refer to bug #387059 for details.")
+					out = portage.output.EOutput()
+					for line in textwrap.wrap(msg, 50):
+						out.ewarn(line)
 				setconfig.active.append(s)
 				try:
 					set_atoms = setconfig.getSetAtoms(s)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-09  0:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-09  0:54 UTC (permalink / raw
  To: gentoo-commits

commit:     7a54703a8b28326bd428327f68e726238eba02df
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  9 00:54:10 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  9 00:54:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a54703a

EbuildPhase: bump WORKDIR timestamp after unpack

This will fix bug #332217.

---
 pym/_emerge/EbuildPhase.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index fe44abc..c4881d4 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -1,10 +1,11 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import gzip
 import io
 import sys
 import tempfile
+import time
 
 from _emerge.AsynchronousLock import AsynchronousLock
 from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
@@ -213,7 +214,13 @@ class EbuildPhase(CompositeTask):
 		settings = self.settings
 		_post_phase_userpriv_perms(settings)
 
-		if self.phase == "install":
+		if self.phase == "unpack":
+			# Bump WORKDIR timestamp, in case tar gave it a timestamp
+			# that will interfere with distfiles / WORKDIR timestamp
+			# comparisons as reported in bug #332217.
+			timestamp = time.time()
+			os.utime(settings["WORKDIR"], (timestamp, timestamp))
+		elif self.phase == "install":
 			out = io.StringIO()
 			_post_src_install_write_metadata(settings)
 			_post_src_install_uid_fix(settings, out)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-09  1:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-09  1:07 UTC (permalink / raw
  To: gentoo-commits

commit:     c62331ea1bc831d68d205466b379eda72dbbcaa1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  9 01:07:16 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep  9 01:07:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c62331ea

EbuildPhase: simplify utime args

---
 pym/_emerge/EbuildPhase.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index c4881d4..84e8018 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -5,7 +5,6 @@ import gzip
 import io
 import sys
 import tempfile
-import time
 
 from _emerge.AsynchronousLock import AsynchronousLock
 from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
@@ -218,8 +217,7 @@ class EbuildPhase(CompositeTask):
 			# Bump WORKDIR timestamp, in case tar gave it a timestamp
 			# that will interfere with distfiles / WORKDIR timestamp
 			# comparisons as reported in bug #332217.
-			timestamp = time.time()
-			os.utime(settings["WORKDIR"], (timestamp, timestamp))
+			os.utime(settings["WORKDIR"], None)
 		elif self.phase == "install":
 			out = io.StringIO()
 			_post_src_install_write_metadata(settings)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-10 16:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-10 16:41 UTC (permalink / raw
  To: gentoo-commits

commit:     8dbf44f4ca3390d2232b83de52dd630a47126a5e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 16:40:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 16:40:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8dbf44f4

Improve ignored binpkg display for bug #434540.

---
 pym/_emerge/depgraph.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3b0f4a6..e388065 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -613,11 +613,17 @@ class depgraph(object):
 				"due to non matching USE:\n\n", noiselevel=-1)
 
 		for pkg, flags in self._dynamic_config.ignored_binaries.items():
-			writemsg("    =%s" % pkg.cpv, noiselevel=-1)
+			flag_display = []
+			for flag in sorted(flags):
+				if flag not in pkg.use.enabled:
+					flag = "-" + flag
+				flag_display.append(flag)
+			flag_display = " ".join(flag_display)
+			# The user can paste this line into package.use
+			writemsg("    =%s %s" % (pkg.cpv, flag_display), noiselevel=-1)
 			if pkg.root_config.settings["ROOT"] != "/":
-				writemsg(" for %s" % (pkg.root,), noiselevel=-1)
-			writemsg("\n        use flag(s): %s\n" % ", ".join(sorted(flags)),
-				noiselevel=-1)
+				writemsg(" # for %s" % (pkg.root,), noiselevel=-1)
+			writemsg("\n", noiselevel=-1)
 
 		msg = [
 			"",


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-12  6:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-12  6:48 UTC (permalink / raw
  To: gentoo-commits

commit:     ea54077b59d2aec35add5c3f6779b6772f3127a5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 00:30:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 12 06:45:52 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ea54077b

EbuildPhase: fix WORKDIR owner after unpack

See bug #332217, comment #24.

---
 pym/_emerge/EbuildPhase.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 84e8018..61e9a6f 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -11,6 +11,7 @@ from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
 from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
 from _emerge.EbuildProcess import EbuildProcess
 from _emerge.CompositeTask import CompositeTask
+from portage.package.ebuild.prepare_build_dirs import _prepare_workdir
 from portage.util import writemsg
 
 try:
@@ -216,8 +217,10 @@ class EbuildPhase(CompositeTask):
 		if self.phase == "unpack":
 			# Bump WORKDIR timestamp, in case tar gave it a timestamp
 			# that will interfere with distfiles / WORKDIR timestamp
-			# comparisons as reported in bug #332217.
+			# comparisons as reported in bug #332217. Also, fix
+			# ownership since tar can change that too.
 			os.utime(settings["WORKDIR"], None)
+			_prepare_workdir(settings)
 		elif self.phase == "install":
 			out = io.StringIO()
 			_post_src_install_write_metadata(settings)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-16 20:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-16 20:02 UTC (permalink / raw
  To: gentoo-commits

commit:     db74640678f445f768922046bfe5d87c4822e249
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 16 20:02:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 16 20:02:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=db746406

repoman: reject "built" slot-operator atoms

---
 pym/_emerge/Package.py |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 957d5d3..e10140f 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -12,6 +12,7 @@ from portage.dep import Atom, check_required_use, use_reduce, \
 from portage.versions import _pkg_str, _unknown_repo
 from portage.eapi import _get_eapi_attrs
 from portage.exception import InvalidDependString
+from portage.localization import _
 from _emerge.Task import Task
 
 if sys.hexversion >= 0x3000000:
@@ -197,11 +198,23 @@ class Package(Task):
 			if not v:
 				continue
 			try:
-				validated_atoms.extend(use_reduce(v, eapi=dep_eapi,
+				atoms = use_reduce(v, eapi=dep_eapi,
 					matchall=True, is_valid_flag=dep_valid_flag,
-					token_class=Atom, flat=True))
+					token_class=Atom, flat=True)
 			except InvalidDependString as e:
 				self._metadata_exception(k, e)
+			else:
+				validated_atoms.extend(atoms)
+				if not self.built:
+					for atom in atoms:
+						if not isinstance(atom, Atom):
+							continue
+						if atom.slot_operator_built:
+							e = InvalidDependString(
+								_("Improper context for slot-operator "
+								"\"built\" atom syntax: %s") %
+								(atom.unevaluated_atom,))
+							self._metadata_exception(k, e)
 
 		self._validated_atoms = tuple(set(atom for atom in
 			validated_atoms if isinstance(atom, Atom)))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-09-26  3:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-09-26  3:31 UTC (permalink / raw
  To: gentoo-commits

commit:     a155c609ac8cac92e9a04f6ca47c8e6a9df97055
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 03:28:24 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 03:28:24 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a155c609

Use constants for more hardcoded *DEPEND lists.

---
 pym/_emerge/BlockerDB.py |    5 +++--
 pym/_emerge/depgraph.py  |    6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index 459affd..8832033 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import sys
@@ -9,6 +9,7 @@ from portage import digraph
 from portage._sets.base import InternalPackageSet
 
 from _emerge.BlockerCache import BlockerCache
+from _emerge.Package import Package
 from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
 
 if sys.hexversion >= 0x3000000:
@@ -38,7 +39,7 @@ class BlockerDB(object):
 		"""
 		blocker_cache = BlockerCache(None,
 			self._vartree.dbapi)
-		dep_keys = ["RDEPEND", "PDEPEND"]
+		dep_keys = Package._runtime_keys
 		settings = self._vartree.settings
 		stale_cache = set(blocker_cache)
 		fake_vartree = self._fake_vartree

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4d731fb..1588f2c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3106,7 +3106,7 @@ class depgraph(object):
 
 		if target_atom is not None and isinstance(node, Package):
 			affecting_use = set()
-			for dep_str in "DEPEND", "RDEPEND", "PDEPEND", "HDEPEND":
+			for dep_str in Package._dep_keys:
 				try:
 					affecting_use.update(extract_affecting_use(
 						node.metadata[dep_str], target_atom,
@@ -4138,7 +4138,7 @@ class depgraph(object):
 			if pkg not in self._dynamic_config.digraph.nodes:
 				return False
 
-			for key in "DEPEND", "RDEPEND", "PDEPEND", "HDEPEND", "LICENSE":
+			for key in Package._dep_keys + ("LICENSE",):
 				dep = pkg.metadata[key]
 				old_val = set(portage.dep.use_reduce(dep, pkg.use.enabled, is_valid_flag=pkg.iuse.is_valid_flag, flat=True))
 				new_val = set(portage.dep.use_reduce(dep, new_use, is_valid_flag=pkg.iuse.is_valid_flag, flat=True))
@@ -4898,7 +4898,7 @@ class depgraph(object):
 			# For installed packages, always ignore blockers from DEPEND since
 			# only runtime dependencies should be relevant for packages that
 			# are already built.
-			dep_keys = ["RDEPEND", "PDEPEND"]
+			dep_keys = Package._runtime_keys
 			for myroot in self._frozen_config.trees:
 
 				if self._frozen_config.myopts.get("--root-deps") is not None and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-03  2:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-03  2:43 UTC (permalink / raw
  To: gentoo-commits

commit:     1ed9164f6fa6f09d9b26c9aa0187c13bbeebc17b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  3 02:43:12 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct  3 02:43:12 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ed9164f

Fix emerge <tbz2> for python3.

---
 pym/_emerge/depgraph.py |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b4c799e..3940b56 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2297,8 +2297,18 @@ class depgraph(object):
 						writemsg("!!! Please ensure the tbz2 exists as specified.\n\n", noiselevel=-1)
 						return 0, myfavorites
 				mytbz2=portage.xpak.tbz2(x)
-				mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.splitext(os.path.basename(x))[0]
-				if os.path.realpath(x) != \
+				mykey = None
+				cat = mytbz2.getfile("CATEGORY")
+				if cat is not None:
+					cat = _unicode_decode(cat.strip(),
+						encoding=_encodings['repo.content'])
+					mykey = cat + "/" + os.path.basename(x)[:-5]
+
+				if mykey is None:
+					writemsg(colorize("BAD", "\n*** Package is missing CATEGORY metadata: %s.\n\n" % x), noiselevel=-1)
+					self._dynamic_config._skip_restart = True
+					return 0, myfavorites
+				elif os.path.realpath(x) != \
 					os.path.realpath(bindb.bintree.getname(mykey)):
 					writemsg(colorize("BAD", "\n*** You need to adjust PKGDIR to emerge this package.\n\n"), noiselevel=-1)
 					self._dynamic_config._skip_restart = True


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-06  4:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-06  4:00 UTC (permalink / raw
  To: gentoo-commits

commit:     637bb91a9439d4bb7f391fe6e804b64592812fdd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  6 04:00:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct  6 04:00:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=637bb91a

PollScheduler: remove self._jobs

This is variable is only needed by the Scheduler class.

---
 pym/_emerge/MetadataRegen.py |    5 +++--
 pym/_emerge/PollScheduler.py |    3 +--
 pym/_emerge/Scheduler.py     |    4 ++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 234298f..46b028a 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -91,6 +91,9 @@ class MetadataRegen(PollScheduler):
 	def _keep_scheduling(self):
 		return self._remaining_tasks and not self._terminated_tasks
 
+	def _running_job_count(self):
+		return len(self._running_tasks)
+
 	def run(self):
 
 		portdb = self._portdb
@@ -155,14 +158,12 @@ class MetadataRegen(PollScheduler):
 				self._remaining_tasks = False
 				return
 
-			self._jobs += 1
 			self._running_tasks.add(metadata_process)
 			metadata_process.scheduler = self.sched_iface
 			metadata_process.addExitListener(self._metadata_exit)
 			metadata_process.start()
 
 	def _metadata_exit(self, metadata_process):
-		self._jobs -= 1
 		self._running_tasks.discard(metadata_process)
 		if metadata_process.returncode != os.EX_OK:
 			self.returncode = 1

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index bcf80ab..1185cd7 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -41,7 +41,6 @@ class PollScheduler(object):
 		self._terminated_tasks = False
 		self._max_jobs = 1
 		self._max_load = None
-		self._jobs = 0
 		self._scheduling = False
 		self._background = False
 		if event_loop is not None:
@@ -184,7 +183,7 @@ class PollScheduler(object):
 		return bool(self._running_job_count())
 
 	def _running_job_count(self):
-		return self._jobs
+		raise NotImplementedError(self)
 
 	def _can_add_job(self):
 		if self._terminated_tasks:

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 795f503..6a87938 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -225,6 +225,7 @@ class Scheduler(PollScheduler):
 
 		self._prefetchers = weakref.WeakValueDictionary()
 		self._pkg_queue = []
+		self._jobs = 0
 		self._running_tasks = {}
 		self._completed_tasks = set()
 
@@ -1498,6 +1499,9 @@ class Scheduler(PollScheduler):
 	def _is_work_scheduled(self):
 		return bool(self._running_tasks)
 
+	def _running_job_count(self):
+		return self._jobs
+
 	def _schedule_tasks(self):
 
 		while True:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-06 22:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-06 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     e8b66e3e9781aaad8535085007aa12b9a2a64742
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  6 22:00:53 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct  6 22:00:53 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e8b66e3e

PollScheduler: move _main_loop to Scheduler

---
 pym/_emerge/PollScheduler.py |   30 ------------------------------
 pym/_emerge/Scheduler.py     |   30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index dbf137f..105943f 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -147,36 +147,6 @@ class PollScheduler(object):
 		finally:
 			self._scheduling = False
 
-	def _main_loop(self):
-		term_check_id = self.sched_iface.idle_add(self._termination_check)
-		loadavg_check_id = None
-		if self._max_load is not None:
-			# We have to schedule periodically, in case the load
-			# average has changed since the last call.
-			loadavg_check_id = self.sched_iface.timeout_add(
-				self._loadavg_latency, self._schedule)
-
-		try:
-			# Populate initial event sources. Unless we're scheduling
-			# based on load average, we only need to do this once
-			# here, since it can be called during the loop from within
-			# event handlers.
-			self._schedule()
-
-			# Loop while there are jobs to be scheduled.
-			while self._keep_scheduling():
-				self.sched_iface.iteration()
-
-			# Clean shutdown of previously scheduled jobs. In the
-			# case of termination, this allows for basic cleanup
-			# such as flushing of buffered output to logs.
-			while self._is_work_scheduled():
-				self.sched_iface.iteration()
-		finally:
-			self.sched_iface.source_remove(term_check_id)
-			if loadavg_check_id is not None:
-				self.sched_iface.source_remove(loadavg_check_id)
-
 	def _is_work_scheduled(self):
 		return bool(self._running_job_count())
 

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6a87938..1814344 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1338,6 +1338,36 @@ class Scheduler(PollScheduler):
 		blocker_db = self._blocker_db[pkg.root]
 		blocker_db.discardBlocker(pkg)
 
+	def _main_loop(self):
+		term_check_id = self.sched_iface.idle_add(self._termination_check)
+		loadavg_check_id = None
+		if self._max_load is not None:
+			# We have to schedule periodically, in case the load
+			# average has changed since the last call.
+			loadavg_check_id = self.sched_iface.timeout_add(
+				self._loadavg_latency, self._schedule)
+
+		try:
+			# Populate initial event sources. Unless we're scheduling
+			# based on load average, we only need to do this once
+			# here, since it can be called during the loop from within
+			# event handlers.
+			self._schedule()
+
+			# Loop while there are jobs to be scheduled.
+			while self._keep_scheduling():
+				self.sched_iface.iteration()
+
+			# Clean shutdown of previously scheduled jobs. In the
+			# case of termination, this allows for basic cleanup
+			# such as flushing of buffered output to logs.
+			while self._is_work_scheduled():
+				self.sched_iface.iteration()
+		finally:
+			self.sched_iface.source_remove(term_check_id)
+			if loadavg_check_id is not None:
+				self.sched_iface.source_remove(loadavg_check_id)
+
 	def _merge(self):
 
 		if self._opts_no_background.intersection(self.myopts):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-07 16:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-07 16:59 UTC (permalink / raw
  To: gentoo-commits

commit:     61262d1c27e372abb3dc9ba914b1640d2ba65a7f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  7 16:59:41 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  7 16:59:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=61262d1c

action_uninstall: use PollScheduler not Scheduler

The PollScheduler class suffices here, if we just add a small amount of
logic to calculate the _background attribute from the emerge opts.

---
 pym/_emerge/Scheduler.py |    6 +-----
 pym/_emerge/actions.py   |   29 +++++++++++++++--------------
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 1814344..c5779cb 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -135,8 +135,7 @@ class Scheduler(PollScheduler):
 			portage.exception.PortageException.__init__(self, value)
 
 	def __init__(self, settings, trees, mtimedb, myopts,
-		spinner, mergelist=None, favorites=None, graph_config=None,
-		uninstall_only=False):
+		spinner, mergelist=None, favorites=None, graph_config=None):
 		PollScheduler.__init__(self, main=True)
 
 		if mergelist is not None:
@@ -152,7 +151,6 @@ class Scheduler(PollScheduler):
 		self._spinner = spinner
 		self._mtimedb = mtimedb
 		self._favorites = favorites
-		self._uninstall_only = uninstall_only
 		self._args_set = InternalPackageSet(favorites, allow_repo=True)
 		self._build_opts = self._build_opts_class()
 
@@ -327,8 +325,6 @@ class Scheduler(PollScheduler):
 		ignore_built_slot_operator_deps = self.myopts.get(
 			"--ignore-built-slot-operator-deps", "n") == "y"
 		for root in self.trees:
-			if self._uninstall_only:
-				continue
 			if graph_config is None:
 				fake_vartree = FakeVartree(self.trees[root]["root_config"],
 					pkg_cache=self._pkg_cache, dynamic_deps=dynamic_deps,

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c384dd4..2707d22 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -61,6 +61,7 @@ from _emerge.emergelog import emergelog
 from _emerge.is_valid_package_atom import is_valid_package_atom
 from _emerge.MetadataRegen import MetadataRegen
 from _emerge.Package import Package
+from _emerge.PollScheduler import PollScheduler
 from _emerge.ProgressHandler import ProgressHandler
 from _emerge.RootConfig import RootConfig
 from _emerge.Scheduler import Scheduler
@@ -2680,20 +2681,19 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 	if action == 'deselect':
 		return action_deselect(settings, trees, opts, valid_atoms)
 
-	# Create a Scheduler for calls to unmerge(), in order to cause
-	# redirection of ebuild phase output to logs as required for
-	# options such as --quiet.
-	sched = Scheduler(settings, trees, None, opts,
-		spinner, uninstall_only=True)
-	sched._background = sched._background_mode()
-	sched._status_display.quiet = True
+	# Use the same logic as the Scheduler class to trigger redirection
+	# of ebuild pkg_prerm/postrm phase output to logs as appropriate
+	# for options such as --jobs, --quiet and --quiet-build.
+	sched = PollScheduler(main=True)
+	max_jobs = opts.get("--jobs", 1)
+	sched._background = (max_jobs is True or max_jobs > 1 or
+		"--quiet" in opts or opts.get("--quiet-build") == "y")
 
 	if sched._background:
-		sched.settings.unlock()
-		sched.settings["PORTAGE_BACKGROUND"] = "1"
-		sched.settings.backup_changes("PORTAGE_BACKGROUND")
-		sched.settings.lock()
-		sched.pkgsettings[eroot] = portage.config(clone=sched.settings)
+		settings.unlock()
+		settings["PORTAGE_BACKGROUND"] = "1"
+		settings.backup_changes("PORTAGE_BACKGROUND")
+		settings.lock()
 
 	if action in ('clean', 'unmerge') or \
 		(action == 'prune' and "--nodeps" in opts):
@@ -2701,10 +2701,11 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 		ordered = action == 'unmerge'
 		rval = unmerge(trees[settings['EROOT']]['root_config'], opts, action,
 			valid_atoms, ldpath_mtimes, ordered=ordered,
-			scheduler=sched._sched_iface)
+			scheduler=sched.sched_iface)
 	else:
 		rval = action_depclean(settings, trees, ldpath_mtimes,
-			opts, action, valid_atoms, spinner, scheduler=sched._sched_iface)
+			opts, action, valid_atoms, spinner,
+			scheduler=sched.sched_iface)
 
 	return rval
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-10 21:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-10 21:13 UTC (permalink / raw
  To: gentoo-commits

commit:     2d163053ee47a349b7e50c0907b89bcd91bef7d3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 10 21:12:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 10 21:12:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2d163053

PollScheduler: fix _schedule() to return True

This fixes a regression like bug #403895, introduced in commit
b696337bf20fdc539ce7721df7a4b42b35999705, since functions have to
return True in order to be continuously scheduled.

---
 pym/_emerge/PollScheduler.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index d02b0da..220394b 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -115,15 +115,17 @@ class PollScheduler(object):
 		Calls _schedule_tasks() and automatically returns early from
 		any recursive calls to this method that the _schedule_tasks()
 		call might trigger. This makes _schedule() safe to call from
-		inside exit listeners.
+		inside exit listeners. This method always returns True, so that
+		it may be scheduled continuously via EventLoop.timeout_add().
 		"""
 		if self._scheduling:
-			return False
+			return True
 		self._scheduling = True
 		try:
 			self._schedule_tasks()
 		finally:
 			self._scheduling = False
+		return True
 
 	def _is_work_scheduled(self):
 		return bool(self._running_job_count())


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-13 20:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-13 20:06 UTC (permalink / raw
  To: gentoo-commits

commit:     d39d032f2bc5359f95cd523ec39a9d3bb5fa77e4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 13 20:06:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 13 20:06:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d39d032f

MergeListItem: color binary display, bug #438254

---
 pym/_emerge/MergeListItem.py |    8 +++++---
 pym/_emerge/PackageMerge.py  |    7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index 8086c68..4ce2cd1 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -47,8 +47,10 @@ class MergeListItem(CompositeTask):
 
 		action_desc = "Emerging"
 		preposition = "for"
+		pkg_color = "PKG_MERGE"
 		if pkg.type_name == "binary":
-			action_desc += " binary"
+			pkg_color = "PKG_BINARY_MERGE"
+			action_desc += " " + colorize(pkg_color, "binary")
 
 		if build_opts.fetchonly:
 			action_desc = "Fetching"
@@ -57,7 +59,7 @@ class MergeListItem(CompositeTask):
 			(action_desc,
 			colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
 			colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
-			colorize("GOOD", pkg.cpv))
+			colorize(pkg_color, pkg.cpv))
 
 		portdb = pkg.root_config.trees["porttree"].dbapi
 		portdir_repo_name = portdb.getRepositoryName(portdb.porttree_root)

diff --git a/pym/_emerge/PackageMerge.py b/pym/_emerge/PackageMerge.py
index eed34e9..ef298ca 100644
--- a/pym/_emerge/PackageMerge.py
+++ b/pym/_emerge/PackageMerge.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.CompositeTask import CompositeTask
@@ -11,6 +11,9 @@ class PackageMerge(CompositeTask):
 		self.scheduler = self.merge.scheduler
 		pkg = self.merge.pkg
 		pkg_count = self.merge.pkg_count
+		pkg_color = "PKG_MERGE"
+		if pkg.type_name == "binary":
+			pkg_color = "PKG_BINARY_MERGE"
 
 		if pkg.installed:
 			action_desc = "Uninstalling"
@@ -26,7 +29,7 @@ class PackageMerge(CompositeTask):
 		msg = "%s %s%s" % \
 			(action_desc,
 			counter_str,
-			colorize("GOOD", pkg.cpv))
+			colorize(pkg_color, pkg.cpv))
 
 		if pkg.root_config.settings["ROOT"] != "/":
 			msg += " %s %s" % (preposition, pkg.root)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-15  2:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-15  2:59 UTC (permalink / raw
  To: gentoo-commits

commit:     31aa12b5e72d8de7faa548bc498deb198f275cfd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 15 02:59:37 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 15 02:59:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=31aa12b5

MergeListItem: don't color "binary"

---
 pym/_emerge/MergeListItem.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index 4ce2cd1..371e2e2 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -50,7 +50,7 @@ class MergeListItem(CompositeTask):
 		pkg_color = "PKG_MERGE"
 		if pkg.type_name == "binary":
 			pkg_color = "PKG_BINARY_MERGE"
-			action_desc += " " + colorize(pkg_color, "binary")
+			action_desc += " binary"
 
 		if build_opts.fetchonly:
 			action_desc = "Fetching"


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-15 15:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-15 15:02 UTC (permalink / raw
  To: gentoo-commits

commit:     4eca58411a58fa52cb18f694a899d88e2d93d242
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 15 15:02:20 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 15 15:02:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4eca5841

emerge_main: disable color earlier

Since commit 2ca487f929962154488999a125a7387eeb44be88, --help has not
respected --color=n and related options, since it's been optimized to
bypass options and config parsing. Now it's fixed to show without
colors in this optimized case (help with colors may be shown in some
other cases, like when emerge is called with zero arguments).

---
 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 dc45f8f..bba10b7 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1424,6 +1424,10 @@ def emerge_main(args=None):
 	if args is None:
 		args = sys.argv[1:]
 
+	# Disable color until we're sure that it should be enabled (after
+	# EMERGE_DEFAULT_OPTS has been parsed).
+	portage.output.havecolor = 0
+
 	# optimize --help (no need to load config / EMERGE_DEFAULT_OPTS)
 	if "--help" in args or "-h" in args:
 		emerge_help()
@@ -1431,9 +1435,7 @@ def emerge_main(args=None):
 
 	portage._disable_legacy_globals()
 	portage.dep._internal_warnings = True
-	# Disable color until we're sure that it should be enabled (after
-	# EMERGE_DEFAULT_OPTS has been parsed).
-	portage.output.havecolor = 0
+
 	# This first pass is just for options that need to be known as early as
 	# possible, such as --config-root.  They will be parsed again later,
 	# together with EMERGE_DEFAULT_OPTS (which may vary depending on the


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-15 15:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-15 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     158440e153b898159ca525016d46bb0a161c49e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 15 15:42:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 15 15:42:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=158440e1

emerge_main: move imports to top

---
 pym/_emerge/main.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index bba10b7..eed3999 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -10,6 +10,7 @@ import sys
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
 	'logging',
+	'portage.debug',
 	'portage.dbapi.dep_expand:dep_expand',
 	'portage.news:count_unread_news,display_news_notifications',
 	'portage.emaint.modules.logs.logs:CleanLogs',
@@ -1635,8 +1636,7 @@ def emerge_main(args=None):
 		spinner.update = spinner.update_quiet
 		portage.util.noiselimit = 0
 		if "python-trace" in settings.features:
-			import portage.debug as portage_debug
-			portage_debug.set_trace(True)
+			portage.debug.set_trace(True)
 
 	if not ("--quiet" in myopts):
 		if '--nospinner' in myopts or \
@@ -1673,12 +1673,11 @@ def emerge_main(args=None):
 					access_desc = "portage group"
 				# Always show portage_group_warning() when only portage group
 				# access is required but the user is not in the portage group.
-				from portage.data import portage_group_warning
 				if "--ask" in myopts:
 					writemsg_stdout("This action requires %s access...\n" % \
 						(access_desc,), noiselevel=-1)
 					if portage.secpass < 1 and not need_superuser:
-						portage_group_warning()
+						portage.data.portage_group_warning()
 					if userquery("Would you like to add --pretend to options?",
 						"--ask-enter-invalid" in myopts) == "No":
 						return 128 + signal.SIGINT
@@ -1688,7 +1687,7 @@ def emerge_main(args=None):
 					sys.stderr.write(("emerge: %s access is required\n") \
 						% access_desc)
 					if portage.secpass < 1 and not need_superuser:
-						portage_group_warning()
+						portage.data.portage_group_warning()
 					return 1
 
 	# Disable emergelog for everything except build or unmerge operations.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-16  8:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-16  8:34 UTC (permalink / raw
  To: gentoo-commits

commit:     65e69242814553b826b9277495a5f62b79569269
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 16 08:33:54 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 08:33:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=65e69242

emerge_main: split out run_action

Also move post_emerge and chk_updated_cfg_files to separate files.

---
 pym/_emerge/actions.py               |  777 ++++++++++++++++++++++++++++--
 pym/_emerge/chk_updated_cfg_files.py |   42 ++
 pym/_emerge/main.py                  |  881 +---------------------------------
 pym/_emerge/post_emerge.py           |  165 +++++++
 4 files changed, 949 insertions(+), 916 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 3003afc..3336e9f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -22,13 +22,18 @@ from itertools import chain
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
+	'portage.debug',
 	'portage.news:count_unread_news,display_news_notifications',
+	'_emerge.chk_updated_cfg_files:chk_updated_cfg_files',
+	'_emerge.help:help@emerge_help',
+	'_emerge.post_emerge:display_news_notification,post_emerge',
+	'_emerge.stdout_spinner:stdout_spinner',
 )
 
 from portage.localization import _
 from portage import os
 from portage import shutil
-from portage import eapi_is_supported, _unicode_decode
+from portage import eapi_is_supported, _encodings, _unicode_decode
 from portage.cache.cache_errors import CacheError
 from portage.const import GLOBAL_CONFIG_PATH
 from portage.const import _DEPCLEAN_LIB_CHECK_DEFAULT
@@ -38,7 +43,7 @@ from portage.dep import Atom
 from portage.eclass_cache import hashed_path
 from portage.exception import InvalidAtom, InvalidData
 from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
-	red, yellow
+	red, xtermTitle, xtermTitleReset, yellow
 good = create_color_func("GOOD")
 bad = create_color_func("BAD")
 warn = create_color_func("WARN")
@@ -46,7 +51,7 @@ from portage.package.ebuild._ipc.QueryCommand import QueryCommand
 from portage.package.ebuild.doebuild import _check_temp_dir
 from portage._sets import load_default_config, SETPREFIX
 from portage._sets.base import InternalPackageSet
-from portage.util import cmp_sort_key, writemsg, \
+from portage.util import cmp_sort_key, writemsg, varexpand, \
 	writemsg_level, writemsg_stdout
 from portage.util.digraph import digraph
 from portage.util._async.SchedulerInterface import SchedulerInterface
@@ -82,6 +87,21 @@ if sys.hexversion >= 0x3000000:
 else:
 	_unicode = unicode
 
+COWSAY_MOO = """
+
+  Larry loves Gentoo (%s)
+
+ _______________________
+< Have you mooed today? >
+ -----------------------
+        \   ^__^
+         \  (oo)\_______
+            (__)\       )\/\ 
+                ||----w |
+                ||     ||
+
+"""
+
 def action_build(settings, trees, mtimedb,
 	myopts, myaction, myfiles, spinner):
 
@@ -3057,42 +3077,6 @@ def load_emerge_config(trees=None):
 	QueryCommand._db = trees
 	return settings, trees, mtimedb
 
-def chk_updated_cfg_files(eroot, config_protect):
-	target_root = eroot
-	result = list(
-		portage.util.find_updated_config_files(target_root, config_protect))
-
-	for x in result:
-		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)
-		else: # it's a protected dir
-			if len(x[1]) == 1:
-				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") % \
-					(len(x[1]), x[0]), level=logging.INFO, noiselevel=-1)
-
-	if result:
-		print(" "+yellow("*")+ " See the "+colorize("INFORM", _("CONFIGURATION FILES"))\
-				+ " " + _("section of the") + " " + bold("emerge"))
-		print(" "+yellow("*")+ " " + _("man page to learn how to update config files."))
-
-
-def display_news_notification(root_config, myopts):
-	if "news" not in root_config.settings.features:
-		return
-	portdb = root_config.trees["porttree"].dbapi
-	vardb = root_config.trees["vartree"].dbapi
-	news_counts = count_unread_news(portdb, vardb)
-	display_news_notifications(news_counts)
-
 def getgccversion(chost):
 	"""
 	rtype: C{str}
@@ -3147,3 +3131,718 @@ def getgccversion(chost):
 
 	portage.writemsg(gcc_not_found_error, noiselevel=-1)
 	return "[unavailable]"
+
+# Warn about features that may confuse users and
+# lead them to report invalid bugs.
+_emerge_features_warn = frozenset(['keeptemp', 'keepwork'])
+
+def validate_ebuild_environment(trees):
+	features_warn = set()
+	for myroot in trees:
+		settings = trees[myroot]["vartree"].settings
+		settings.validate()
+		features_warn.update(
+			_emerge_features_warn.intersection(settings.features))
+
+	if features_warn:
+		msg = "WARNING: The FEATURES variable contains one " + \
+			"or more values that should be disabled under " + \
+			"normal circumstances: %s" % " ".join(features_warn)
+		out = portage.output.EOutput()
+		for line in textwrap.wrap(msg, 65):
+			out.ewarn(line)
+
+def check_procfs():
+	procfs_path = '/proc'
+	if platform.system() not in ("Linux",) or \
+		os.path.ismount(procfs_path):
+		return os.EX_OK
+	msg = "It seems that %s is not mounted. You have been warned." % procfs_path
+	writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
+		level=logging.ERROR, noiselevel=-1)
+	return 1
+
+def config_protect_check(trees):
+	for root, root_trees in trees.items():
+		settings = root_trees["root_config"].settings
+		if not settings.get("CONFIG_PROTECT"):
+			msg = "!!! CONFIG_PROTECT is empty"
+			if settings["ROOT"] != "/":
+				msg += " for '%s'" % root
+			msg += "\n"
+			writemsg_level(msg, level=logging.WARN, noiselevel=-1)
+
+def apply_priorities(settings):
+	ionice(settings)
+	nice(settings)
+
+def nice(settings):
+	try:
+		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
+	except (OSError, ValueError) as e:
+		out = portage.output.EOutput()
+		out.eerror("Failed to change nice value to '%s'" % \
+			settings["PORTAGE_NICENESS"])
+		out.eerror("%s\n" % str(e))
+
+def ionice(settings):
+
+	ionice_cmd = settings.get("PORTAGE_IONICE_COMMAND")
+	if ionice_cmd:
+		ionice_cmd = portage.util.shlex_split(ionice_cmd)
+	if not ionice_cmd:
+		return
+
+	variables = {"PID" : str(os.getpid())}
+	cmd = [varexpand(x, mydict=variables) for x in ionice_cmd]
+
+	try:
+		rval = portage.process.spawn(cmd, env=os.environ)
+	except portage.exception.CommandNotFound:
+		# The OS kernel probably doesn't support ionice,
+		# so return silently.
+		return
+
+	if rval != os.EX_OK:
+		out = portage.output.EOutput()
+		out.eerror("PORTAGE_IONICE_COMMAND returned %d" % (rval,))
+		out.eerror("See the make.conf(5) man page for PORTAGE_IONICE_COMMAND usage instructions.")
+
+def setconfig_fallback(root_config):
+	setconfig = root_config.setconfig
+	setconfig._create_default_config()
+	setconfig._parse(update=True)
+	root_config.sets = setconfig.getSets()
+
+def get_missing_sets(root_config):
+	# emerge requires existence of "world", "selected", and "system"
+	missing_sets = []
+
+	for s in ("selected", "system", "world",):
+		if s not in root_config.sets:
+			missing_sets.append(s)
+
+	return missing_sets
+
+def missing_sets_warning(root_config, missing_sets):
+	if len(missing_sets) > 2:
+		missing_sets_str = ", ".join('"%s"' % s for s in missing_sets[:-1])
+		missing_sets_str += ', and "%s"' % missing_sets[-1]
+	elif len(missing_sets) == 2:
+		missing_sets_str = '"%s" and "%s"' % tuple(missing_sets)
+	else:
+		missing_sets_str = '"%s"' % missing_sets[-1]
+	msg = ["emerge: incomplete set configuration, " + \
+		"missing set(s): %s" % missing_sets_str]
+	if root_config.sets:
+		msg.append("        sets defined: %s" % ", ".join(root_config.sets))
+	global_config_path = portage.const.GLOBAL_CONFIG_PATH
+	if root_config.settings['EPREFIX']:
+		global_config_path = os.path.join(root_config.settings['EPREFIX'],
+				portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
+	msg.append("        This usually means that '%s'" % \
+		(os.path.join(global_config_path, "sets/portage.conf"),))
+	msg.append("        is missing or corrupt.")
+	msg.append("        Falling back to default world and system set configuration!!!")
+	for line in msg:
+		writemsg_level(line + "\n", level=logging.ERROR, noiselevel=-1)
+
+def ensure_required_sets(trees):
+	warning_shown = False
+	for root_trees in trees.values():
+		missing_sets = get_missing_sets(root_trees["root_config"])
+		if missing_sets and not warning_shown:
+			warning_shown = True
+			missing_sets_warning(root_trees["root_config"], missing_sets)
+		if missing_sets:
+			setconfig_fallback(root_trees["root_config"])
+
+def expand_set_arguments(myfiles, myaction, root_config):
+	retval = os.EX_OK
+	setconfig = root_config.setconfig
+
+	sets = setconfig.getSets()
+
+	# In order to know exactly which atoms/sets should be added to the
+	# world file, the depgraph performs set expansion later. It will get
+	# confused about where the atoms came from if it's not allowed to
+	# expand them itself.
+	do_not_expand = (None, )
+	newargs = []
+	for a in myfiles:
+		if a in ("system", "world"):
+			newargs.append(SETPREFIX+a)
+		else:
+			newargs.append(a)
+	myfiles = newargs
+	del newargs
+	newargs = []
+
+	# separators for set arguments
+	ARG_START = "{"
+	ARG_END = "}"
+
+	for i in range(0, len(myfiles)):
+		if myfiles[i].startswith(SETPREFIX):
+			start = 0
+			end = 0
+			x = myfiles[i][len(SETPREFIX):]
+			newset = ""
+			while x:
+				start = x.find(ARG_START)
+				end = x.find(ARG_END)
+				if start > 0 and start < end:
+					namepart = x[:start]
+					argpart = x[start+1:end]
+
+					# TODO: implement proper quoting
+					args = argpart.split(",")
+					options = {}
+					for a in args:
+						if "=" in a:
+							k, v  = a.split("=", 1)
+							options[k] = v
+						else:
+							options[a] = "True"
+					setconfig.update(namepart, options)
+					newset += (x[:start-len(namepart)]+namepart)
+					x = x[end+len(ARG_END):]
+				else:
+					newset += x
+					x = ""
+			myfiles[i] = SETPREFIX+newset
+
+	sets = setconfig.getSets()
+
+	# display errors that occurred while loading the SetConfig instance
+	for e in setconfig.errors:
+		print(colorize("BAD", "Error during set creation: %s" % e))
+
+	unmerge_actions = ("unmerge", "prune", "clean", "depclean")
+
+	for a in myfiles:
+		if a.startswith(SETPREFIX):		
+				s = a[len(SETPREFIX):]
+				if s not in sets:
+					display_missing_pkg_set(root_config, s)
+					return (None, 1)
+				if s == "installed":
+					msg = ("The @installed set is deprecated and will soon be "
+					"removed. Please refer to bug #387059 for details.")
+					out = portage.output.EOutput()
+					for line in textwrap.wrap(msg, 50):
+						out.ewarn(line)
+				setconfig.active.append(s)
+				try:
+					set_atoms = setconfig.getSetAtoms(s)
+				except portage.exception.PackageSetNotFound as e:
+					writemsg_level(("emerge: the given set '%s' " + \
+						"contains a non-existent set named '%s'.\n") % \
+						(s, e), level=logging.ERROR, noiselevel=-1)
+					if s in ('world', 'selected') and \
+						SETPREFIX + e.value in sets['selected']:
+						writemsg_level(("Use `emerge --deselect %s%s` to "
+							"remove this set from world_sets.\n") %
+							(SETPREFIX, e,), level=logging.ERROR,
+							noiselevel=-1)
+					return (None, 1)
+				if myaction in unmerge_actions and \
+						not sets[s].supportsOperation("unmerge"):
+					sys.stderr.write("emerge: the given set '%s' does " % s + \
+						"not support unmerge operations\n")
+					retval = 1
+				elif not set_atoms:
+					print("emerge: '%s' is an empty set" % s)
+				elif myaction not in do_not_expand:
+					newargs.extend(set_atoms)
+				else:
+					newargs.append(SETPREFIX+s)
+				for e in sets[s].errors:
+					print(e)
+		else:
+			newargs.append(a)
+	return (newargs, retval)
+
+def repo_name_check(trees):
+	missing_repo_names = set()
+	for root_trees in trees.values():
+		porttree = root_trees.get("porttree")
+		if porttree:
+			portdb = porttree.dbapi
+			missing_repo_names.update(portdb.getMissingRepoNames())
+			if portdb.porttree_root in missing_repo_names and \
+				not os.path.exists(os.path.join(
+				portdb.porttree_root, "profiles")):
+				# This is normal if $PORTDIR happens to be empty,
+				# so don't warn about it.
+				missing_repo_names.remove(portdb.porttree_root)
+
+	if missing_repo_names:
+		msg = []
+		msg.append("WARNING: One or more repositories " + \
+			"have missing repo_name entries:")
+		msg.append("")
+		for p in missing_repo_names:
+			msg.append("\t%s/profiles/repo_name" % (p,))
+		msg.append("")
+		msg.extend(textwrap.wrap("NOTE: Each repo_name entry " + \
+			"should be a plain text file containing a unique " + \
+			"name for the repository on the first line.", 70))
+		msg.append("\n")
+		writemsg_level("".join("%s\n" % l for l in msg),
+			level=logging.WARNING, noiselevel=-1)
+
+	return bool(missing_repo_names)
+
+def repo_name_duplicate_check(trees):
+	ignored_repos = {}
+	for root, root_trees in trees.items():
+		if 'porttree' in root_trees:
+			portdb = root_trees['porttree'].dbapi
+			if portdb.settings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0':
+				for repo_name, paths in portdb.getIgnoredRepos():
+					k = (root, repo_name, portdb.getRepositoryPath(repo_name))
+					ignored_repos.setdefault(k, []).extend(paths)
+
+	if ignored_repos:
+		msg = []
+		msg.append('WARNING: One or more repositories ' + \
+			'have been ignored due to duplicate')
+		msg.append('  profiles/repo_name entries:')
+		msg.append('')
+		for k in sorted(ignored_repos):
+			msg.append('  %s overrides' % ", ".join(k))
+			for path in ignored_repos[k]:
+				msg.append('    %s' % (path,))
+			msg.append('')
+		msg.extend('  ' + x for x in textwrap.wrap(
+			"All profiles/repo_name entries must be unique in order " + \
+			"to avoid having duplicates ignored. " + \
+			"Set PORTAGE_REPO_DUPLICATE_WARN=\"0\" in " + \
+			"/etc/make.conf if you would like to disable this warning."))
+		msg.append("\n")
+		writemsg_level(''.join('%s\n' % l for l in msg),
+			level=logging.WARNING, noiselevel=-1)
+
+	return bool(ignored_repos)
+
+def run_action(settings, trees, mtimedb, myaction, myopts, myfiles):
+
+	# skip global updates prior to sync, since it's called after sync
+	if myaction not in ('help', 'info', 'sync', 'version') and \
+		myopts.get('--package-moves') != 'n' and \
+		_global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
+		mtimedb.commit()
+		# Reload the whole config from scratch.
+		settings, trees, mtimedb = load_emerge_config(trees=trees)
+
+	xterm_titles = "notitles" not in settings.features
+	if xterm_titles:
+		xtermTitle("emerge")
+
+	if "--digest" in myopts:
+		os.environ["FEATURES"] = os.environ.get("FEATURES","") + " digest"
+		# Reload the whole config from scratch so that the portdbapi internal
+		# config is updated with new FEATURES.
+		settings, trees, mtimedb = load_emerge_config(trees=trees)
+
+	# NOTE: adjust_configs() can map options to FEATURES, so any relevant
+	# options adjustments should be made prior to calling adjust_configs().
+	if "--buildpkgonly" in myopts:
+		myopts["--buildpkg"] = True
+
+	if "getbinpkg" in settings.features:
+		myopts["--getbinpkg"] = True
+
+	if "--getbinpkgonly" in myopts:
+		myopts["--getbinpkg"] = True
+
+	if "--getbinpkgonly" in myopts:
+		myopts["--usepkgonly"] = True
+
+	if "--getbinpkg" in myopts:
+		myopts["--usepkg"] = True
+
+	if "--usepkgonly" in myopts:
+		myopts["--usepkg"] = True
+
+	if "--buildpkgonly" in myopts:
+		# --buildpkgonly will not merge anything, so
+		# it cancels all binary package options.
+		for opt in ("--getbinpkg", "--getbinpkgonly",
+			"--usepkg", "--usepkgonly"):
+			myopts.pop(opt, None)
+
+	adjust_configs(myopts, trees)
+	apply_priorities(settings)
+
+	if myaction == 'version':
+		writemsg_stdout(getportageversion(
+			settings["PORTDIR"], None,
+			settings.profile_path, settings["CHOST"],
+			trees[settings['EROOT']]['vartree'].dbapi) + '\n', noiselevel=-1)
+		return 0
+	elif myaction == 'help':
+		emerge_help()
+		return 0
+
+	spinner = stdout_spinner()
+	if "candy" in settings.features:
+		spinner.update = spinner.update_scroll
+
+	if "--quiet" not in myopts:
+		portage.deprecated_profile_check(settings=settings)
+		if portage.const._ENABLE_REPO_NAME_WARN:
+			# Bug #248603 - Disable warnings about missing
+			# repo_name entries for stable branch.
+			repo_name_check(trees)
+		repo_name_duplicate_check(trees)
+		config_protect_check(trees)
+	check_procfs()
+
+	for mytrees in trees.values():
+		mydb = mytrees["porttree"].dbapi
+		# Freeze the portdbapi for performance (memoize all xmatch results).
+		mydb.freeze()
+
+		if myaction in ('search', None) and \
+			"--usepkg" in myopts:
+			# Populate the bintree with current --getbinpkg setting.
+			# This needs to happen before expand_set_arguments(), in case
+			# any sets use the bintree.
+			mytrees["bintree"].populate(
+				getbinpkgs="--getbinpkg" in myopts)
+
+	del mytrees, mydb
+
+	if "moo" in myfiles:
+		print(COWSAY_MOO % platform.system())
+		msg = ("The above `emerge moo` display is deprecated. "
+			"Please use `emerge --moo` instead.")
+		for line in textwrap.wrap(msg, 50):
+			print(" %s %s" % (colorize("WARN", "*"), line))
+
+	for x in myfiles:
+		ext = os.path.splitext(x)[1]
+		if (ext == ".ebuild" or ext == ".tbz2") and \
+			os.path.exists(os.path.abspath(x)):
+			print(colorize("BAD", "\n*** emerging by path is broken "
+				"and may not always work!!!\n"))
+			break
+
+	root_config = trees[settings['EROOT']]['root_config']
+	if myaction == "moo":
+		print(COWSAY_MOO % platform.system())
+		return os.EX_OK
+	elif myaction == "list-sets":
+		writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
+		return os.EX_OK
+	elif myaction == "check-news":
+		news_counts = count_unread_news(
+			root_config.trees["porttree"].dbapi,
+			root_config.trees["vartree"].dbapi)
+		if any(news_counts.values()):
+			display_news_notifications(news_counts)
+		elif "--quiet" not in myopts:
+			print("", colorize("GOOD", "*"), "No news items were found.")
+		return os.EX_OK
+
+	ensure_required_sets(trees)
+
+	# only expand sets for actions taking package arguments
+	oldargs = myfiles[:]
+	if myaction in ("clean", "config", "depclean",
+		"info", "prune", "unmerge", None):
+		myfiles, retval = expand_set_arguments(myfiles, myaction, root_config)
+		if retval != os.EX_OK:
+			return retval
+
+		# Need to handle empty sets specially, otherwise emerge will react 
+		# with the help message for empty argument lists
+		if oldargs and not myfiles:
+			print("emerge: no targets left after set expansion")
+			return 0
+
+	if ("--tree" in myopts) and ("--columns" in myopts):
+		print("emerge: can't specify both of \"--tree\" and \"--columns\".")
+		return 1
+
+	if '--emptytree' in myopts and '--noreplace' in myopts:
+		writemsg_level("emerge: can't specify both of " + \
+			"\"--emptytree\" and \"--noreplace\".\n",
+			level=logging.ERROR, noiselevel=-1)
+		return 1
+
+	if ("--quiet" in myopts):
+		spinner.update = spinner.update_quiet
+		portage.util.noiselimit = -1
+
+	if "--fetch-all-uri" in myopts:
+		myopts["--fetchonly"] = True
+
+	if "--skipfirst" in myopts and "--resume" not in myopts:
+		myopts["--resume"] = True
+
+	# Allow -p to remove --ask
+	if "--pretend" in myopts:
+		myopts.pop("--ask", None)
+
+	# forbid --ask when not in a terminal
+	# note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway.
+	if ("--ask" in myopts) and (not sys.stdin.isatty()):
+		portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n",
+			noiselevel=-1)
+		return 1
+
+	if settings.get("PORTAGE_DEBUG", "") == "1":
+		spinner.update = spinner.update_quiet
+		portage.util.noiselimit = 0
+		if "python-trace" in settings.features:
+			portage.debug.set_trace(True)
+
+	if not ("--quiet" in myopts):
+		if '--nospinner' in myopts or \
+			settings.get('TERM') == 'dumb' or \
+			not sys.stdout.isatty():
+			spinner.update = spinner.update_basic
+
+	if "--debug" in myopts:
+		print("myaction", myaction)
+		print("myopts", myopts)
+
+	if not myaction and not myfiles and "--resume" not in myopts:
+		emerge_help()
+		return 1
+
+	pretend = "--pretend" in myopts
+	fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
+	buildpkgonly = "--buildpkgonly" in myopts
+
+	# check if root user is the current user for the actions where emerge needs this
+	if portage.data.secpass < 2:
+		# We've already allowed "--version" and "--help" above.
+		if "--pretend" not in myopts and myaction not in ("search","info"):
+			need_superuser = myaction in ('clean', 'depclean', 'deselect',
+				'prune', 'unmerge') or not \
+				(fetchonly or \
+				(buildpkgonly and portage.data.secpass >= 1) or \
+				myaction in ("metadata", "regen", "sync"))
+			if portage.data.secpass < 1 or \
+				need_superuser:
+				if need_superuser:
+					access_desc = "superuser"
+				else:
+					access_desc = "portage group"
+				# Always show portage_group_warning() when only portage group
+				# access is required but the user is not in the portage group.
+				if "--ask" in myopts:
+					writemsg_stdout("This action requires %s access...\n" % \
+						(access_desc,), noiselevel=-1)
+					if portage.data.secpass < 1 and not need_superuser:
+						portage.data.portage_group_warning()
+					if userquery("Would you like to add --pretend to options?",
+						"--ask-enter-invalid" in myopts) == "No":
+						return 128 + signal.SIGINT
+					myopts["--pretend"] = True
+					myopts.pop("--ask")
+				else:
+					sys.stderr.write(("emerge: %s access is required\n") \
+						% access_desc)
+					if portage.data.secpass < 1 and not need_superuser:
+						portage.data.portage_group_warning()
+					return 1
+
+	# Disable emergelog for everything except build or unmerge operations.
+	# This helps minimize parallel emerge.log entries that can confuse log
+	# parsers like genlop.
+	disable_emergelog = False
+	for x in ("--pretend", "--fetchonly", "--fetch-all-uri"):
+		if x in myopts:
+			disable_emergelog = True
+			break
+	if disable_emergelog:
+		pass
+	elif myaction in ("search", "info"):
+		disable_emergelog = True
+	elif portage.data.secpass < 1:
+		disable_emergelog = True
+
+	import _emerge.emergelog
+	_emerge.emergelog._disable = disable_emergelog
+
+	if not disable_emergelog:
+		if 'EMERGE_LOG_DIR' in settings:
+			try:
+				# At least the parent needs to exist for the lock file.
+				portage.util.ensure_dirs(settings['EMERGE_LOG_DIR'])
+			except portage.exception.PortageException as e:
+				writemsg_level("!!! Error creating directory for " + \
+					"EMERGE_LOG_DIR='%s':\n!!! %s\n" % \
+					(settings['EMERGE_LOG_DIR'], e),
+					noiselevel=-1, level=logging.ERROR)
+				portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
+			else:
+				_emerge.emergelog._emerge_log_dir = settings["EMERGE_LOG_DIR"]
+		else:
+			_emerge.emergelog._emerge_log_dir = os.path.join(os.sep,
+				settings["EPREFIX"].lstrip(os.sep), "var", "log")
+			portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
+
+	if not "--pretend" in myopts:
+		emergelog(xterm_titles, "Started emerge on: "+\
+			_unicode_decode(
+				time.strftime("%b %d, %Y %H:%M:%S", time.localtime()),
+				encoding=_encodings['content'], errors='replace'))
+		myelogstr=""
+		if myopts:
+			opt_list = []
+			for opt, arg in myopts.items():
+				if arg is True:
+					opt_list.append(opt)
+				elif isinstance(arg, list):
+					# arguments like --exclude that use 'append' action
+					for x in arg:
+						opt_list.append("%s=%s" % (opt, x))
+				else:
+					opt_list.append("%s=%s" % (opt, arg))
+			myelogstr=" ".join(opt_list)
+		if myaction:
+			myelogstr += " --" + myaction
+		if myfiles:
+			myelogstr += " " + " ".join(oldargs)
+		emergelog(xterm_titles, " *** emerge " + myelogstr)
+
+	oldargs = None
+
+	def emergeexitsig(signum, frame):
+		signal.signal(signal.SIGTERM, signal.SIG_IGN)
+		portage.util.writemsg(
+			"\n\nExiting on signal %(signal)s\n" % {"signal":signum})
+		sys.exit(128 + signum)
+
+	signal.signal(signal.SIGTERM, emergeexitsig)
+
+	def emergeexit():
+		"""This gets out final log message in before we quit."""
+		if "--pretend" not in myopts:
+			emergelog(xterm_titles, " *** terminating.")
+		if xterm_titles:
+			xtermTitleReset()
+	portage.atexit_register(emergeexit)
+
+	if myaction in ("config", "metadata", "regen", "sync"):
+		if "--pretend" in myopts:
+			sys.stderr.write(("emerge: The '%s' action does " + \
+				"not support '--pretend'.\n") % myaction)
+			return 1
+
+	if "sync" == myaction:
+		return action_sync(settings, trees, mtimedb, myopts, myaction)
+	elif "metadata" == myaction:
+		action_metadata(settings,
+			trees[settings['EROOT']]['porttree'].dbapi, myopts)
+	elif myaction=="regen":
+		validate_ebuild_environment(trees)
+		return action_regen(settings,
+			trees[settings['EROOT']]['porttree'].dbapi, myopts.get("--jobs"),
+			myopts.get("--load-average"))
+	# HELP action
+	elif "config"==myaction:
+		validate_ebuild_environment(trees)
+		action_config(settings, trees, myopts, myfiles)
+
+	# SEARCH action
+	elif "search"==myaction:
+		validate_ebuild_environment(trees)
+		action_search(trees[settings['EROOT']]['root_config'],
+			myopts, myfiles, spinner)
+
+	elif myaction in ('clean', 'depclean', 'deselect', 'prune', 'unmerge'):
+		validate_ebuild_environment(trees)
+		rval = action_uninstall(settings, trees, mtimedb["ldpath"],
+			myopts, myaction, myfiles, spinner)
+		if not (myaction == 'deselect' or
+			buildpkgonly or fetchonly or pretend):
+			post_emerge(myaction, myopts, myfiles, settings['EROOT'],
+				trees, mtimedb, rval)
+		return rval
+
+	elif myaction == 'info':
+
+		# Ensure atoms are valid before calling unmerge().
+		vardb = trees[settings['EROOT']]['vartree'].dbapi
+		portdb = trees[settings['EROOT']]['porttree'].dbapi
+		bindb = trees[settings['EROOT']]["bintree"].dbapi
+		valid_atoms = []
+		for x in myfiles:
+			if is_valid_package_atom(x, allow_repo=True):
+				try:
+					#look at the installed files first, if there is no match
+					#look at the ebuilds, since EAPI 4 allows running pkg_info
+					#on non-installed packages
+					valid_atom = dep_expand(x, mydb=vardb, settings=settings)
+					if valid_atom.cp.split("/")[0] == "null":
+						valid_atom = dep_expand(x,
+							mydb=portdb, settings=settings)
+
+					if valid_atom.cp.split("/")[0] == "null" and \
+						"--usepkg" in myopts:
+						valid_atom = dep_expand(x,
+							mydb=bindb, settings=settings)
+
+					valid_atoms.append(valid_atom)
+
+				except portage.exception.AmbiguousPackageName as e:
+					msg = "The short ebuild name \"" + x + \
+						"\" is ambiguous.  Please specify " + \
+						"one of the following " + \
+						"fully-qualified ebuild names instead:"
+					for line in textwrap.wrap(msg, 70):
+						writemsg_level("!!! %s\n" % (line,),
+							level=logging.ERROR, noiselevel=-1)
+					for i in e.args[0]:
+						writemsg_level("    %s\n" % colorize("INFORM", i),
+							level=logging.ERROR, noiselevel=-1)
+					writemsg_level("\n", level=logging.ERROR, noiselevel=-1)
+					return 1
+				continue
+			msg = []
+			msg.append("'%s' is not a valid package atom." % (x,))
+			msg.append("Please check ebuild(5) for full details.")
+			writemsg_level("".join("!!! %s\n" % line for line in msg),
+				level=logging.ERROR, noiselevel=-1)
+			return 1
+
+		return action_info(settings, trees, myopts, valid_atoms)
+
+	# "update", "system", or just process files:
+	else:
+		validate_ebuild_environment(trees)
+
+		for x in myfiles:
+			if x.startswith(SETPREFIX) or \
+				is_valid_package_atom(x, allow_repo=True):
+				continue
+			if x[:1] == os.sep:
+				continue
+			try:
+				os.lstat(x)
+				continue
+			except OSError:
+				pass
+			msg = []
+			msg.append("'%s' is not a valid package atom." % (x,))
+			msg.append("Please check ebuild(5) for full details.")
+			writemsg_level("".join("!!! %s\n" % line for line in msg),
+				level=logging.ERROR, noiselevel=-1)
+			return 1
+
+		# GLEP 42 says to display news *after* an emerge --pretend
+		if "--pretend" not in myopts:
+			display_news_notification(root_config, myopts)
+		retval = action_build(settings, trees, mtimedb,
+			myopts, myaction, myfiles, spinner)
+		post_emerge(myaction, myopts, myfiles, settings['EROOT'],
+			trees, mtimedb, retval)
+
+		return retval

diff --git a/pym/_emerge/chk_updated_cfg_files.py b/pym/_emerge/chk_updated_cfg_files.py
new file mode 100644
index 0000000..9f2ab6f
--- /dev/null
+++ b/pym/_emerge/chk_updated_cfg_files.py
@@ -0,0 +1,42 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from __future__ import print_function
+
+import logging
+
+import portage
+from portage import os
+from portage.localization import _
+from portage.output import bold, colorize, yellow
+from portage.util import writemsg_level
+
+def chk_updated_cfg_files(eroot, config_protect):
+	target_root = eroot
+	result = list(
+		portage.util.find_updated_config_files(target_root, config_protect))
+
+	for x in result:
+		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)
+		else: # it's a protected dir
+			if len(x[1]) == 1:
+				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") % \
+					(len(x[1]), x[0]), level=logging.INFO, noiselevel=-1)
+
+	if result:
+		print(" " + yellow("*") + " See the " +
+			colorize("INFORM", _("CONFIGURATION FILES")) +
+			" " + _("section of the") + " " + bold("emerge"))
+		print(" " + yellow("*") + " " +
+			_("man page to learn how to update config files."))

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index eed3999..fd1fd06 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -3,40 +3,18 @@
 
 from __future__ import print_function
 
-import platform
-import signal
 import sys
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
 	'logging',
-	'portage.debug',
-	'portage.dbapi.dep_expand:dep_expand',
-	'portage.news:count_unread_news,display_news_notifications',
-	'portage.emaint.modules.logs.logs:CleanLogs',
-	'portage.output:colorize,xtermTitle,xtermTitleReset',
-	'portage._global_updates:_global_updates',
-	'portage._sets:SETPREFIX',
-	'portage.util:shlex_split,varexpand,writemsg_level,writemsg_stdout',
-	'portage.util._dyn_libs.display_preserved_libs:display_preserved_libs',
-	'portage.util._info_files:chk_updated_info_files',
+	'portage.util:writemsg_level',
 	'textwrap',
-	'time',
-	'_emerge.actions:action_build,action_config,action_info,' + \
-		'action_metadata,action_regen,action_search,action_sync,' + \
-		'action_uninstall,adjust_configs,chk_updated_cfg_files,'+ \
-		'display_missing_pkg_set,display_news_notification,' + \
-		'getportageversion,load_emerge_config',
-	'_emerge.emergelog:emergelog',
+	'_emerge.actions:load_emerge_config,run_action,' + \
+		'validate_ebuild_environment',
 	'_emerge.help:help@emerge_help',
-	'_emerge.is_valid_package_atom:is_valid_package_atom',
-	'_emerge.stdout_spinner:stdout_spinner',
-	'_emerge.userquery:userquery',
-	'_emerge._flush_elog_mod_echo:_flush_elog_mod_echo',
 )
 from portage import os
-from portage import _encodings
-from portage import _unicode_decode
 
 if sys.hexversion >= 0x3000000:
 	long = int
@@ -89,141 +67,6 @@ shortmapping={
 "v":"--verbose",   "V":"--version"
 }
 
-COWSAY_MOO = """
-
-  Larry loves Gentoo (%s)
-
- _______________________
-< Have you mooed today? >
- -----------------------
-        \   ^__^
-         \  (oo)\_______
-            (__)\       )\/\ 
-                ||----w |
-                ||     ||
-
-"""
-
-def post_emerge(myaction, myopts, myfiles,
-	target_root, trees, mtimedb, retval):
-	"""
-	Misc. things to run at the end of a merge session.
-
-	Update Info Files
-	Update Config Files
-	Update News Items
-	Commit mtimeDB
-	Display preserved libs warnings
-
-	@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 EROOT 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
-	@type mtimedb: MtimeDB class instance
-	@param retval: Emerge's return value
-	@type retval: Int
-	"""
-
-	root_config = trees[target_root]["root_config"]
-	vardbapi = trees[target_root]['vartree'].dbapi
-	settings = vardbapi.settings
-	info_mtimes = mtimedb["info"]
-
-	# Load the most current variables from ${ROOT}/etc/profile.env
-	settings.unlock()
-	settings.reload()
-	settings.regenerate()
-	settings.lock()
-
-	config_protect = shlex_split(settings.get("CONFIG_PROTECT", ""))
-	infodirs = settings.get("INFOPATH","").split(":") + \
-		settings.get("INFODIR","").split(":")
-
-	os.chdir("/")
-
-	if retval == os.EX_OK:
-		exit_msg = " *** exiting successfully."
-	else:
-		exit_msg = " *** exiting unsuccessfully with status '%s'." % retval
-	emergelog("notitles" not in settings.features, exit_msg)
-
-	_flush_elog_mod_echo()
-
-	if not vardbapi._pkgs_changed:
-		# GLEP 42 says to display news *after* an emerge --pretend
-		if "--pretend" in myopts:
-			display_news_notification(root_config, myopts)
-		# If vdb state has not changed then there's nothing else to do.
-		return
-
-	vdb_path = os.path.join(root_config.settings['EROOT'], portage.VDB_PATH)
-	portage.util.ensure_dirs(vdb_path)
-	vdb_lock = None
-	if os.access(vdb_path, os.W_OK) and not "--pretend" in myopts:
-		vardbapi.lock()
-		vdb_lock = True
-
-	if vdb_lock:
-		try:
-			if "noinfo" not in settings.features:
-				chk_updated_info_files(target_root,
-					infodirs, info_mtimes)
-			mtimedb.commit()
-		finally:
-			if vdb_lock:
-				vardbapi.unlock()
-
-	# Explicitly load and prune the PreservedLibsRegistry in order
-	# to ensure that we do not display stale data.
-	vardbapi._plib_registry.load()
-
-	if vardbapi._plib_registry.hasEntries():
-		if "--quiet" in myopts:
-			print()
-			print(colorize("WARN", "!!!") + " existing preserved libs found")
-		else:
-			print()
-			print(colorize("WARN", "!!!") + " existing preserved libs:")
-			display_preserved_libs(vardbapi)
-			print("Use " + colorize("GOOD", "emerge @preserved-rebuild") +
-				" to rebuild packages using these libraries")
-
-	chk_updated_cfg_files(settings['EROOT'], config_protect)
-
-	display_news_notification(root_config, myopts)
-
-	postemerge = os.path.join(settings["PORTAGE_CONFIGROOT"],
-		portage.USER_CONFIG_PATH, "bin", "post_emerge")
-	if os.access(postemerge, os.X_OK):
-		hook_retval = portage.process.spawn(
-						[postemerge], env=settings.environ())
-		if hook_retval != os.EX_OK:
-			writemsg_level(
-				" %s spawn failed of %s\n" %
-				(colorize("BAD", "*"), postemerge,),
-				level=logging.ERROR, noiselevel=-1)
-
-	clean_logs(settings)
-
-	if "--quiet" not in myopts and \
-		myaction is None and "@world" in myfiles:
-		show_depclean_suggestion()
-
-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.ewarn(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))
@@ -1090,306 +933,6 @@ def parse_opts(tmpcmdline, silent=False):
 
 	return myaction, myopts, myfiles
 
-# Warn about features that may confuse users and
-# lead them to report invalid bugs.
-_emerge_features_warn = frozenset(['keeptemp', 'keepwork'])
-
-def validate_ebuild_environment(trees):
-	features_warn = set()
-	for myroot in trees:
-		settings = trees[myroot]["vartree"].settings
-		settings.validate()
-		features_warn.update(
-			_emerge_features_warn.intersection(settings.features))
-
-	if features_warn:
-		msg = "WARNING: The FEATURES variable contains one " + \
-			"or more values that should be disabled under " + \
-			"normal circumstances: %s" % " ".join(features_warn)
-		out = portage.output.EOutput()
-		for line in textwrap.wrap(msg, 65):
-			out.ewarn(line)
-
-def apply_priorities(settings):
-	ionice(settings)
-	nice(settings)
-
-def nice(settings):
-	try:
-		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
-	except (OSError, ValueError) as e:
-		out = portage.output.EOutput()
-		out.eerror("Failed to change nice value to '%s'" % \
-			settings["PORTAGE_NICENESS"])
-		out.eerror("%s\n" % str(e))
-
-def ionice(settings):
-
-	ionice_cmd = settings.get("PORTAGE_IONICE_COMMAND")
-	if ionice_cmd:
-		ionice_cmd = portage.util.shlex_split(ionice_cmd)
-	if not ionice_cmd:
-		return
-
-	variables = {"PID" : str(os.getpid())}
-	cmd = [varexpand(x, mydict=variables) for x in ionice_cmd]
-
-	try:
-		rval = portage.process.spawn(cmd, env=os.environ)
-	except portage.exception.CommandNotFound:
-		# The OS kernel probably doesn't support ionice,
-		# so return silently.
-		return
-
-	if rval != os.EX_OK:
-		out = portage.output.EOutput()
-		out.eerror("PORTAGE_IONICE_COMMAND returned %d" % (rval,))
-		out.eerror("See the make.conf(5) man page for PORTAGE_IONICE_COMMAND usage instructions.")
-
-def clean_logs(settings):
-
-	if "clean-logs" not in settings.features:
-		return
-
-	logdir = settings.get("PORT_LOGDIR")
-	if logdir is None or not os.path.isdir(logdir):
-		return
-
-	cleanlogs = CleanLogs()
-	errors = cleanlogs.clean(settings=settings)
-	if errors:
-		out = portage.output.EOutput()
-		for msg in errors:
-			out.eerror(msg)
-
-def setconfig_fallback(root_config):
-	setconfig = root_config.setconfig
-	setconfig._create_default_config()
-	setconfig._parse(update=True)
-	root_config.sets = setconfig.getSets()
-
-def get_missing_sets(root_config):
-	# emerge requires existence of "world", "selected", and "system"
-	missing_sets = []
-
-	for s in ("selected", "system", "world",):
-		if s not in root_config.sets:
-			missing_sets.append(s)
-
-	return missing_sets
-
-def missing_sets_warning(root_config, missing_sets):
-	if len(missing_sets) > 2:
-		missing_sets_str = ", ".join('"%s"' % s for s in missing_sets[:-1])
-		missing_sets_str += ', and "%s"' % missing_sets[-1]
-	elif len(missing_sets) == 2:
-		missing_sets_str = '"%s" and "%s"' % tuple(missing_sets)
-	else:
-		missing_sets_str = '"%s"' % missing_sets[-1]
-	msg = ["emerge: incomplete set configuration, " + \
-		"missing set(s): %s" % missing_sets_str]
-	if root_config.sets:
-		msg.append("        sets defined: %s" % ", ".join(root_config.sets))
-	global_config_path = portage.const.GLOBAL_CONFIG_PATH
-	if root_config.settings['EPREFIX']:
-		global_config_path = os.path.join(root_config.settings['EPREFIX'],
-				portage.const.GLOBAL_CONFIG_PATH.lstrip(os.sep))
-	msg.append("        This usually means that '%s'" % \
-		(os.path.join(global_config_path, "sets/portage.conf"),))
-	msg.append("        is missing or corrupt.")
-	msg.append("        Falling back to default world and system set configuration!!!")
-	for line in msg:
-		writemsg_level(line + "\n", level=logging.ERROR, noiselevel=-1)
-
-def ensure_required_sets(trees):
-	warning_shown = False
-	for root_trees in trees.values():
-		missing_sets = get_missing_sets(root_trees["root_config"])
-		if missing_sets and not warning_shown:
-			warning_shown = True
-			missing_sets_warning(root_trees["root_config"], missing_sets)
-		if missing_sets:
-			setconfig_fallback(root_trees["root_config"])
-
-def expand_set_arguments(myfiles, myaction, root_config):
-	retval = os.EX_OK
-	setconfig = root_config.setconfig
-
-	sets = setconfig.getSets()
-
-	# In order to know exactly which atoms/sets should be added to the
-	# world file, the depgraph performs set expansion later. It will get
-	# confused about where the atoms came from if it's not allowed to
-	# expand them itself.
-	do_not_expand = (None, )
-	newargs = []
-	for a in myfiles:
-		if a in ("system", "world"):
-			newargs.append(SETPREFIX+a)
-		else:
-			newargs.append(a)
-	myfiles = newargs
-	del newargs
-	newargs = []
-
-	# separators for set arguments
-	ARG_START = "{"
-	ARG_END = "}"
-
-	for i in range(0, len(myfiles)):
-		if myfiles[i].startswith(SETPREFIX):
-			start = 0
-			end = 0
-			x = myfiles[i][len(SETPREFIX):]
-			newset = ""
-			while x:
-				start = x.find(ARG_START)
-				end = x.find(ARG_END)
-				if start > 0 and start < end:
-					namepart = x[:start]
-					argpart = x[start+1:end]
-
-					# TODO: implement proper quoting
-					args = argpart.split(",")
-					options = {}
-					for a in args:
-						if "=" in a:
-							k, v  = a.split("=", 1)
-							options[k] = v
-						else:
-							options[a] = "True"
-					setconfig.update(namepart, options)
-					newset += (x[:start-len(namepart)]+namepart)
-					x = x[end+len(ARG_END):]
-				else:
-					newset += x
-					x = ""
-			myfiles[i] = SETPREFIX+newset
-
-	sets = setconfig.getSets()
-
-	# display errors that occurred while loading the SetConfig instance
-	for e in setconfig.errors:
-		print(colorize("BAD", "Error during set creation: %s" % e))
-
-	unmerge_actions = ("unmerge", "prune", "clean", "depclean")
-
-	for a in myfiles:
-		if a.startswith(SETPREFIX):		
-				s = a[len(SETPREFIX):]
-				if s not in sets:
-					display_missing_pkg_set(root_config, s)
-					return (None, 1)
-				if s == "installed":
-					msg = ("The @installed set is deprecated and will soon be "
-					"removed. Please refer to bug #387059 for details.")
-					out = portage.output.EOutput()
-					for line in textwrap.wrap(msg, 50):
-						out.ewarn(line)
-				setconfig.active.append(s)
-				try:
-					set_atoms = setconfig.getSetAtoms(s)
-				except portage.exception.PackageSetNotFound as e:
-					writemsg_level(("emerge: the given set '%s' " + \
-						"contains a non-existent set named '%s'.\n") % \
-						(s, e), level=logging.ERROR, noiselevel=-1)
-					if s in ('world', 'selected') and \
-						SETPREFIX + e.value in sets['selected']:
-						writemsg_level(("Use `emerge --deselect %s%s` to "
-							"remove this set from world_sets.\n") %
-							(SETPREFIX, e,), level=logging.ERROR,
-							noiselevel=-1)
-					return (None, 1)
-				if myaction in unmerge_actions and \
-						not sets[s].supportsOperation("unmerge"):
-					sys.stderr.write("emerge: the given set '%s' does " % s + \
-						"not support unmerge operations\n")
-					retval = 1
-				elif not set_atoms:
-					print("emerge: '%s' is an empty set" % s)
-				elif myaction not in do_not_expand:
-					newargs.extend(set_atoms)
-				else:
-					newargs.append(SETPREFIX+s)
-				for e in sets[s].errors:
-					print(e)
-		else:
-			newargs.append(a)
-	return (newargs, retval)
-
-def repo_name_check(trees):
-	missing_repo_names = set()
-	for root_trees in trees.values():
-		porttree = root_trees.get("porttree")
-		if porttree:
-			portdb = porttree.dbapi
-			missing_repo_names.update(portdb.getMissingRepoNames())
-			if portdb.porttree_root in missing_repo_names and \
-				not os.path.exists(os.path.join(
-				portdb.porttree_root, "profiles")):
-				# This is normal if $PORTDIR happens to be empty,
-				# so don't warn about it.
-				missing_repo_names.remove(portdb.porttree_root)
-
-	if missing_repo_names:
-		msg = []
-		msg.append("WARNING: One or more repositories " + \
-			"have missing repo_name entries:")
-		msg.append("")
-		for p in missing_repo_names:
-			msg.append("\t%s/profiles/repo_name" % (p,))
-		msg.append("")
-		msg.extend(textwrap.wrap("NOTE: Each repo_name entry " + \
-			"should be a plain text file containing a unique " + \
-			"name for the repository on the first line.", 70))
-		msg.append("\n")
-		writemsg_level("".join("%s\n" % l for l in msg),
-			level=logging.WARNING, noiselevel=-1)
-
-	return bool(missing_repo_names)
-
-def repo_name_duplicate_check(trees):
-	ignored_repos = {}
-	for root, root_trees in trees.items():
-		if 'porttree' in root_trees:
-			portdb = root_trees['porttree'].dbapi
-			if portdb.settings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0':
-				for repo_name, paths in portdb.getIgnoredRepos():
-					k = (root, repo_name, portdb.getRepositoryPath(repo_name))
-					ignored_repos.setdefault(k, []).extend(paths)
-
-	if ignored_repos:
-		msg = []
-		msg.append('WARNING: One or more repositories ' + \
-			'have been ignored due to duplicate')
-		msg.append('  profiles/repo_name entries:')
-		msg.append('')
-		for k in sorted(ignored_repos):
-			msg.append('  %s overrides' % ", ".join(k))
-			for path in ignored_repos[k]:
-				msg.append('    %s' % (path,))
-			msg.append('')
-		msg.extend('  ' + x for x in textwrap.wrap(
-			"All profiles/repo_name entries must be unique in order " + \
-			"to avoid having duplicates ignored. " + \
-			"Set PORTAGE_REPO_DUPLICATE_WARN=\"0\" in " + \
-			"/etc/make.conf if you would like to disable this warning."))
-		msg.append("\n")
-		writemsg_level(''.join('%s\n' % l for l in msg),
-			level=logging.WARNING, noiselevel=-1)
-
-	return bool(ignored_repos)
-
-def config_protect_check(trees):
-	for root, root_trees in trees.items():
-		settings = root_trees["root_config"].settings
-		if not settings.get("CONFIG_PROTECT"):
-			msg = "!!! CONFIG_PROTECT is empty"
-			if settings["ROOT"] != "/":
-				msg += " for '%s'" % root
-			msg += "\n"
-			writemsg_level(msg, level=logging.WARN, noiselevel=-1)
-
 def profile_check(trees, myaction):
 	if myaction in ("help", "info", "search", "sync", "version"):
 		return os.EX_OK
@@ -1407,16 +950,6 @@ def profile_check(trees, myaction):
 		return 1
 	return os.EX_OK
 
-def check_procfs():
-	procfs_path = '/proc'
-	if platform.system() not in ("Linux",) or \
-		os.path.ismount(procfs_path):
-		return os.EX_OK
-	msg = "It seems that %s is not mounted. You have been warned." % procfs_path
-	writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
-		level=logging.ERROR, noiselevel=-1)
-	return 1
-
 def emerge_main(args=None):
 	"""
 	@param args: command arguments (default: sys.argv[1:])
@@ -1456,7 +989,6 @@ def emerge_main(args=None):
 	if myaction == "sync":
 		portage._sync_disabled_warnings = True
 	settings, trees, mtimedb = load_emerge_config()
-	portdb = trees[settings['EROOT']]['porttree'].dbapi
 	rval = profile_check(trees, myaction)
 	if rval != os.EX_OK:
 		return rval
@@ -1467,409 +999,4 @@ def emerge_main(args=None):
 	tmpcmdline.extend(args)
 	myaction, myopts, myfiles = parse_opts(tmpcmdline)
 
-	# skip global updates prior to sync, since it's called after sync
-	if myaction not in ('help', 'info', 'sync', 'version') and \
-		myopts.get('--package-moves') != 'n' and \
-		_global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
-		mtimedb.commit()
-		# Reload the whole config from scratch.
-		settings, trees, mtimedb = load_emerge_config(trees=trees)
-		portdb = trees[settings['EROOT']]['porttree'].dbapi
-
-	xterm_titles = "notitles" not in settings.features
-	if xterm_titles:
-		xtermTitle("emerge")
-
-	if "--digest" in myopts:
-		os.environ["FEATURES"] = os.environ.get("FEATURES","") + " digest"
-		# Reload the whole config from scratch so that the portdbapi internal
-		# config is updated with new FEATURES.
-		settings, trees, mtimedb = load_emerge_config(trees=trees)
-		portdb = trees[settings['EROOT']]['porttree'].dbapi
-
-	# NOTE: adjust_configs() can map options to FEATURES, so any relevant
-	# options adjustments should be made prior to calling adjust_configs().
-	if "--buildpkgonly" in myopts:
-		myopts["--buildpkg"] = True
-
-	adjust_configs(myopts, trees)
-	apply_priorities(settings)
-
-	if myaction == 'version':
-		writemsg_stdout(getportageversion(
-			settings["PORTDIR"], None,
-			settings.profile_path, settings["CHOST"],
-			trees[settings['EROOT']]['vartree'].dbapi) + '\n', noiselevel=-1)
-		return 0
-	elif myaction == 'help':
-		emerge_help()
-		return 0
-
-	spinner = stdout_spinner()
-	if "candy" in settings.features:
-		spinner.update = spinner.update_scroll
-
-	if "--quiet" not in myopts:
-		portage.deprecated_profile_check(settings=settings)
-		if portage.const._ENABLE_REPO_NAME_WARN:
-			# Bug #248603 - Disable warnings about missing
-			# repo_name entries for stable branch.
-			repo_name_check(trees)
-		repo_name_duplicate_check(trees)
-		config_protect_check(trees)
-	check_procfs()
-
-	if "getbinpkg" in settings.features:
-		myopts["--getbinpkg"] = True
-
-	if "--getbinpkgonly" in myopts:
-		myopts["--getbinpkg"] = True
-
-	if "--getbinpkgonly" in myopts:
-		myopts["--usepkgonly"] = True
-
-	if "--getbinpkg" in myopts:
-		myopts["--usepkg"] = True
-
-	if "--usepkgonly" in myopts:
-		myopts["--usepkg"] = True
-
-	if "--buildpkgonly" in myopts:
-		# --buildpkgonly will not merge anything, so
-		# it cancels all binary package options.
-		for opt in ("--getbinpkg", "--getbinpkgonly",
-			"--usepkg", "--usepkgonly"):
-			myopts.pop(opt, None)
-
-	for mytrees in trees.values():
-		mydb = mytrees["porttree"].dbapi
-		# Freeze the portdbapi for performance (memoize all xmatch results).
-		mydb.freeze()
-
-		if myaction in ('search', None) and \
-			"--usepkg" in myopts:
-			# Populate the bintree with current --getbinpkg setting.
-			# This needs to happen before expand_set_arguments(), in case
-			# any sets use the bintree.
-			mytrees["bintree"].populate(
-				getbinpkgs="--getbinpkg" in myopts)
-
-	del mytrees, mydb
-
-	if "moo" in myfiles:
-		print(COWSAY_MOO % platform.system())
-		msg = ("The above `emerge moo` display is deprecated. "
-			"Please use `emerge --moo` instead.")
-		for line in textwrap.wrap(msg, 50):
-			print(" %s %s" % (colorize("WARN", "*"), line))
-
-	for x in myfiles:
-		ext = os.path.splitext(x)[1]
-		if (ext == ".ebuild" or ext == ".tbz2") and os.path.exists(os.path.abspath(x)):
-			print(colorize("BAD", "\n*** emerging by path is broken and may not always work!!!\n"))
-			break
-
-	root_config = trees[settings['EROOT']]['root_config']
-	if myaction == "moo":
-		print(COWSAY_MOO % platform.system())
-		return os.EX_OK
-	elif myaction == "list-sets":
-		writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
-		return os.EX_OK
-	elif myaction == "check-news":
-		news_counts = count_unread_news(
-			root_config.trees["porttree"].dbapi,
-			root_config.trees["vartree"].dbapi)
-		if any(news_counts.values()):
-			display_news_notifications(news_counts)
-		elif "--quiet" not in myopts:
-			print("", colorize("GOOD", "*"), "No news items were found.")
-		return os.EX_OK
-
-	ensure_required_sets(trees)
-
-	# only expand sets for actions taking package arguments
-	oldargs = myfiles[:]
-	if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge", None):
-		myfiles, retval = expand_set_arguments(myfiles, myaction, root_config)
-		if retval != os.EX_OK:
-			return retval
-
-		# Need to handle empty sets specially, otherwise emerge will react 
-		# with the help message for empty argument lists
-		if oldargs and not myfiles:
-			print("emerge: no targets left after set expansion")
-			return 0
-
-	if ("--tree" in myopts) and ("--columns" in myopts):
-		print("emerge: can't specify both of \"--tree\" and \"--columns\".")
-		return 1
-
-	if '--emptytree' in myopts and '--noreplace' in myopts:
-		writemsg_level("emerge: can't specify both of " + \
-			"\"--emptytree\" and \"--noreplace\".\n",
-			level=logging.ERROR, noiselevel=-1)
-		return 1
-
-	if ("--quiet" in myopts):
-		spinner.update = spinner.update_quiet
-		portage.util.noiselimit = -1
-
-	if "--fetch-all-uri" in myopts:
-		myopts["--fetchonly"] = True
-
-	if "--skipfirst" in myopts and "--resume" not in myopts:
-		myopts["--resume"] = True
-
-	# Allow -p to remove --ask
-	if "--pretend" in myopts:
-		myopts.pop("--ask", None)
-
-	# forbid --ask when not in a terminal
-	# note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway.
-	if ("--ask" in myopts) and (not sys.stdin.isatty()):
-		portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n",
-			noiselevel=-1)
-		return 1
-
-	if settings.get("PORTAGE_DEBUG", "") == "1":
-		spinner.update = spinner.update_quiet
-		portage.util.noiselimit = 0
-		if "python-trace" in settings.features:
-			portage.debug.set_trace(True)
-
-	if not ("--quiet" in myopts):
-		if '--nospinner' in myopts or \
-			settings.get('TERM') == 'dumb' or \
-			not sys.stdout.isatty():
-			spinner.update = spinner.update_basic
-
-	if "--debug" in myopts:
-		print("myaction", myaction)
-		print("myopts", myopts)
-
-	if not myaction and not myfiles and "--resume" not in myopts:
-		emerge_help()
-		return 1
-
-	pretend = "--pretend" in myopts
-	fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
-	buildpkgonly = "--buildpkgonly" in myopts
-
-	# check if root user is the current user for the actions where emerge needs this
-	if portage.secpass < 2:
-		# We've already allowed "--version" and "--help" above.
-		if "--pretend" not in myopts and myaction not in ("search","info"):
-			need_superuser = myaction in ('clean', 'depclean', 'deselect',
-				'prune', 'unmerge') or not \
-				(fetchonly or \
-				(buildpkgonly and portage.data.secpass >= 1) or \
-				myaction in ("metadata", "regen", "sync"))
-			if portage.secpass < 1 or \
-				need_superuser:
-				if need_superuser:
-					access_desc = "superuser"
-				else:
-					access_desc = "portage group"
-				# Always show portage_group_warning() when only portage group
-				# access is required but the user is not in the portage group.
-				if "--ask" in myopts:
-					writemsg_stdout("This action requires %s access...\n" % \
-						(access_desc,), noiselevel=-1)
-					if portage.secpass < 1 and not need_superuser:
-						portage.data.portage_group_warning()
-					if userquery("Would you like to add --pretend to options?",
-						"--ask-enter-invalid" in myopts) == "No":
-						return 128 + signal.SIGINT
-					myopts["--pretend"] = True
-					del myopts["--ask"]
-				else:
-					sys.stderr.write(("emerge: %s access is required\n") \
-						% access_desc)
-					if portage.secpass < 1 and not need_superuser:
-						portage.data.portage_group_warning()
-					return 1
-
-	# Disable emergelog for everything except build or unmerge operations.
-	# This helps minimize parallel emerge.log entries that can confuse log
-	# parsers like genlop.
-	disable_emergelog = False
-	for x in ("--pretend", "--fetchonly", "--fetch-all-uri"):
-		if x in myopts:
-			disable_emergelog = True
-			break
-	if disable_emergelog:
-		pass
-	elif myaction in ("search", "info"):
-		disable_emergelog = True
-	elif portage.data.secpass < 1:
-		disable_emergelog = True
-
-	import _emerge.emergelog
-	_emerge.emergelog._disable = disable_emergelog
-
-	if not disable_emergelog:
-		if 'EMERGE_LOG_DIR' in settings:
-			try:
-				# At least the parent needs to exist for the lock file.
-				portage.util.ensure_dirs(settings['EMERGE_LOG_DIR'])
-			except portage.exception.PortageException as e:
-				writemsg_level("!!! Error creating directory for " + \
-					"EMERGE_LOG_DIR='%s':\n!!! %s\n" % \
-					(settings['EMERGE_LOG_DIR'], e),
-					noiselevel=-1, level=logging.ERROR)
-				portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
-			else:
-				_emerge.emergelog._emerge_log_dir = settings["EMERGE_LOG_DIR"]
-		else:
-			_emerge.emergelog._emerge_log_dir = os.path.join(os.sep,
-				settings["EPREFIX"].lstrip(os.sep), "var", "log")
-			portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
-
-	if not "--pretend" in myopts:
-		emergelog(xterm_titles, "Started emerge on: "+\
-			_unicode_decode(
-				time.strftime("%b %d, %Y %H:%M:%S", time.localtime()),
-				encoding=_encodings['content'], errors='replace'))
-		myelogstr=""
-		if myopts:
-			opt_list = []
-			for opt, arg in myopts.items():
-				if arg is True:
-					opt_list.append(opt)
-				elif isinstance(arg, list):
-					# arguments like --exclude that use 'append' action
-					for x in arg:
-						opt_list.append("%s=%s" % (opt, x))
-				else:
-					opt_list.append("%s=%s" % (opt, arg))
-			myelogstr=" ".join(opt_list)
-		if myaction:
-			myelogstr += " --" + myaction
-		if myfiles:
-			myelogstr += " " + " ".join(oldargs)
-		emergelog(xterm_titles, " *** emerge " + myelogstr)
-	del oldargs
-
-	def emergeexitsig(signum, frame):
-		signal.signal(signal.SIGTERM, signal.SIG_IGN)
-		portage.util.writemsg("\n\nExiting on signal %(signal)s\n" % {"signal":signum})
-		sys.exit(128 + signum)
-
-	signal.signal(signal.SIGTERM, emergeexitsig)
-
-	def emergeexit():
-		"""This gets out final log message in before we quit."""
-		if "--pretend" not in myopts:
-			emergelog(xterm_titles, " *** terminating.")
-		if xterm_titles:
-			xtermTitleReset()
-	portage.atexit_register(emergeexit)
-
-	if myaction in ("config", "metadata", "regen", "sync"):
-		if "--pretend" in myopts:
-			sys.stderr.write(("emerge: The '%s' action does " + \
-				"not support '--pretend'.\n") % myaction)
-			return 1
-
-	if "sync" == myaction:
-		return action_sync(settings, trees, mtimedb, myopts, myaction)
-	elif "metadata" == myaction:
-		action_metadata(settings, portdb, myopts)
-	elif myaction=="regen":
-		validate_ebuild_environment(trees)
-		return action_regen(settings, portdb, myopts.get("--jobs"),
-			myopts.get("--load-average"))
-	# HELP action
-	elif "config"==myaction:
-		validate_ebuild_environment(trees)
-		action_config(settings, trees, myopts, myfiles)
-
-	# SEARCH action
-	elif "search"==myaction:
-		validate_ebuild_environment(trees)
-		action_search(trees[settings['EROOT']]['root_config'],
-			myopts, myfiles, spinner)
-
-	elif myaction in ('clean', 'depclean', 'deselect', 'prune', 'unmerge'):
-		validate_ebuild_environment(trees)
-		rval = action_uninstall(settings, trees, mtimedb["ldpath"],
-			myopts, myaction, myfiles, spinner)
-		if not (myaction == 'deselect' or buildpkgonly or fetchonly or pretend):
-			post_emerge(myaction, myopts, myfiles, settings['EROOT'],
-				trees, mtimedb, rval)
-		return rval
-
-	elif myaction == 'info':
-
-		# Ensure atoms are valid before calling unmerge().
-		vardb = trees[settings['EROOT']]['vartree'].dbapi
-		portdb = trees[settings['EROOT']]['porttree'].dbapi
-		bindb = trees[settings['EROOT']]["bintree"].dbapi
-		valid_atoms = []
-		for x in myfiles:
-			if is_valid_package_atom(x, allow_repo=True):
-				try:
-					#look at the installed files first, if there is no match
-					#look at the ebuilds, since EAPI 4 allows running pkg_info
-					#on non-installed packages
-					valid_atom = dep_expand(x, mydb=vardb, settings=settings)
-					if valid_atom.cp.split("/")[0] == "null":
-						valid_atom = dep_expand(x, mydb=portdb, settings=settings)
-					if valid_atom.cp.split("/")[0] == "null" and "--usepkg" in myopts:
-						valid_atom = dep_expand(x, mydb=bindb, settings=settings)
-					valid_atoms.append(valid_atom)
-				except portage.exception.AmbiguousPackageName as e:
-					msg = "The short ebuild name \"" + x + \
-						"\" is ambiguous.  Please specify " + \
-						"one of the following " + \
-						"fully-qualified ebuild names instead:"
-					for line in textwrap.wrap(msg, 70):
-						writemsg_level("!!! %s\n" % (line,),
-							level=logging.ERROR, noiselevel=-1)
-					for i in e.args[0]:
-						writemsg_level("    %s\n" % colorize("INFORM", i),
-							level=logging.ERROR, noiselevel=-1)
-					writemsg_level("\n", level=logging.ERROR, noiselevel=-1)
-					return 1
-				continue
-			msg = []
-			msg.append("'%s' is not a valid package atom." % (x,))
-			msg.append("Please check ebuild(5) for full details.")
-			writemsg_level("".join("!!! %s\n" % line for line in msg),
-				level=logging.ERROR, noiselevel=-1)
-			return 1
-
-		return action_info(settings, trees, myopts, valid_atoms)
-
-	# "update", "system", or just process files:
-	else:
-		validate_ebuild_environment(trees)
-
-		for x in myfiles:
-			if x.startswith(SETPREFIX) or \
-				is_valid_package_atom(x, allow_repo=True):
-				continue
-			if x[:1] == os.sep:
-				continue
-			try:
-				os.lstat(x)
-				continue
-			except OSError:
-				pass
-			msg = []
-			msg.append("'%s' is not a valid package atom." % (x,))
-			msg.append("Please check ebuild(5) for full details.")
-			writemsg_level("".join("!!! %s\n" % line for line in msg),
-				level=logging.ERROR, noiselevel=-1)
-			return 1
-
-		# GLEP 42 says to display news *after* an emerge --pretend
-		if "--pretend" not in myopts:
-			display_news_notification(root_config, myopts)
-		retval = action_build(settings, trees, mtimedb,
-			myopts, myaction, myfiles, spinner)
-		post_emerge(myaction, myopts, myfiles, settings['EROOT'],
-			trees, mtimedb, retval)
-
-		return retval
+	return run_action(settings, trees, mtimedb, myaction, myopts, myfiles)

diff --git a/pym/_emerge/post_emerge.py b/pym/_emerge/post_emerge.py
new file mode 100644
index 0000000..d5f1ba5
--- /dev/null
+++ b/pym/_emerge/post_emerge.py
@@ -0,0 +1,165 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from __future__ import print_function
+
+import logging
+import textwrap
+
+import portage
+from portage import os
+from portage.emaint.modules.logs.logs import CleanLogs
+from portage.news import count_unread_news, display_news_notifications
+from portage.output import colorize
+from portage.util._dyn_libs.display_preserved_libs import \
+	display_preserved_libs
+from portage.util._info_files import chk_updated_info_files
+
+from .chk_updated_cfg_files import chk_updated_cfg_files
+from .emergelog import emergelog
+from ._flush_elog_mod_echo import _flush_elog_mod_echo
+
+def clean_logs(settings):
+
+	if "clean-logs" not in settings.features:
+		return
+
+	logdir = settings.get("PORT_LOGDIR")
+	if logdir is None or not os.path.isdir(logdir):
+		return
+
+	cleanlogs = CleanLogs()
+	errors = cleanlogs.clean(settings=settings)
+	if errors:
+		out = portage.output.EOutput()
+		for msg in errors:
+			out.eerror(msg)
+
+def display_news_notification(root_config, myopts):
+	if "news" not in root_config.settings.features:
+		return
+	portdb = root_config.trees["porttree"].dbapi
+	vardb = root_config.trees["vartree"].dbapi
+	news_counts = count_unread_news(portdb, vardb)
+	display_news_notifications(news_counts)
+
+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.ewarn(line)
+
+def post_emerge(myaction, myopts, myfiles,
+	target_root, trees, mtimedb, retval):
+	"""
+	Misc. things to run at the end of a merge session.
+
+	Update Info Files
+	Update Config Files
+	Update News Items
+	Commit mtimeDB
+	Display preserved libs warnings
+
+	@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 EROOT 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
+	@type mtimedb: MtimeDB class instance
+	@param retval: Emerge's return value
+	@type retval: Int
+	"""
+
+	root_config = trees[target_root]["root_config"]
+	vardbapi = trees[target_root]['vartree'].dbapi
+	settings = vardbapi.settings
+	info_mtimes = mtimedb["info"]
+
+	# Load the most current variables from ${ROOT}/etc/profile.env
+	settings.unlock()
+	settings.reload()
+	settings.regenerate()
+	settings.lock()
+
+	config_protect = portage.util.shlex_split(
+		settings.get("CONFIG_PROTECT", ""))
+	infodirs = settings.get("INFOPATH","").split(":") + \
+		settings.get("INFODIR","").split(":")
+
+	os.chdir("/")
+
+	if retval == os.EX_OK:
+		exit_msg = " *** exiting successfully."
+	else:
+		exit_msg = " *** exiting unsuccessfully with status '%s'." % retval
+	emergelog("notitles" not in settings.features, exit_msg)
+
+	_flush_elog_mod_echo()
+
+	if not vardbapi._pkgs_changed:
+		# GLEP 42 says to display news *after* an emerge --pretend
+		if "--pretend" in myopts:
+			display_news_notification(root_config, myopts)
+		# If vdb state has not changed then there's nothing else to do.
+		return
+
+	vdb_path = os.path.join(root_config.settings['EROOT'], portage.VDB_PATH)
+	portage.util.ensure_dirs(vdb_path)
+	vdb_lock = None
+	if os.access(vdb_path, os.W_OK) and not "--pretend" in myopts:
+		vardbapi.lock()
+		vdb_lock = True
+
+	if vdb_lock:
+		try:
+			if "noinfo" not in settings.features:
+				chk_updated_info_files(target_root,
+					infodirs, info_mtimes)
+			mtimedb.commit()
+		finally:
+			if vdb_lock:
+				vardbapi.unlock()
+
+	# Explicitly load and prune the PreservedLibsRegistry in order
+	# to ensure that we do not display stale data.
+	vardbapi._plib_registry.load()
+
+	if vardbapi._plib_registry.hasEntries():
+		if "--quiet" in myopts:
+			print()
+			print(colorize("WARN", "!!!") + " existing preserved libs found")
+		else:
+			print()
+			print(colorize("WARN", "!!!") + " existing preserved libs:")
+			display_preserved_libs(vardbapi)
+			print("Use " + colorize("GOOD", "emerge @preserved-rebuild") +
+				" to rebuild packages using these libraries")
+
+	chk_updated_cfg_files(settings['EROOT'], config_protect)
+
+	display_news_notification(root_config, myopts)
+
+	postemerge = os.path.join(settings["PORTAGE_CONFIGROOT"],
+		portage.USER_CONFIG_PATH, "bin", "post_emerge")
+	if os.access(postemerge, os.X_OK):
+		hook_retval = portage.process.spawn(
+						[postemerge], env=settings.environ())
+		if hook_retval != os.EX_OK:
+			portage.util.writemsg_level(
+				" %s spawn failed of %s\n" %
+				(colorize("BAD", "*"), postemerge,),
+				level=logging.ERROR, noiselevel=-1)
+
+	clean_logs(settings)
+
+	if "--quiet" not in myopts and \
+		myaction is None and "@world" in myfiles:
+		show_depclean_suggestion()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-16 15:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-16 15:55 UTC (permalink / raw
  To: gentoo-commits

commit:     e9fd283aedf54e2effc73f4157524fe9a26993c0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 16 15:55:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 15:55:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9fd283a

run_action: gc locals of calling func

---
 pym/_emerge/actions.py |    9 ++++++++-
 pym/_emerge/main.py    |    3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 3336e9f..c403d89 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3426,7 +3426,14 @@ def repo_name_duplicate_check(trees):
 
 	return bool(ignored_repos)
 
-def run_action(settings, trees, mtimedb, myaction, myopts, myfiles):
+def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
+	gc_locals=None):
+
+	# The caller may have its local variables garbage collected, so
+	# they don't consume any memory during this long-running function.
+	if gc_locals is not None:
+		gc_locals()
+		gc_locals = None
 
 	# skip global updates prior to sync, since it's called after sync
 	if myaction not in ('help', 'info', 'sync', 'version') and \

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index fd1fd06..ef94a47 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -999,4 +999,5 @@ def emerge_main(args=None):
 	tmpcmdline.extend(args)
 	myaction, myopts, myfiles = parse_opts(tmpcmdline)
 
-	return run_action(settings, trees, mtimedb, myaction, myopts, myfiles)
+	return run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
+		gc_locals=locals().clear)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-16 22:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-16 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     95bbfee84072a380ae31202ccc320abc9a1c31a9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 16 22:16:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 22:16:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=95bbfee8

emerge_main: use parse_opts for --help

---
 pym/_emerge/main.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index ef94a47..d31d99a 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -961,12 +961,6 @@ def emerge_main(args=None):
 	# Disable color until we're sure that it should be enabled (after
 	# EMERGE_DEFAULT_OPTS has been parsed).
 	portage.output.havecolor = 0
-
-	# optimize --help (no need to load config / EMERGE_DEFAULT_OPTS)
-	if "--help" in args or "-h" in args:
-		emerge_help()
-		return 0
-
 	portage._disable_legacy_globals()
 	portage.dep._internal_warnings = True
 
@@ -984,6 +978,11 @@ def emerge_main(args=None):
 	if "--accept-properties" in myopts:
 		os.environ["ACCEPT_PROPERTIES"] = myopts["--accept-properties"]
 
+	# optimize --help (no need to load config / EMERGE_DEFAULT_OPTS)
+	if myaction == "help":
+		emerge_help()
+		return os.EX_OK
+
 	# Portage needs to ensure a sane umask for the files it creates.
 	os.umask(0o22)
 	if myaction == "sync":


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-16 23:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-16 23:16 UTC (permalink / raw
  To: gentoo-commits

commit:     43f3b93d4841ce638e73586a8d7b212f86f0c173
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 16 23:15:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 16 23:15:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=43f3b93d

emerge: optimize --moo, remove deprecated moo

The --moo action is fast like --help now. The "moo" argument has been
deprecated since bug #389609, and is now removed.

---
 pym/_emerge/actions.py |   28 ++--------------------------
 pym/_emerge/main.py    |   19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c403d89..fb80173 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -87,21 +87,6 @@ if sys.hexversion >= 0x3000000:
 else:
 	_unicode = unicode
 
-COWSAY_MOO = """
-
-  Larry loves Gentoo (%s)
-
- _______________________
-< Have you mooed today? >
- -----------------------
-        \   ^__^
-         \  (oo)\_______
-            (__)\       )\/\ 
-                ||----w |
-                ||     ||
-
-"""
-
 def action_build(settings, trees, mtimedb,
 	myopts, myaction, myfiles, spinner):
 
@@ -3522,13 +3507,6 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 
 	del mytrees, mydb
 
-	if "moo" in myfiles:
-		print(COWSAY_MOO % platform.system())
-		msg = ("The above `emerge moo` display is deprecated. "
-			"Please use `emerge --moo` instead.")
-		for line in textwrap.wrap(msg, 50):
-			print(" %s %s" % (colorize("WARN", "*"), line))
-
 	for x in myfiles:
 		ext = os.path.splitext(x)[1]
 		if (ext == ".ebuild" or ext == ".tbz2") and \
@@ -3538,10 +3516,8 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 			break
 
 	root_config = trees[settings['EROOT']]['root_config']
-	if myaction == "moo":
-		print(COWSAY_MOO % platform.system())
-		return os.EX_OK
-	elif myaction == "list-sets":
+
+	if myaction == "list-sets":
 		writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
 		return os.EX_OK
 	elif myaction == "check-news":

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index d31d99a..ef91fc6 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -3,6 +3,7 @@
 
 from __future__ import print_function
 
+import platform
 import sys
 
 import portage
@@ -67,6 +68,21 @@ shortmapping={
 "v":"--verbose",   "V":"--version"
 }
 
+COWSAY_MOO = """
+
+  Larry loves Gentoo (%s)
+
+ _______________________
+< Have you mooed today? >
+ -----------------------
+        \   ^__^
+         \  (oo)\_______
+            (__)\       )\/\ 
+                ||----w |
+                ||     ||
+
+"""
+
 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))
@@ -982,6 +998,9 @@ def emerge_main(args=None):
 	if myaction == "help":
 		emerge_help()
 		return os.EX_OK
+	elif myaction == "moo":
+		print(COWSAY_MOO % platform.system())
+		return os.EX_OK
 
 	# Portage needs to ensure a sane umask for the files it creates.
 	os.umask(0o22)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-17  3:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-17  3:37 UTC (permalink / raw
  To: gentoo-commits

commit:     fdb856ae456a559fa74066704cd19858d317ed33
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 17 03:36:49 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 17 03:36:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fdb856ae

Scheduler: tweak job_delay calc for bug #438650

* Max delay is reduced to 5 seconds (was 10).
* Calculated delay is now proportional to current/desired load ratio.
* When a delay is triggered, an event loop timeout is used to ensure
  that scheduling occurs as soon as the delay expires (rather than
  waiting for the _loadavg_latency timeout to expire).

---
 pym/_emerge/Scheduler.py |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 3b55b2b..99493ea 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -52,6 +52,7 @@ from _emerge.EbuildFetcher import EbuildFetcher
 from _emerge.EbuildPhase import EbuildPhase
 from _emerge.emergelog import emergelog
 from _emerge.FakeVartree import FakeVartree
+from _emerge.getloadavg import getloadavg
 from _emerge._find_deep_system_runtime_deps import _find_deep_system_runtime_deps
 from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
 from _emerge.JobStatusDisplay import JobStatusDisplay
@@ -247,9 +248,7 @@ class Scheduler(PollScheduler):
 		# The load average takes some time to respond when new
 		# jobs are added, so we need to limit the rate of adding
 		# new jobs.
-		self._job_delay_max = 10
-		self._job_delay_factor = 1.0
-		self._job_delay_exp = 1.5
+		self._job_delay_max = 5
 		self._previous_job_start_time = None
 
 		# This is used to memoize the _choose_pkg() result when
@@ -1584,15 +1583,27 @@ class Scheduler(PollScheduler):
 		if self._jobs and self._max_load is not None:
 
 			current_time = time.time()
+			try:
+				avg1, avg5, avg15 = getloadavg()
+			except OSError:
+				return False
 
-			delay = self._job_delay_factor * self._jobs ** self._job_delay_exp
+			delay = self._job_delay_max * avg1 / self._max_load
 			if delay > self._job_delay_max:
 				delay = self._job_delay_max
-			if (current_time - self._previous_job_start_time) < delay:
+			elapsed_seconds = current_time - self._previous_job_start_time
+			# elapsed_seconds < 0 means the system clock has been adjusted
+			if elapsed_seconds > 0 and elapsed_seconds < delay:
+				self._event_loop.timeout_add(
+					1000 * (delay - elapsed_seconds), self._schedule_once)
 				return True
 
 		return False
 
+	def _schedule_once(self):
+		self._schedule()
+		return False
+
 	def _schedule_tasks_imp(self):
 		"""
 		@rtype: bool


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-18  0:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-18  0:11 UTC (permalink / raw
  To: gentoo-commits

commit:     8bf4b16ee1e3d5ecf58ce20f19563947bfa917d7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 00:11:37 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 00:11:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8bf4b16e

create_world_atom: account for EAPI 5 sub-slot

---
 pym/_emerge/create_world_atom.py |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/create_world_atom.py b/pym/_emerge/create_world_atom.py
index 35fb7c4..3e05c6d 100644
--- a/pym/_emerge/create_world_atom.py
+++ b/pym/_emerge/create_world_atom.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.dep import _repo_separator
@@ -35,8 +35,7 @@ def create_world_atom(pkg, args_set, root_config):
 	for cpv in portdb.match(cp):
 		for repo in repos:
 			try:
-				available_slots.add(portdb.aux_get(cpv, ["SLOT"],
-					myrepo=repo)[0])
+				available_slots.add(portdb._pkg_str(cpv, repo).slot)
 			except KeyError:
 				pass
 
@@ -44,7 +43,7 @@ def create_world_atom(pkg, args_set, root_config):
 		(len(available_slots) == 1 and "0" not in available_slots)
 	if not slotted:
 		# check the vdb in case this is multislot
-		available_slots = set(vardb.aux_get(cpv, ["SLOT"])[0] \
+		available_slots = set(vardb._pkg_str(cpv, None).slot \
 			for cpv in vardb.match(cp))
 		slotted = len(available_slots) > 1 or \
 			(len(available_slots) == 1 and "0" not in available_slots)
@@ -83,13 +82,12 @@ def create_world_atom(pkg, args_set, root_config):
 			matched_slots = set()
 			if mydb is vardb:
 				for cpv in matches:
-					matched_slots.add(mydb.aux_get(cpv, ["SLOT"])[0])
+					matched_slots.add(mydb._pkg_str(cpv, None).slot)
 			else:
 				for cpv in matches:
 					for repo in repos:
 						try:
-							matched_slots.add(portdb.aux_get(cpv, ["SLOT"],
-								myrepo=repo)[0])
+							matched_slots.add(portdb._pkg_str(cpv, repo).slot)
 						except KeyError:
 							pass
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-18  2:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-18  2:11 UTC (permalink / raw
  To: gentoo-commits

commit:     4f5233d38e2a0f29cd6e9032116730579868a263
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 02:09:49 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 02:09:49 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4f5233d3

actions.py: use _pkg_str for EAPI 5 sub-slot

---
 pym/_emerge/actions.py |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index fb80173..fec2dfa 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1285,11 +1285,8 @@ def action_deselect(settings, trees, opts, atoms):
 								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)))
+					pkg = vardb._pkg_str(cpv, None)
+					expanded_atoms.add(Atom("%s:%s" % (pkg.cp, pkg.slot)))
 
 		discard_atoms = set()
 		for atom in world_set:
@@ -2658,13 +2655,8 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 
 		if owners:
 			for cpv in owners:
-				slot = vardb.aux_get(cpv, ['SLOT'])[0]
-				if not slot:
-					# portage now masks packages with missing slot, but it's
-					# possible that one was installed by an older version
-					atom = portage.cpv_getkey(cpv)
-				else:
-					atom = '%s:%s' % (portage.cpv_getkey(cpv), slot)
+				pkg = vardb._pkg_str(cpv, None)
+				atom = '%s:%s' % (pkg.cp, pkg.slot)
 				valid_atoms.append(portage.dep.Atom(atom))
 		else:
 			writemsg_level(("!!! '%s' is not claimed " + \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-18  2:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-18  2:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ed703963796c5add0c04da01704398d6572f9c29
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 18 02:35:09 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 18 02:35:09 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ed703963

depgraph: fix for EAPI 5 sub-slot in SLOT

---
 pym/_emerge/depgraph.py |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3940b56..ef31d58 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2501,13 +2501,8 @@ class depgraph(object):
 				return 0, []
 
 			for cpv in owners:
-				slot = vardb.aux_get(cpv, ["SLOT"])[0]
-				if not slot:
-					# portage now masks packages with missing slot, but it's
-					# possible that one was installed by an older version
-					atom = Atom(portage.cpv_getkey(cpv))
-				else:
-					atom = Atom("%s:%s" % (portage.cpv_getkey(cpv), slot))
+				pkg = vardb._pkg_str(cpv, None)
+				atom = Atom("%s:%s" % (pkg.cp, pkg.slot))
 				args.append(AtomArg(arg=atom, atom=atom,
 					root_config=root_config))
 
@@ -2834,14 +2829,15 @@ class depgraph(object):
 		slots = set()
 		for cpv in vardb.match(atom):
 			# don't mix new virtuals with old virtuals
-			if portage.cpv_getkey(cpv) == highest_pkg.cp:
-				slots.add(vardb.aux_get(cpv, ["SLOT"])[0])
+			pkg = vardb._pkg_str(cpv, None)
+			if pkg.cp == highest_pkg.cp:
+				slots.add(pkg.slot)
 
-		slots.add(highest_pkg.metadata["SLOT"])
+		slots.add(highest_pkg.slot)
 		if len(slots) == 1:
 			return []
 		greedy_pkgs = []
-		slots.remove(highest_pkg.metadata["SLOT"])
+		slots.remove(highest_pkg.slot)
 		while slots:
 			slot = slots.pop()
 			slot_atom = portage.dep.Atom("%s:%s" % (highest_pkg.cp, slot))
@@ -3833,7 +3829,7 @@ class depgraph(object):
 						other_installed, other_keys in dbs:
 						try:
 							if atom.slot == \
-								other_db.aux_get(cpv, ["SLOT"])[0]:
+								other_db._pkg_str(_unicode(cpv), None).slot:
 								slot_available = True
 								break
 						except KeyError:
@@ -6360,7 +6356,7 @@ class depgraph(object):
 							if is_latest:
 								unstable_keyword_msg[root].append(">=%s %s\n" % (pkg.cpv, keyword))
 							elif is_latest_in_slot:
-								unstable_keyword_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], keyword))
+								unstable_keyword_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.slot, keyword))
 							else:
 								unstable_keyword_msg[root].append("=%s %s\n" % (pkg.cpv, keyword))
 						else:
@@ -6400,7 +6396,7 @@ class depgraph(object):
 							if is_latest:
 								p_mask_change_msg[root].append(">=%s\n" % pkg.cpv)
 							elif is_latest_in_slot:
-								p_mask_change_msg[root].append(">=%s:%s\n" % (pkg.cpv, pkg.metadata["SLOT"]))
+								p_mask_change_msg[root].append(">=%s:%s\n" % (pkg.cpv, pkg.slot))
 							else:
 								p_mask_change_msg[root].append("=%s\n" % pkg.cpv)
 						else:
@@ -6425,7 +6421,7 @@ class depgraph(object):
 				if is_latest:
 					use_changes_msg[root].append(">=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
 				elif is_latest_in_slot:
-					use_changes_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(adjustments)))
+					use_changes_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.slot, " ".join(adjustments)))
 				else:
 					use_changes_msg[root].append("=%s %s\n" % (pkg.cpv, " ".join(adjustments)))
 
@@ -6442,7 +6438,7 @@ class depgraph(object):
 				if is_latest:
 					license_msg[root].append(">=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
 				elif is_latest_in_slot:
-					license_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.metadata["SLOT"], " ".join(sorted(missing_licenses))))
+					license_msg[root].append(">=%s:%s %s\n" % (pkg.cpv, pkg.slot, " ".join(sorted(missing_licenses))))
 				else:
 					license_msg[root].append("=%s %s\n" % (pkg.cpv, " ".join(sorted(missing_licenses))))
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-19  1:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-19  1:28 UTC (permalink / raw
  To: gentoo-commits

commit:     2d2cb6ee98324b478a5671df2178f91104bcbd12
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 19 01:27:59 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 19 01:27:59 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2d2cb6ee

PipeReader: unregister in _cancel

---
 pym/_emerge/PipeReader.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index fcdefb4..7209e9e 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -34,8 +34,9 @@ class PipeReader(AbstractPollTask):
 		self._registered = True
 
 	def _cancel(self):
+		self._unregister()
 		if self.returncode is None:
-			self.returncode = 1
+			self.returncode = self._cancelled_returncode
 
 	def _wait(self):
 		if self.returncode is not None:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-26 17:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-26 17:13 UTC (permalink / raw
  To: gentoo-commits

commit:     3fcf296fdda7fa3f7c36d4d4c3ab55156fcd70fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 26 17:13:16 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 26 17:13:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3fcf296f

depgraph: use _match_slot in multislot match

This amkes sub-slot matching work correctly.

---
 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 fd5dfe8..952d061 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3853,8 +3853,8 @@ class depgraph(object):
 					for other_db, other_type, other_built, \
 						other_installed, other_keys in dbs:
 						try:
-							if atom.slot == \
-								other_db._pkg_str(_unicode(cpv), None).slot:
+							if portage.dep._match_slot(atom,
+								other_db._pkg_str(_unicode(cpv), None)):
 								slot_available = True
 								break
 						except (KeyError, InvalidData):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-10-26 17:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-10-26 17:46 UTC (permalink / raw
  To: gentoo-commits

commit:     4126fcfb04efcedaf857b0f6977effb82c24e1cb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 26 17:45:54 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 26 17:45:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4126fcfb

emerge --info: show linker version, bug #436294

---
 pym/_emerge/actions.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index fec2dfa..2b3e57e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1361,6 +1361,7 @@ def action_info(settings, trees, myopts, myfiles):
 	append = output_buffer.append
 	root_config = trees[settings['EROOT']]['root_config']
 	running_eroot = trees._running_eroot
+	chost = settings.get("CHOST")
 
 	append(getportageversion(settings["PORTDIR"], None,
 		settings.profile_path, settings["CHOST"],
@@ -1382,6 +1383,23 @@ def action_info(settings, trees, myopts, myfiles):
 		lastSync = "Unknown"
 	append("Timestamp of tree: %s" % (lastSync,))
 
+	ld_names = []
+	if chost:
+		ld_names.append(chost + "-ld")
+	ld_names.append("ld")
+	for name in ld_names:
+		try:
+			proc = subprocess.Popen([name, "--version"],
+				stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+		except OSError:
+			pass
+		else:
+			output = _unicode_decode(proc.communicate()[0]).splitlines()
+			proc.wait()
+			if proc.wait() == os.EX_OK and output:
+				append("ld %s" % (output[0]))
+				break
+
 	try:
 		proc = subprocess.Popen(["distcc", "--version"],
 			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-11 17:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-11 17:58 UTC (permalink / raw
  To: gentoo-commits

commit:     d80c5799a59a0420301f215add4c75b7d5e14d73
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 11 17:57:52 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov 11 17:57:52 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d80c5799

pkg_pretend: keep temp on failure for bug #442536

---
 pym/_emerge/Scheduler.py |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 99493ea..5714faf 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -905,13 +905,18 @@ class Scheduler(PollScheduler):
 					failures += 1
 				portage.elog.elog_process(x.cpv, settings)
 			finally:
-				if current_task is not None and current_task.isAlive():
-					current_task.cancel()
-					current_task.wait()
-				clean_phase = EbuildPhase(background=False,
-					phase='clean', scheduler=sched_iface, settings=settings)
-				clean_phase.start()
-				clean_phase.wait()
+
+				if current_task is not None:
+					if current_task.isAlive():
+						current_task.cancel()
+						current_task.wait()
+					if current_task.returncode == os.EX_OK:
+						clean_phase = EbuildPhase(background=False,
+							phase='clean', scheduler=sched_iface,
+							settings=settings)
+						clean_phase.start()
+						clean_phase.wait()
+
 				build_dir.unlock()
 
 		if failures:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-16  4:47 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-16  4:47 UTC (permalink / raw
  To: gentoo-commits

commit:     77a965a9890f196b0a35c8e3e6b6aeafd3554327
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Nov 16 04:46:41 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Fri Nov 16 04:46:41 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=77a965a9

Fix some typos.

---
 pym/_emerge/AbstractEbuildProcess.py |    2 +-
 pym/_emerge/Scheduler.py             |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 375688b..597208f 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -52,7 +52,7 @@ class AbstractEbuildProcess(SpawnProcess):
 		if need_builddir and \
 			not os.path.isdir(self.settings['PORTAGE_BUILDDIR']):
 			msg = _("The ebuild phase '%s' has been aborted "
-			"since PORTAGE_BUILDIR does not exist: '%s'") % \
+			"since PORTAGE_BUILDDIR does not exist: '%s'") % \
 			(self.phase, self.settings['PORTAGE_BUILDDIR'])
 			self._eerror(textwrap.wrap(msg, 72))
 			self._set_returncode((self.pid, 1 << 8))

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5714faf..7c3451e 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -805,7 +805,7 @@ class Scheduler(PollScheduler):
 			build_dir_path = os.path.join(
 				os.path.realpath(settings["PORTAGE_TMPDIR"]),
 				"portage", x.category, x.pf)
-			existing_buildir = os.path.isdir(build_dir_path)
+			existing_builddir = os.path.isdir(build_dir_path)
 			settings["PORTAGE_BUILDDIR"] = build_dir_path
 			build_dir = EbuildBuildDir(scheduler=sched_iface,
 				settings=settings)
@@ -816,7 +816,7 @@ class Scheduler(PollScheduler):
 
 				# Clean up the existing build dir, in case pkg_pretend
 				# checks for available space (bug #390711).
-				if existing_buildir:
+				if existing_builddir:
 					if x.built:
 						tree = "bintree"
 						infloc = os.path.join(build_dir_path, "build-info")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-22 22:16 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-22 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     cfe348a4073a53b44f3850b9328abffc98121f26
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 22 22:16:05 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Thu Nov 22 22:16:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cfe348a4

Fix a typo.

---
 pym/_emerge/Package.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 4c47bca..f73fe82 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -187,7 +187,7 @@ class Package(Task):
 		"""
 		Validate deps. This does not trigger USE calculation since that
 		is expensive for ebuilds and therefore we want to avoid doing
-		in unnecessarily (like for masked packages).
+		it unnecessarily (like for masked packages).
 		"""
 		eapi = self.eapi
 		dep_eapi = eapi


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-24 21:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-24 21:14 UTC (permalink / raw
  To: gentoo-commits

commit:     437c0f1987fa770bd2edf31f1a5a1812391e37fd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 24 21:14:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov 24 21:14:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=437c0f19

emerge --info: report unmatched atom, bug #444596

---
 pym/_emerge/actions.py |   81 ++++++++++++++++++++++++++++--------------------
 1 files changed, 47 insertions(+), 34 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 2b3e57e..b1feba6 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1357,6 +1357,53 @@ class _info_pkgs_ver(object):
 
 def action_info(settings, trees, myopts, myfiles):
 
+	# See if we can find any packages installed matching the strings
+	# passed on the command line
+	mypkgs = []
+	eroot = settings['EROOT']
+	vardb = trees[eroot]["vartree"].dbapi
+	portdb = trees[eroot]['porttree'].dbapi
+	bindb = trees[eroot]["bintree"].dbapi
+	for x in myfiles:
+		match_found = False
+		installed_match = vardb.match(x)
+		for installed in installed_match:
+			mypkgs.append((installed, "installed"))
+			match_found = True
+
+		if match_found:
+			continue
+
+		for db, pkg_type in ((portdb, "ebuild"), (bindb, "binary")):
+			if pkg_type == "binary" and "--usepkg" not in myopts:
+				continue
+
+			matches = db.match(x)
+			matches.reverse()
+			for match in matches:
+				if pkg_type == "binary":
+					if db.bintree.isremote(match):
+						continue
+				auxkeys = ["EAPI", "DEFINED_PHASES"]
+				metadata = dict(zip(auxkeys, db.aux_get(match, auxkeys)))
+				if metadata["EAPI"] not in ("0", "1", "2", "3") and \
+					"info" in metadata["DEFINED_PHASES"].split():
+					mypkgs.append((match, pkg_type))
+					match_found = True
+					break
+
+		if not match_found:
+			xinfo = '"%s"' % x.unevaluated_atom
+			# Discard null/ from failed cpv_expand category expansion.
+			xinfo = xinfo.replace("null/", "")
+			if settings["ROOT"] != "/":
+				xinfo = "%s for %s" % (xinfo, eroot)
+			writemsg("\nemerge: there are no ebuilds to satisfy %s.\n" %
+				colorize("INFORM", xinfo), noiselevel=-1)
+			# TODO: Split out --misspell-suggestions code from depgraph
+			# and call it here.
+			return 1
+
 	output_buffer = []
 	append = output_buffer.append
 	root_config = trees[settings['EROOT']]['root_config']
@@ -1563,40 +1610,6 @@ def action_info(settings, trees, myopts, myfiles):
 	writemsg_stdout("\n".join(output_buffer),
 		noiselevel=-1)
 
-	# See if we can find any packages installed matching the strings
-	# passed on the command line
-	mypkgs = []
-	eroot = settings['EROOT']
-	vardb = trees[eroot]["vartree"].dbapi
-	portdb = trees[eroot]['porttree'].dbapi
-	bindb = trees[eroot]["bintree"].dbapi
-	for x in myfiles:
-		match_found = False
-		installed_match = vardb.match(x)
-		for installed in installed_match:
-			mypkgs.append((installed, "installed"))
-			match_found = True
-
-		if match_found:
-			continue
-
-		for db, pkg_type in ((portdb, "ebuild"), (bindb, "binary")):
-			if pkg_type == "binary" and "--usepkg" not in myopts:
-				continue
-
-			matches = db.match(x)
-			matches.reverse()
-			for match in matches:
-				if pkg_type == "binary":
-					if db.bintree.isremote(match):
-						continue
-				auxkeys = ["EAPI", "DEFINED_PHASES"]
-				metadata = dict(zip(auxkeys, db.aux_get(match, auxkeys)))
-				if metadata["EAPI"] not in ("0", "1", "2", "3") and \
-					"info" in metadata["DEFINED_PHASES"].split():
-					mypkgs.append((match, pkg_type))
-					break
-
 	# If some packages were found...
 	if mypkgs:
 		# Get our global settings (we only print stuff if it varies from


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-24 22:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-24 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     372d0e0dced3f94ba619e722e8a87f0256d52aea
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 24 22:08:23 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov 24 22:08:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=372d0e0d

emerge --info: search similar names, bug #444596

---
 pym/_emerge/actions.py |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index b1feba6..cd52ddb 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -22,6 +22,7 @@ from itertools import chain
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
+	'portage.dbapi._similar_name_search:similar_name_search',
 	'portage.debug',
 	'portage.news:count_unread_news,display_news_notifications',
 	'_emerge.chk_updated_cfg_files:chk_updated_cfg_files',
@@ -1366,6 +1367,7 @@ def action_info(settings, trees, myopts, myfiles):
 	bindb = trees[eroot]["bintree"].dbapi
 	for x in myfiles:
 		match_found = False
+		cp_exists = False
 		installed_match = vardb.match(x)
 		for installed in installed_match:
 			mypkgs.append((installed, "installed"))
@@ -1378,6 +1380,9 @@ def action_info(settings, trees, myopts, myfiles):
 			if pkg_type == "binary" and "--usepkg" not in myopts:
 				continue
 
+			if not cp_exists and db.cp_list(x.cp):
+				cp_exists = True
+
 			matches = db.match(x)
 			matches.reverse()
 			for match in matches:
@@ -1400,8 +1405,34 @@ def action_info(settings, trees, myopts, myfiles):
 				xinfo = "%s for %s" % (xinfo, eroot)
 			writemsg("\nemerge: there are no ebuilds to satisfy %s.\n" %
 				colorize("INFORM", xinfo), noiselevel=-1)
-			# TODO: Split out --misspell-suggestions code from depgraph
-			# and call it here.
+
+			if not cp_exists and myopts.get(
+				"--misspell-suggestions", "y") != "n":
+
+				writemsg("\nemerge: searching for similar names..."
+					, noiselevel=-1)
+
+				dbs = [vardb]
+				#if "--usepkgonly" not in myopts:
+				dbs.append(portdb)
+				if "--usepkg" in myopts:
+					dbs.append(bindb)
+
+				matches = similar_name_search(dbs, x)
+
+				if len(matches) == 1:
+					writemsg("\nemerge: Maybe you meant " + matches[0] + "?\n"
+						, noiselevel=-1)
+				elif len(matches) > 1:
+					writemsg(
+						"\nemerge: Maybe you meant any of these: %s?\n" % \
+						(", ".join(matches),), noiselevel=-1)
+				else:
+					# Generally, this would only happen if
+					# all dbapis are empty.
+					writemsg(" nothing similar found.\n"
+						, noiselevel=-1)
+
 			return 1
 
 	output_buffer = []


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-27  3:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-27  3:45 UTC (permalink / raw
  To: gentoo-commits

commit:     19f87d4ef525cbfd61b17ccd8fecf28f4efc48c9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 27 03:45:33 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov 27 03:45:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19f87d4e

Use Package.counter where appropriate.

---
 pym/_emerge/BlockerDB.py   |    5 ++---
 pym/_emerge/FakeVartree.py |    6 ------
 pym/_emerge/depgraph.py    |   11 ++++-------
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index 8832033..ce8806d 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -51,7 +51,7 @@ class BlockerDB(object):
 			stale_cache.discard(inst_pkg.cpv)
 			cached_blockers = blocker_cache.get(inst_pkg.cpv)
 			if cached_blockers is not None and \
-				cached_blockers.counter != long(inst_pkg.metadata["COUNTER"]):
+				cached_blockers.counter != inst_pkg.counter:
 				cached_blockers = None
 			if cached_blockers is not None:
 				blocker_atoms = cached_blockers.atoms
@@ -72,9 +72,8 @@ class BlockerDB(object):
 				blocker_atoms = [atom for atom in atoms \
 					if atom.startswith("!")]
 				blocker_atoms.sort()
-				counter = long(inst_pkg.metadata["COUNTER"])
 				blocker_cache[inst_pkg.cpv] = \
-					blocker_cache.BlockerData(counter, blocker_atoms)
+					blocker_cache.BlockerData(inst_pkg.counter, blocker_atoms)
 		for cpv in stale_cache:
 			del blocker_cache[cpv]
 		blocker_cache.flush()

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index f618b28..398cde8 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -252,12 +252,6 @@ class FakeVartree(vartree):
 			root_config=self._pkg_root_config,
 			type_name="installed")
 
-		try:
-			mycounter = long(pkg.metadata["COUNTER"])
-		except ValueError:
-			mycounter = 0
-			pkg.metadata["COUNTER"] = str(mycounter)
-
 		self._pkg_cache[pkg] = pkg
 		return pkg
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 365fbf8..df49143 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4950,7 +4950,7 @@ class depgraph(object):
 					self._spinner_update()
 					blocker_data = blocker_cache.get(cpv)
 					if blocker_data is not None and \
-						blocker_data.counter != long(pkg.metadata["COUNTER"]):
+						blocker_data.counter != pkg.counter:
 						blocker_data = None
 
 					# If blocker data from the graph is available, use
@@ -4967,9 +4967,8 @@ class depgraph(object):
 						blockers is not None:
 						# Re-use the blockers from the graph.
 						blocker_atoms = sorted(blockers)
-						counter = long(pkg.metadata["COUNTER"])
 						blocker_data = \
-							blocker_cache.BlockerData(counter, blocker_atoms)
+							blocker_cache.BlockerData(pkg.counter, blocker_atoms)
 						blocker_cache[pkg.cpv] = blocker_data
 						continue
 
@@ -5011,9 +5010,8 @@ class depgraph(object):
 						blocker_atoms = [myatom for myatom in atoms \
 							if myatom.blocker]
 						blocker_atoms.sort()
-						counter = long(pkg.metadata["COUNTER"])
 						blocker_cache[cpv] = \
-							blocker_cache.BlockerData(counter, blocker_atoms)
+							blocker_cache.BlockerData(pkg.counter, blocker_atoms)
 					if blocker_atoms:
 						try:
 							for atom in blocker_atoms:
@@ -5825,8 +5823,7 @@ class depgraph(object):
 							other_version = None
 							for pkg in vardb.match_pkgs(atom):
 								if pkg.cpv == task.cpv and \
-									pkg.metadata["COUNTER"] == \
-									task.metadata["COUNTER"]:
+									pkg.counter == task.counter:
 									continue
 								other_version = pkg
 								break


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-27  6:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-27  6:02 UTC (permalink / raw
  To: gentoo-commits

commit:     bdaca74c12d592d9b955e7009539f1b598497ec2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 27 06:02:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov 27 06:02:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bdaca74c

Add Package.built_time property.

---
 pym/_emerge/Package.py  |    9 +++++++++
 pym/_emerge/depgraph.py |   25 ++++++++-----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 602fea8..86ed5f7 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -109,6 +109,15 @@ class Package(Task):
 		return self._metadata["EAPI"]
 
 	@property
+	def build_time(self):
+		if not self.built:
+			raise AttributeError('build_time')
+		try:
+			return long(self._metadata['BUILD_TIME'])
+		except (KeyError, ValueError):
+			return 0
+
+	@property
 	def defined_phases(self):
 		return self._metadata.defined_phases
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 702f7fe..f5fe435 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -269,13 +269,12 @@ class _rebuild_config(object):
 					return True
 				elif (parent.installed and
 					root_slot not in self.reinstall_list):
-					inst_build_time = parent._metadata.get("BUILD_TIME")
 					try:
 						bin_build_time, = bindb.aux_get(parent.cpv,
 							["BUILD_TIME"])
 					except KeyError:
 						continue
-					if bin_build_time != inst_build_time:
+					if bin_build_time != _unicode(parent.build_time):
 						# 2) Remote binary package is valid, and local package
 						#    is not up to date. Force reinstall.
 						reinstall = True
@@ -593,8 +592,7 @@ class depgraph(object):
 
 			if selected_pkg.installed and \
 				selected_pkg.cpv == pkg.cpv and \
-				selected_pkg._metadata.get('BUILD_TIME') == \
-				pkg._metadata.get('BUILD_TIME'):
+				selected_pkg.build_time == pkg.build_time:
 				# We don't care about ignored binaries when an
 				# identical installed instance is selected to
 				# fill the slot.
@@ -3886,7 +3884,7 @@ class depgraph(object):
 		return True
 
 	def _equiv_binary_installed(self, pkg):
-		build_time = pkg._metadata.get('BUILD_TIME')
+		build_time = pkg.build_time
 		if not build_time:
 			return False
 
@@ -3896,7 +3894,7 @@ class depgraph(object):
 		except PackageNotFound:
 			return False
 
-		return build_time == inst_pkg._metadata.get('BUILD_TIME')
+		return build_time == inst_pkg.build_time
 
 	class _AutounmaskLevel(object):
 		__slots__ = ("allow_use_changes", "allow_unstable_keywords", "allow_license_changes", \
@@ -4317,8 +4315,8 @@ class depgraph(object):
 								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'):
+										selected_pkg.build_time == \
+										pkg.build_time:
 										identical_binary = True
 										break
 
@@ -4551,15 +4549,8 @@ class depgraph(object):
 					# non-empty, in order to avoid cases like to
 					# bug #306659 where BUILD_TIME fields are missing
 					# in local and/or remote Packages file.
-					try:
-						built_timestamp = int(built_pkg._metadata['BUILD_TIME'])
-					except (KeyError, ValueError):
-						built_timestamp = 0
-
-					try:
-						installed_timestamp = int(inst_pkg._metadata['BUILD_TIME'])
-					except (KeyError, ValueError):
-						installed_timestamp = 0
+					built_timestamp = built_pkg.build_time
+					installed_timestamp = inst_pkg.build_time
 
 					if unbuilt_pkg is not None and unbuilt_pkg > built_pkg:
 						pass


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-30  6:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-30  6:24 UTC (permalink / raw
  To: gentoo-commits

commit:     373cc4a651596b86f77d7e9dbf1fbccd61895b54
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 30 06:24:06 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 30 06:24:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=373cc4a6

_LockThread: daemon = True

---
 pym/_emerge/AsynchronousLock.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 6e2d9bd..b4de779 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -123,6 +123,7 @@ class _LockThread(AbstractPollTask):
 		if self._force_dummy:
 			threading_mod = dummy_threading
 		self._thread = threading_mod.Thread(target=self._run_lock)
+		self._thread.daemon = True
 		self._thread.start()
 
 	def _run_lock(self):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-11-30  9:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-11-30  9:12 UTC (permalink / raw
  To: gentoo-commits

commit:     3fce988f670ef2f7c9af677ceb3fbc0f56723bb0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 30 09:11:45 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 30 09:11:47 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3fce988f

Add --oneshot to the portage update suggestion.

Most users probably have it in the @world already but I don't think
everybody needs it there explicitly.

---
 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 b64614e..e5d4132 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2592,7 +2592,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 		print(warn(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended")
 		print(warn(" * ")+"that you update portage now, before any other packages are updated.")
 		print()
-		print(warn(" * ")+"To update portage, run 'emerge portage' now.")
+		print(warn(" * ")+"To update portage, run 'emerge --oneshot portage' now.")
 		print()
 
 	display_news_notification(root_config, myopts)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-02 22:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-02 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     4551596377cf01904245611145be896314254582
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  2 22:15:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  2 22:15:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=45515963

show_masked_packages: handle missing license file

This will fix bug #445628.

---
 pym/_emerge/depgraph.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 65a94ab..568a116 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7575,9 +7575,11 @@ def show_masked_packages(masked_packages):
 			shown_comments.add(comment)
 		portdb = root_config.trees["porttree"].dbapi
 		for l in missing_licenses:
-			l_path = portdb.findLicensePath(l)
 			if l in shown_licenses:
 				continue
+			l_path = portdb.findLicensePath(l)
+			if l_path is None:
+				continue
 			msg = ("A copy of the '%s' license" + \
 			" is located at '%s'.\n\n") % (l, l_path)
 			writemsg(msg, noiselevel=-1)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-04  6:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-04  6:01 UTC (permalink / raw
  To: gentoo-commits

commit:     05a0f8f4dc30a08bc5b41655d9f5b8df40cd6d47
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  4 06:00:29 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec  4 06:00:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=05a0f8f4

emerge --sync: search PATH for rsync binary

This allows to use rsync from prefix when necessary.

---
 pym/_emerge/actions.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e5d4132..d0c3e23 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2095,7 +2095,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 				"control (contains %s).\n!!! Aborting rsync sync.\n") % \
 				(myportdir, vcs_dir), level=logging.ERROR, noiselevel=-1)
 			return 1
-		if not os.path.exists("/usr/bin/rsync"):
+		rsync_binary = portage.process.find_binary("rsync")
+		if rsync_binary is None:
 			print("!!! /usr/bin/rsync does not exist, so rsync support is disabled.")
 			print("!!! Type \"emerge net-misc/rsync\" to enable rsync support.")
 			sys.exit(1)
@@ -2321,7 +2322,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 			if mytimestamp != 0 and "--quiet" not in myopts:
 				print(">>> Checking server timestamp ...")
 
-			rsynccommand = ["/usr/bin/rsync"] + rsync_opts + extra_rsync_opts
+			rsynccommand = [rsync_binary] + rsync_opts + extra_rsync_opts
 
 			if "--debug" in myopts:
 				print(rsynccommand)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-08  1:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-08  1:49 UTC (permalink / raw
  To: gentoo-commits

commit:     1e15b8ddda75d138e9f59950d00478d476fd0dfe
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  8 01:49:27 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec  8 01:49:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1e15b8dd

emerge --info: don't error for existing packages

This will fix bug #446358.

---
 pym/_emerge/actions.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index d0c3e23..fcaa2c1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1366,14 +1366,14 @@ def action_info(settings, trees, myopts, myfiles):
 	portdb = trees[eroot]['porttree'].dbapi
 	bindb = trees[eroot]["bintree"].dbapi
 	for x in myfiles:
-		match_found = False
+		any_match = False
 		cp_exists = False
 		installed_match = vardb.match(x)
 		for installed in installed_match:
 			mypkgs.append((installed, "installed"))
-			match_found = True
+			any_match = True
 
-		if match_found:
+		if any_match:
 			continue
 
 		for db, pkg_type in ((portdb, "ebuild"), (bindb, "binary")):
@@ -1386,6 +1386,7 @@ def action_info(settings, trees, myopts, myfiles):
 			matches = db.match(x)
 			matches.reverse()
 			for match in matches:
+				any_match = True
 				if pkg_type == "binary":
 					if db.bintree.isremote(match):
 						continue
@@ -1394,10 +1395,9 @@ def action_info(settings, trees, myopts, myfiles):
 				if metadata["EAPI"] not in ("0", "1", "2", "3") and \
 					"info" in metadata["DEFINED_PHASES"].split():
 					mypkgs.append((match, pkg_type))
-					match_found = True
 					break
 
-		if not match_found:
+		if not any_match:
 			xinfo = '"%s"' % x.unevaluated_atom
 			# Discard null/ from failed cpv_expand category expansion.
 			xinfo = xinfo.replace("null/", "")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-10  0:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-10  0:56 UTC (permalink / raw
  To: gentoo-commits

commit:     6492e3556114c9306640aeb6f8bfeea65714f8fb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 10 00:56:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 10 00:56:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6492e355

emerge --info: handle bug #446358 more

- old-style virtuals
- masked packages

---
 pym/_emerge/actions.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index fcaa2c1..3f7a6d5 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1367,7 +1367,7 @@ def action_info(settings, trees, myopts, myfiles):
 	bindb = trees[eroot]["bintree"].dbapi
 	for x in myfiles:
 		any_match = False
-		cp_exists = False
+		cp_exists = bool(vardb.match(x.cp))
 		installed_match = vardb.match(x)
 		for installed in installed_match:
 			mypkgs.append((installed, "installed"))
@@ -1380,13 +1380,17 @@ def action_info(settings, trees, myopts, myfiles):
 			if pkg_type == "binary" and "--usepkg" not in myopts:
 				continue
 
-			if not cp_exists and db.cp_list(x.cp):
+			# Use match instead of cp_list, to account for old-style virtuals.
+			if not cp_exists and db.match(x.cp):
+				cp_exists = True
+			# Search for masked packages too.
+			if not cp_exists and hasattr(db, "xmatch") and \
+				db.xmatch("match-all", x.cp):
 				cp_exists = True
 
 			matches = db.match(x)
 			matches.reverse()
 			for match in matches:
-				any_match = True
 				if pkg_type == "binary":
 					if db.bintree.isremote(match):
 						continue
@@ -1397,7 +1401,7 @@ def action_info(settings, trees, myopts, myfiles):
 					mypkgs.append((match, pkg_type))
 					break
 
-		if not any_match:
+		if not cp_exists:
 			xinfo = '"%s"' % x.unevaluated_atom
 			# Discard null/ from failed cpv_expand category expansion.
 			xinfo = xinfo.replace("null/", "")
@@ -1406,8 +1410,7 @@ def action_info(settings, trees, myopts, myfiles):
 			writemsg("\nemerge: there are no ebuilds to satisfy %s.\n" %
 				colorize("INFORM", xinfo), noiselevel=-1)
 
-			if not cp_exists and myopts.get(
-				"--misspell-suggestions", "y") != "n":
+			if myopts.get("--misspell-suggestions", "y") != "n":
 
 				writemsg("\nemerge: searching for similar names..."
 					, noiselevel=-1)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-10  2:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-10  2:07 UTC (permalink / raw
  To: gentoo-commits

commit:     30173b79783cb3cc24bce27ece43cc5d77e3ba4b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 10 02:07:40 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 10 02:07:40 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=30173b79

get_real_flag: handle implicit iuse

---
 pym/_emerge/Package.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index e19b784..f3be19b 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -652,8 +652,11 @@ class Package(Task):
 				for k, v in self.alias_mapping.items():
 					if flag in v:
 						return k
-			else:
-				return None
+
+			if self._iuse_implicit_match(flag):
+				return flag
+
+			return None
 
 	def __len__(self):
 		return 4


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-18  7:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-18  7:04 UTC (permalink / raw
  To: gentoo-commits

commit:     170e34e429313202fed52a95f3ee56203587d40d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 18 07:03:45 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 18 07:03:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=170e34e4

depclean summary: count nested sets, bug #298298

---
 pym/_emerge/actions.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 3f7a6d5..f3bf858 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -619,11 +619,17 @@ def action_depclean(settings, trees, ldpath_mtimes,
 	if not cleanlist and "--quiet" in myopts:
 		return rval
 
+	set_atoms = {}
+	for k in ("system", "selected"):
+		try:
+			set_atoms[k] = root_config.setconfig.getSetAtoms(k)
+		except portage.exception.PackageSetNotFound:
+			# A nested set could not be resolved, so ignore nested sets.
+			set_atoms[k] = root_config.sets[k].getAtoms()
+
 	print("Packages installed:   " + str(len(vardb.cpv_all())))
-	print("Packages in world:    " + \
-		str(len(root_config.sets["selected"].getAtoms())))
-	print("Packages in system:   " + \
-		str(len(root_config.sets["system"].getAtoms())))
+	print("Packages in world:    %d" % len(set_atoms["selected"]))
+	print("Packages in system:   %d" % len(set_atoms["system"]))
 	print("Required packages:    "+str(req_pkg_count))
 	if "--pretend" in myopts:
 		print("Number to remove:     "+str(len(cleanlist)))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-18  7:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-18  7:10 UTC (permalink / raw
  To: gentoo-commits

commit:     efe5be143560dc608db276175508fd726b8f3621
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 18 07:10:19 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 18 07:10:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=efe5be14

depclean warning: count nested sets, bug #298298

---
 pym/_emerge/actions.py |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index f3bf858..982197b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -662,13 +662,21 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 	required_sets[protected_set_name] = protected_set
 	system_set = psets["system"]
 
-	if not system_set or not selected_set:
+	set_atoms = {}
+	for k in ("system", "selected"):
+		try:
+			set_atoms[k] = root_config.setconfig.getSetAtoms(k)
+		except portage.exception.PackageSetNotFound:
+			# A nested set could not be resolved, so ignore nested sets.
+			set_atoms[k] = root_config.sets[k].getAtoms()
+
+	if not set_atoms["system"] or not set_atoms["selected"]:
 
-		if not system_set:
+		if not set_atoms["system"]:
 			writemsg_level("!!! You have no system list.\n",
 				level=logging.ERROR, noiselevel=-1)
 
-		if not selected_set:
+		if not set_atoms["selected"]:
 			writemsg_level("!!! You have no world file.\n",
 					level=logging.WARNING, noiselevel=-1)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-24 22:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-24 22:13 UTC (permalink / raw
  To: gentoo-commits

commit:     d5d4b79b673a2fa16ee40621ab7939e2771419e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 24 22:13:22 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 24 22:13:22 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5d4b79b

emerge -h: add @ prefix to system and world sets

---
 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 a1dbb37..a0d2870 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -9,7 +9,7 @@ def help():
 	print(bold("emerge:")+" the other white meat (command-line interface to the Portage system)")
 	print(bold("Usage:"))
 	print("   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] [ "+turquoise("ebuild")+" | "+turquoise("tbz2")+" | "+turquoise("file")+" | "+turquoise("@set")+" | "+turquoise("atom")+" ] [ ... ]")
-	print("   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("system")+" | "+turquoise("world")+" >")
+	print("   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("@system")+" | "+turquoise("@world")+" >")
 	print("   "+turquoise("emerge")+" < "+turquoise("--sync")+" | "+turquoise("--metadata")+" | "+turquoise("--info")+" >")
 	print("   "+turquoise("emerge")+" "+turquoise("--resume")+" [ "+green("--pretend")+" | "+green("--ask")+" | "+green("--skipfirst")+" ]")
 	print("   "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("--verbose")+" ] ")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-31  1:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-31  1:05 UTC (permalink / raw
  To: gentoo-commits

commit:     a3100be184ba1cac2f672f0a1cadcf01690c6d3f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 31 01:01:59 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 31 01:04:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3100be1

AsynchronousTask: add _async_wait method

For cases where _start returns synchronously, this method is a
convenient way to trigger an asynchronous call to self.wait()
(in order to notify exit listeners), avoiding excessive event
loop recursion (or stack overflow) that synchronous calling of
exit listeners can cause.

---
 pym/_emerge/AbstractEbuildProcess.py |    2 +-
 pym/_emerge/AsynchronousLock.py      |    2 +-
 pym/_emerge/AsynchronousTask.py      |   14 ++++++++++++++
 pym/_emerge/BinpkgFetcher.py         |    2 +-
 pym/_emerge/BinpkgVerifier.py        |    5 ++---
 pym/_emerge/EbuildBuild.py           |    4 ++--
 pym/_emerge/EbuildFetcher.py         |    6 +++---
 pym/_emerge/EbuildMetadataPhase.py   |    6 +++---
 pym/_emerge/MergeListItem.py         |    2 +-
 pym/_emerge/PackageUninstall.py      |    6 +++---
 pym/_emerge/SpawnProcess.py          |    2 +-
 11 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 597208f..6d12cd9 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -56,7 +56,7 @@ class AbstractEbuildProcess(SpawnProcess):
 			(self.phase, self.settings['PORTAGE_BUILDDIR'])
 			self._eerror(textwrap.wrap(msg, 72))
 			self._set_returncode((self.pid, 1 << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		if self.background:

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index b4de779..5bb9663 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -49,7 +49,7 @@ class AsynchronousLock(AsynchronousTask):
 				pass
 			else:
 				self.returncode = os.EX_OK
-				self.wait()
+				self._async_wait()
 				return
 
 		if self._force_process or \

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 7a193ce..b540575 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -60,6 +60,20 @@ class AsynchronousTask(SlotObject):
 	def _wait(self):
 		return self.returncode
 
+	def _async_wait(self):
+		"""
+		For cases where _start exits synchronously, this method is a
+		convenient way to trigger an asynchronous call to self.wait()
+		(in order to notify exit listeners), avoiding excessive event
+		loop recursion (or stack overflow) that synchronous calling of
+		exit listeners can cause.
+		"""
+		self.scheduler.idle_add(self._async_wait_cb)
+
+	def _async_wait_cb(self):
+		self.wait()
+		return False
+
 	def cancel(self):
 		"""
 		Cancel the task, but do not wait for exit status. If asynchronous exit

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 14f2552..099d3c4 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -63,7 +63,7 @@ class BinpkgFetcher(SpawnProcess):
 		if pretend:
 			portage.writemsg_stdout("\n%s\n" % uri, noiselevel=-1)
 			self._set_returncode((self.pid, os.EX_OK << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		protocol = urllib_parse_urlparse(uri)[0]

diff --git a/pym/_emerge/BinpkgVerifier.py b/pym/_emerge/BinpkgVerifier.py
index 0052967..fd4f266 100644
--- a/pym/_emerge/BinpkgVerifier.py
+++ b/pym/_emerge/BinpkgVerifier.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -71,5 +71,4 @@ class BinpkgVerifier(AsynchronousTask):
 				background=self.background)
 
 		self.returncode = rval
-		self.wait()
-
+		self._async_wait()

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index cec63d9..599875a 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -35,7 +35,7 @@ class EbuildBuild(CompositeTask):
 			if rval != os.EX_OK:
 				self.returncode = rval
 				self._current_task = None
-				self.wait()
+				self._async_wait()
 				return
 
 		root_config = pkg.root_config
@@ -60,7 +60,7 @@ class EbuildBuild(CompositeTask):
 		if not self._check_manifest():
 			self.returncode = 1
 			self._current_task = None
-			self.wait()
+			self._async_wait()
 			return
 
 		prefetcher = self.prefetcher

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 3cbe1b8..df790b0 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -117,13 +117,13 @@ class EbuildFetcher(ForkProcess):
 			msg_lines.append(msg)
 			self._eerror(msg_lines)
 			self._set_returncode((self.pid, 1 << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		if not uri_map:
 			# Nothing to fetch.
 			self._set_returncode((self.pid, os.EX_OK << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		settings = self.config_pool.allocate()
@@ -135,7 +135,7 @@ class EbuildFetcher(ForkProcess):
 			self._prefetch_size_ok(uri_map, settings, ebuild_path):
 			self.config_pool.deallocate(settings)
 			self._set_returncode((self.pid, os.EX_OK << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		nocolor = settings.get("NOCOLOR")

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index cc8d775..89734e0 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -51,14 +51,14 @@ class EbuildMetadataPhase(SubProcess):
 			# An empty EAPI setting is invalid.
 			self._eapi_invalid(None)
 			self._set_returncode((self.pid, 1 << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		self.eapi_supported = portage.eapi_is_supported(parsed_eapi)
 		if not self.eapi_supported:
 			self.metadata = {"EAPI": parsed_eapi}
 			self._set_returncode((self.pid, os.EX_OK << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		settings = self.settings
@@ -114,7 +114,7 @@ class EbuildMetadataPhase(SubProcess):
 			# doebuild failed before spawning
 			self._unregister()
 			self._set_returncode((self.pid, retval << 8))
-			self.wait()
+			self._async_wait()
 			return
 
 		self.pid = retval[0]

diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index 371e2e2..172dfcc 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -32,7 +32,7 @@ class MergeListItem(CompositeTask):
 		if pkg.installed:
 			# uninstall,  executed by self.merge()
 			self.returncode = os.EX_OK
-			self.wait()
+			self._async_wait()
 			return
 
 		args_set = self.args_set

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index eb6a947..16c2f74 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import logging
@@ -33,7 +33,7 @@ class PackageUninstall(CompositeTask):
 			# Apparently the package got uninstalled
 			# already, so we can safely return early.
 			self.returncode = os.EX_OK
-			self.wait()
+			self._async_wait()
 			return
 
 		self.settings.setcpv(self.pkg)
@@ -67,7 +67,7 @@ class PackageUninstall(CompositeTask):
 		if retval != os.EX_OK:
 			self._builddir_lock.unlock()
 			self.returncode = retval
-			self.wait()
+			self._async_wait()
 			return
 
 		self._writemsg_level(">>> Unmerging %s...\n" % (self.pkg.cpv,),

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 45d7095..2045b2e 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -96,7 +96,7 @@ class SpawnProcess(SubProcess):
 			# spawn failed
 			self._unregister()
 			self._set_returncode((self.pid, retval))
-			self.wait()
+			self._async_wait()
 			return
 
 		self.pid = retval[0]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-31 22:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-31 22:12 UTC (permalink / raw
  To: gentoo-commits

commit:     b4529d628d7bf4fc39640c7b17f3d23f9c93e17d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 31 22:11:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 31 22:11:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b4529d62

AsynchronousTask: _async_wait is thread-safe

---
 pym/_emerge/AsynchronousTask.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index b540575..da58261 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -66,7 +66,7 @@ class AsynchronousTask(SlotObject):
 		convenient way to trigger an asynchronous call to self.wait()
 		(in order to notify exit listeners), avoiding excessive event
 		loop recursion (or stack overflow) that synchronous calling of
-		exit listeners can cause.
+		exit listeners can cause. This method is thread-safe.
 		"""
 		self.scheduler.idle_add(self._async_wait_cb)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-31 22:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-31 22:24 UTC (permalink / raw
  To: gentoo-commits

commit:     43ec4d594870656fa2fb0ef169912e288d66101a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 31 22:24:04 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 31 22:24:04 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=43ec4d59

_LockThread: use thread-safe EventLoop.idle_add()

---
 pym/_emerge/AsynchronousLock.py |   43 +++++++-------------------------------
 1 files changed, 8 insertions(+), 35 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 5bb9663..2de1acd 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -105,19 +105,9 @@ class _LockThread(AbstractPollTask):
 	"""
 
 	__slots__ = ('path',) + \
-		('_files', '_force_dummy', '_lock_obj',
-		'_thread', '_reg_id',)
+		('_force_dummy', '_lock_obj', '_thread',)
 
 	def _start(self):
-		pr, pw = os.pipe()
-		self._files = {}
-		self._files['pipe_read'] = pr
-		self._files['pipe_write'] = pw
-		for f in self._files.values():
-			fcntl.fcntl(f, fcntl.F_SETFL,
-				fcntl.fcntl(f, fcntl.F_GETFL) | os.O_NONBLOCK)
-		self._reg_id = self.scheduler.io_add_watch(self._files['pipe_read'],
-			self.scheduler.IO_IN, self._output_handler)
 		self._registered = True
 		threading_mod = threading
 		if self._force_dummy:
@@ -128,22 +118,14 @@ class _LockThread(AbstractPollTask):
 
 	def _run_lock(self):
 		self._lock_obj = lockfile(self.path, wantnewlockfile=True)
-		os.write(self._files['pipe_write'], b'\0')
-
-	def _output_handler(self, f, event):
-		buf = None
-		if event & self.scheduler.IO_IN:
-			try:
-				buf = os.read(self._files['pipe_read'], self._bufsize)
-			except OSError as e:
-				if e.errno not in (errno.EAGAIN,):
-					raise
-		if buf:
-			self._unregister()
-			self.returncode = os.EX_OK
-			self.wait()
+		# Thread-safe callback to EventLoop
+		self.scheduler.idle_add(self._run_lock_cb)
 
-		return True
+	def _run_lock_cb(self):
+		self._unregister()
+		self.returncode = os.EX_OK
+		self.wait()
+		return False
 
 	def _cancel(self):
 		# There's currently no way to force thread termination.
@@ -164,15 +146,6 @@ class _LockThread(AbstractPollTask):
 			self._thread.join()
 			self._thread = None
 
-		if self._reg_id is not None:
-			self.scheduler.source_remove(self._reg_id)
-			self._reg_id = None
-
-		if self._files is not None:
-			for f in self._files.values():
-				os.close(f)
-			self._files = None
-
 class _LockProcess(AbstractPollTask):
 	"""
 	This uses the portage.locks module to acquire a lock asynchronously,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2012-12-31 23:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2012-12-31 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     925eadd210dbc3802000d92f458ae7029832273e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 31 23:52:46 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec 31 23:52:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=925eadd2

emerge --depclean: clarify unsatisfied atoms

If the atom is unsatisfied due to a USE dep that's only visible in the
unevaluated form, then display the unevaluated form.

---
 pym/_emerge/actions.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a498ae4..6a3815a 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -829,7 +829,12 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 			msg.append("the following required packages not being installed:")
 			msg.append("")
 			for atom, parent in unresolvable:
-				msg.append("  %s pulled in by:" % (atom,))
+				if atom != atom.unevaluated_atom and \
+					vardb.match(_unicode(atom)):
+					msg.append("  %s (%s) pulled in by:" %
+						(atom.unevaluated_atom, atom))
+				else:
+					msg.append("  %s pulled in by:" % (atom,))
 				msg.append("    %s" % (parent,))
 				msg.append("")
 			msg.extend(textwrap.wrap(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-01 11:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-01 11:09 UTC (permalink / raw
  To: gentoo-commits

commit:     83cfc04df383b56592b89f1dc58428c0e8d09925
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  1 11:08:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan  1 11:08:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=83cfc04d

AsynchronousLock: override _async_wait_cb

---
 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 2de1acd..5205414 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -119,12 +119,12 @@ class _LockThread(AbstractPollTask):
 	def _run_lock(self):
 		self._lock_obj = lockfile(self.path, wantnewlockfile=True)
 		# Thread-safe callback to EventLoop
-		self.scheduler.idle_add(self._run_lock_cb)
+		self._async_wait()
 
-	def _run_lock_cb(self):
+	def _async_wait_cb(self):
 		self._unregister()
 		self.returncode = os.EX_OK
-		self.wait()
+		AbstractPollTask._async_wait_cb(self)
 		return False
 
 	def _cancel(self):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-01 22:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-01 22:39 UTC (permalink / raw
  To: gentoo-commits

commit:     60b16cdad4392093707873b98ea2adab1e0c642f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  1 22:37:45 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan  1 22:37:45 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60b16cda

Revert "AsynchronousLock: override _async_wait_cb"

This reverts commit 83cfc04df383b56592b89f1dc58428c0e8d09925.
This override could be bad if the base class needs to call _async_wait
for some reason.

---
 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 5205414..2de1acd 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -119,12 +119,12 @@ class _LockThread(AbstractPollTask):
 	def _run_lock(self):
 		self._lock_obj = lockfile(self.path, wantnewlockfile=True)
 		# Thread-safe callback to EventLoop
-		self._async_wait()
+		self.scheduler.idle_add(self._run_lock_cb)
 
-	def _async_wait_cb(self):
+	def _run_lock_cb(self):
 		self._unregister()
 		self.returncode = os.EX_OK
-		AbstractPollTask._async_wait_cb(self)
+		self.wait()
 		return False
 
 	def _cancel(self):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-02  2:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-02  2:54 UTC (permalink / raw
  To: gentoo-commits

commit:     1e35d5d8eb2d08674ea76b59a6e09d738d25eb42
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 02:42:18 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 02:52:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1e35d5d8

FakeVartree: split _apply_dynamic_deps method

This will eventually be used for parallelization of aux_get/regen
processes.

---
 pym/_emerge/FakeVartree.py |   65 ++++++++++++++++++++++++++-----------------
 1 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index a0a506e..31ff65c 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -33,6 +33,9 @@ class FakeVardbapi(PackageVirtualDbapi):
 			path =os.path.join(path, filename)
 		return path
 
+class _DynamicDepsNotApplicable(Exception):
+	pass
+
 class FakeVartree(vartree):
 	"""This is implements an in-memory copy of a vartree instance that provides
 	all the interfaces required for use by the depgraph.  The vardb is locked
@@ -102,28 +105,30 @@ class FakeVartree(vartree):
 			self._aux_get_wrapper(cpv, [])
 		return matches
 
-	def _aux_get_wrapper(self, pkg, wants, myrepo=None):
-		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.
-		pkg_obj = self.dbapi._cpv_map[pkg]
-		installed_eapi = pkg_obj.eapi
-		eapi_attrs = _get_eapi_attrs(installed_eapi)
-		built_slot_operator_atoms = None
-
-		if eapi_attrs.slot_operator and not self._ignore_built_slot_operator_deps:
-			try:
-				built_slot_operator_atoms = find_built_slot_operator_atoms(pkg_obj)
-			except InvalidDependString:
-				pass
+	def _aux_get_wrapper(self, cpv, wants, myrepo=None):
+		if cpv in self._aux_get_history:
+			return self._aux_get(cpv, wants)
+		self._aux_get_history.add(cpv)
+
+		# This raises a KeyError to the caller if appropriate.
+		pkg = self.dbapi._cpv_map[cpv]
 
 		try:
-			# Use the live ebuild metadata if possible.
 			live_metadata = dict(zip(self._portdb_keys,
-				self._portdb.aux_get(pkg, self._portdb_keys,
-				myrepo=pkg_obj.repo)))
+				self._portdb.aux_get(cpv, self._portdb_keys,
+				myrepo=pkg.repo)))
+		except (KeyError, portage.exception.PortageException):
+			live_metadata = None
+
+		self._apply_dynamic_deps(pkg, live_metadata)
+
+		return self._aux_get(cpv, wants)
+
+	def _apply_dynamic_deps(self, pkg, live_metadata):
+
+		try:
+			if live_metadata is None:
+				raise _DynamicDepsNotApplicable()
 			# 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
@@ -133,26 +138,34 @@ class FakeVartree(vartree):
 			# 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)
+				portage.eapi_is_supported(pkg.eapi)):
+				raise _DynamicDepsNotApplicable()
 
 			# preserve built slot/sub-slot := operator deps
+			built_slot_operator_atoms = None
+			if not self._ignore_built_slot_operator_deps and \
+				_get_eapi_attrs(pkg.eapi).slot_operator:
+				try:
+					built_slot_operator_atoms = \
+						find_built_slot_operator_atoms(pkg)
+				except InvalidDependString:
+					pass
+
 			if built_slot_operator_atoms:
 				live_eapi_attrs = _get_eapi_attrs(live_metadata["EAPI"])
 				if not live_eapi_attrs.slot_operator:
-					raise KeyError(pkg)
+					raise _DynamicDepsNotApplicable()
 				for k, v in built_slot_operator_atoms.items():
 					live_metadata[k] += (" " +
 						" ".join(_unicode(atom) for atom in v))
 
-			self.dbapi.aux_update(pkg, live_metadata)
-		except (KeyError, portage.exception.PortageException):
+			self.dbapi.aux_update(pkg.cpv, live_metadata)
+		except _DynamicDepsNotApplicable:
 			if self._global_updates is None:
 				self._global_updates = \
 					grab_global_updates(self._portdb)
 			perform_global_updates(
-				pkg, self.dbapi, self._global_updates)
-		return self._aux_get(pkg, wants)
+				pkg.cpv, self.dbapi, self._global_updates)
 
 	def cpv_discard(self, pkg):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-02  4:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-02  4:48 UTC (permalink / raw
  To: gentoo-commits

commit:     5681942aabf65daa31c5e591f0d1d99e0d2bc70f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 04:48:05 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 04:48:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5681942a

depgraph: dynamic deps parallel metadata regen

---
 pym/_emerge/FakeVartree.py |    7 +++++
 pym/_emerge/depgraph.py    |   60 ++++++++++++++++++++++++++++++++++++++------
 2 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index 31ff65c..058c1c7 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -167,6 +167,13 @@ class FakeVartree(vartree):
 			perform_global_updates(
 				pkg.cpv, self.dbapi, self._global_updates)
 
+	def dynamic_deps_preload(self, pkg, metadata):
+		if metadata is not None:
+			metadata = dict((k, metadata.get(k, ''))
+				for k in self._portdb_keys)
+		self._apply_dynamic_deps(pkg, metadata)
+		self._aux_get_history.add(pkg.cpv)
+
 	def cpv_discard(self, pkg):
 		"""
 		Discard a package from the fake vardb if it exists.

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fab87d9..47f1b60 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -41,6 +41,7 @@ from portage.util import ensure_dirs
 from portage.util import writemsg_level, write_atomic
 from portage.util.digraph import digraph
 from portage.util.listdir import _ignorecvs_dirs
+from portage.util._async.TaskScheduler import TaskScheduler
 from portage.versions import catpkgsplit
 
 from _emerge.AtomArg import AtomArg
@@ -54,6 +55,7 @@ from _emerge.DependencyArg import DependencyArg
 from _emerge.DepPriority import DepPriority
 from _emerge.DepPriorityNormalRange import DepPriorityNormalRange
 from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange
+from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
 from _emerge.FakeVartree import FakeVartree
 from _emerge._find_deep_system_runtime_deps import _find_deep_system_runtime_deps
 from _emerge.is_valid_package_atom import insert_category_into_atom, \
@@ -551,17 +553,59 @@ class depgraph(object):
 				fakedb = self._dynamic_config._graph_trees[
 					myroot]["vartree"].dbapi
 
-				for pkg in vardb:
-					self._spinner_update()
-					if dynamic_deps:
-						# This causes FakeVartree to update the
-						# Package instance dependencies via
-						# PackageVirtualDbapi.aux_update()
-						vardb.aux_get(pkg.cpv, [])
-					fakedb.cpv_inject(pkg)
+				if not dynamic_deps:
+					for pkg in vardb:
+						fakedb.cpv_inject(pkg)
+				else:
+					max_jobs = self._frozen_config.myopts.get("--jobs")
+					max_load = self._frozen_config.myopts.get("--load-average")
+					scheduler = TaskScheduler(
+						self._dynamic_deps_preload(fake_vartree, fakedb),
+						max_jobs=max_jobs,
+						max_load=max_load,
+						event_loop=fake_vartree._portdb._event_loop)
+					scheduler.start()
+					scheduler.wait()
 
 		self._dynamic_config._vdb_loaded = True
 
+	def _dynamic_deps_preload(self, fake_vartree, fakedb):
+		portdb = fake_vartree._portdb
+		for pkg in fake_vartree.dbapi:
+			self._spinner_update()
+			fakedb.cpv_inject(pkg)
+			ebuild_path, repo_path = \
+				portdb.findname2(pkg.cpv, myrepo=pkg.repo)
+			if ebuild_path is None:
+				fake_vartree.dynamic_deps_preload(pkg, None)
+				continue
+			metadata, ebuild_hash = portdb._pull_valid_cache(
+				pkg.cpv, ebuild_path, repo_path)
+			if metadata is not None:
+				fake_vartree.dynamic_deps_preload(pkg, metadata)
+			else:
+				proc =  EbuildMetadataPhase(cpv=pkg.cpv,
+					ebuild_hash=ebuild_hash,
+					portdb=portdb, repo_path=repo_path,
+					settings=portdb.doebuild_settings)
+				proc.addExitListener(
+					self._dynamic_deps_proc_exit(pkg, fake_vartree))
+				yield proc
+
+	class _dynamic_deps_proc_exit(object):
+
+		__slots__ = ('_pkg', '_fake_vartree')
+
+		def __init__(self, pkg, fake_vartree):
+			self._pkg = pkg
+			self._fake_vartree = fake_vartree
+
+		def __call__(self, proc):
+			metadata = None
+			if proc.returncode == os.EX_OK:
+				metadata = proc.metadata
+			self._fake_vartree.dynamic_deps_preload(self._pkg, metadata)
+
 	def _spinner_update(self):
 		if self._frozen_config.spinner:
 			self._frozen_config.spinner.update()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-02  6:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-02  6:04 UTC (permalink / raw
  To: gentoo-commits

commit:     06ed67fa3b6d0cbf106639e2911dd01e626363f2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 06:03:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 06:03:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=06ed67fa

resume_depgraph: check for alternative installed

When pruning packages from the merge list, only prune them if the
relevant dependency is not satisfied by an alternative package which
is already installed. This should fix bug #448176, and now there's also
reasons logged for why a particular package is dropped.

---
 pym/_emerge/Scheduler.py |    9 ++++++---
 pym/_emerge/actions.py   |   10 ++++++++--
 pym/_emerge/depgraph.py  |   23 ++++++++++++++---------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6a49497..a7c303b 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1791,7 +1791,7 @@ class Scheduler(PollScheduler):
 			#              scope
 			e = exc
 			mydepgraph = e.depgraph
-			dropped_tasks = set()
+			dropped_tasks = {}
 
 		if e is not None:
 			def unsatisfied_resume_dep_msg():
@@ -1841,7 +1841,7 @@ class Scheduler(PollScheduler):
 		self._init_graph(mydepgraph.schedulerGraph())
 
 		msg_width = 75
-		for task in dropped_tasks:
+		for task, atom in dropped_tasks.items():
 			if not (isinstance(task, Package) and task.operation == "merge"):
 				continue
 			pkg = task
@@ -1849,7 +1849,10 @@ class Scheduler(PollScheduler):
 				" %s" % (pkg.cpv,)
 			if pkg.root_config.settings["ROOT"] != "/":
 				msg += " for %s" % (pkg.root,)
-			msg += " dropped due to unsatisfied dependency."
+			if atom is None:
+				msg += " dropped because it is masked or unavailable"
+			else:
+				msg += " dropped because it requires %s" % atom
 			for line in textwrap.wrap(msg, msg_width):
 				eerror(line, phase="other", key=pkg.cpv)
 			settings = self.pkgsettings[pkg.root]

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6a3815a..7473098 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -286,8 +286,14 @@ def action_build(settings, trees, mtimedb,
 					"dropped due to\n" + \
 					"!!! masking or unsatisfied dependencies:\n\n",
 					noiselevel=-1)
-				for task in dropped_tasks:
-					portage.writemsg("  " + str(task) + "\n", noiselevel=-1)
+				for task, atom in dropped_tasks.items():
+					if atom is None:
+						writemsg("  %s is masked or unavailable\n" %
+							(task,), noiselevel=-1)
+					else:
+						writemsg("  %s requires %s\n" % (task, atom),
+							noiselevel=-1)
+
 				portage.writemsg("\n", noiselevel=-1)
 			del dropped_tasks
 		else:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 47f1b60..1f577b9 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7477,7 +7477,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 	skip_masked = True
 	skip_unsatisfied = True
 	mergelist = mtimedb["resume"]["mergelist"]
-	dropped_tasks = set()
+	dropped_tasks = {}
 	frozen_config = _frozen_depgraph_config(settings, trees,
 		myopts, spinner)
 	while True:
@@ -7491,12 +7491,16 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				raise
 
 			graph = mydepgraph._dynamic_config.digraph
-			unsatisfied_parents = dict((dep.parent, dep.parent) \
+			unsatisfied_parents = dict((dep.parent, dep.atom) \
 				for dep in e.value)
 			traversed_nodes = set()
-			unsatisfied_stack = list(unsatisfied_parents)
+			unsatisfied_stack = list(unsatisfied_parents.items())
 			while unsatisfied_stack:
-				pkg = unsatisfied_stack.pop()
+				pkg, atom = unsatisfied_stack.pop()
+				if atom is not None and \
+					mydepgraph._select_pkg_from_installed(
+					pkg.root, atom) is not None:
+					continue
 				if pkg in traversed_nodes:
 					continue
 				traversed_nodes.add(pkg)
@@ -7505,7 +7509,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				# package scheduled for merge, removing this
 				# package may cause the the parent package's
 				# dependency to become unsatisfied.
-				for parent_node in graph.parent_nodes(pkg):
+				for parent_node, atom in \
+					mydepgraph._dynamic_config._parent_atoms.get(pkg, []):
 					if not isinstance(parent_node, Package) \
 						or parent_node.operation not in ("merge", "nomerge"):
 						continue
@@ -7513,8 +7518,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 					# ensure that a package with an unsatisfied depenedency
 					# won't get pulled in, even indirectly via a soft
 					# dependency.
-					unsatisfied_parents[parent_node] = parent_node
-					unsatisfied_stack.append(parent_node)
+					unsatisfied_parents[parent_node] = atom
+					unsatisfied_stack.append((parent_node, atom))
 
 			unsatisfied_tuples = frozenset(tuple(parent_node)
 				for parent_node in unsatisfied_parents
@@ -7535,8 +7540,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 			# Exclude installed packages that have been removed from the graph due
 			# to failure to build/install runtime dependencies after the dependent
 			# package has already been installed.
-			dropped_tasks.update(pkg for pkg in \
-				unsatisfied_parents if pkg.operation != "nomerge")
+			dropped_tasks.update((pkg, atom) for pkg, atom in \
+				unsatisfied_parents.items() if pkg.operation != "nomerge")
 
 			del e, graph, traversed_nodes, \
 				unsatisfied_parents, unsatisfied_stack


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-02  7:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-02  7:29 UTC (permalink / raw
  To: gentoo-commits

commit:     b732f13e7ef217d5f9bdbab9d5da0ad6b99da04e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 06:03:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 07:29:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b732f13e

resume_depgraph: check for alternative installed

When pruning packages from the merge list, only prune them if the
relevant dependency is not satisfied by an alternative package which
is already installed. This should fix bug #448176, and now there's also
reasons logged for why a particular package is dropped.

---
 pym/_emerge/Scheduler.py |    9 ++++++---
 pym/_emerge/actions.py   |   10 ++++++++--
 pym/_emerge/depgraph.py  |   23 ++++++++++++++---------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6a49497..a7c303b 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1791,7 +1791,7 @@ class Scheduler(PollScheduler):
 			#              scope
 			e = exc
 			mydepgraph = e.depgraph
-			dropped_tasks = set()
+			dropped_tasks = {}
 
 		if e is not None:
 			def unsatisfied_resume_dep_msg():
@@ -1841,7 +1841,7 @@ class Scheduler(PollScheduler):
 		self._init_graph(mydepgraph.schedulerGraph())
 
 		msg_width = 75
-		for task in dropped_tasks:
+		for task, atom in dropped_tasks.items():
 			if not (isinstance(task, Package) and task.operation == "merge"):
 				continue
 			pkg = task
@@ -1849,7 +1849,10 @@ class Scheduler(PollScheduler):
 				" %s" % (pkg.cpv,)
 			if pkg.root_config.settings["ROOT"] != "/":
 				msg += " for %s" % (pkg.root,)
-			msg += " dropped due to unsatisfied dependency."
+			if atom is None:
+				msg += " dropped because it is masked or unavailable"
+			else:
+				msg += " dropped because it requires %s" % atom
 			for line in textwrap.wrap(msg, msg_width):
 				eerror(line, phase="other", key=pkg.cpv)
 			settings = self.pkgsettings[pkg.root]

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6a3815a..7473098 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -286,8 +286,14 @@ def action_build(settings, trees, mtimedb,
 					"dropped due to\n" + \
 					"!!! masking or unsatisfied dependencies:\n\n",
 					noiselevel=-1)
-				for task in dropped_tasks:
-					portage.writemsg("  " + str(task) + "\n", noiselevel=-1)
+				for task, atom in dropped_tasks.items():
+					if atom is None:
+						writemsg("  %s is masked or unavailable\n" %
+							(task,), noiselevel=-1)
+					else:
+						writemsg("  %s requires %s\n" % (task, atom),
+							noiselevel=-1)
+
 				portage.writemsg("\n", noiselevel=-1)
 			del dropped_tasks
 		else:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 47f1b60..31cf77c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7477,7 +7477,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 	skip_masked = True
 	skip_unsatisfied = True
 	mergelist = mtimedb["resume"]["mergelist"]
-	dropped_tasks = set()
+	dropped_tasks = {}
 	frozen_config = _frozen_depgraph_config(settings, trees,
 		myopts, spinner)
 	while True:
@@ -7491,12 +7491,16 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				raise
 
 			graph = mydepgraph._dynamic_config.digraph
-			unsatisfied_parents = dict((dep.parent, dep.parent) \
+			unsatisfied_parents = dict((dep.parent, dep.atom) \
 				for dep in e.value)
 			traversed_nodes = set()
-			unsatisfied_stack = list(unsatisfied_parents)
+			unsatisfied_stack = list(unsatisfied_parents.items())
 			while unsatisfied_stack:
-				pkg = unsatisfied_stack.pop()
+				pkg, atom = unsatisfied_stack.pop()
+				if atom is not None and \
+					mydepgraph._select_pkg_from_installed(
+					pkg.root, atom) != (None, None):
+					continue
 				if pkg in traversed_nodes:
 					continue
 				traversed_nodes.add(pkg)
@@ -7505,7 +7509,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				# package scheduled for merge, removing this
 				# package may cause the the parent package's
 				# dependency to become unsatisfied.
-				for parent_node in graph.parent_nodes(pkg):
+				for parent_node, atom in \
+					mydepgraph._dynamic_config._parent_atoms.get(pkg, []):
 					if not isinstance(parent_node, Package) \
 						or parent_node.operation not in ("merge", "nomerge"):
 						continue
@@ -7513,8 +7518,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 					# ensure that a package with an unsatisfied depenedency
 					# won't get pulled in, even indirectly via a soft
 					# dependency.
-					unsatisfied_parents[parent_node] = parent_node
-					unsatisfied_stack.append(parent_node)
+					unsatisfied_parents[parent_node] = atom
+					unsatisfied_stack.append((parent_node, atom))
 
 			unsatisfied_tuples = frozenset(tuple(parent_node)
 				for parent_node in unsatisfied_parents
@@ -7535,8 +7540,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 			# Exclude installed packages that have been removed from the graph due
 			# to failure to build/install runtime dependencies after the dependent
 			# package has already been installed.
-			dropped_tasks.update(pkg for pkg in \
-				unsatisfied_parents if pkg.operation != "nomerge")
+			dropped_tasks.update((pkg, atom) for pkg, atom in \
+				unsatisfied_parents.items() if pkg.operation != "nomerge")
 
 			del e, graph, traversed_nodes, \
 				unsatisfied_parents, unsatisfied_stack


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-02  7:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-02  7:32 UTC (permalink / raw
  To: gentoo-commits

commit:     0b71fb2beedccfe7d2feeb1835b8e79eedc5ee7c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 06:03:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 07:32:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b71fb2b

resume_depgraph: check for alternative installed

When pruning packages from the merge list, only prune them if the
relevant dependency is not satisfied by an alternative package which
is already installed. This should fix bug #448176, and now there's also
reasons logged for why a particular package is dropped.

---
 pym/_emerge/Scheduler.py |    9 ++++++---
 pym/_emerge/actions.py   |   10 ++++++++--
 pym/_emerge/depgraph.py  |   23 ++++++++++++++---------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6a49497..a7c303b 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1791,7 +1791,7 @@ class Scheduler(PollScheduler):
 			#              scope
 			e = exc
 			mydepgraph = e.depgraph
-			dropped_tasks = set()
+			dropped_tasks = {}
 
 		if e is not None:
 			def unsatisfied_resume_dep_msg():
@@ -1841,7 +1841,7 @@ class Scheduler(PollScheduler):
 		self._init_graph(mydepgraph.schedulerGraph())
 
 		msg_width = 75
-		for task in dropped_tasks:
+		for task, atom in dropped_tasks.items():
 			if not (isinstance(task, Package) and task.operation == "merge"):
 				continue
 			pkg = task
@@ -1849,7 +1849,10 @@ class Scheduler(PollScheduler):
 				" %s" % (pkg.cpv,)
 			if pkg.root_config.settings["ROOT"] != "/":
 				msg += " for %s" % (pkg.root,)
-			msg += " dropped due to unsatisfied dependency."
+			if atom is None:
+				msg += " dropped because it is masked or unavailable"
+			else:
+				msg += " dropped because it requires %s" % atom
 			for line in textwrap.wrap(msg, msg_width):
 				eerror(line, phase="other", key=pkg.cpv)
 			settings = self.pkgsettings[pkg.root]

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6a3815a..7473098 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -286,8 +286,14 @@ def action_build(settings, trees, mtimedb,
 					"dropped due to\n" + \
 					"!!! masking or unsatisfied dependencies:\n\n",
 					noiselevel=-1)
-				for task in dropped_tasks:
-					portage.writemsg("  " + str(task) + "\n", noiselevel=-1)
+				for task, atom in dropped_tasks.items():
+					if atom is None:
+						writemsg("  %s is masked or unavailable\n" %
+							(task,), noiselevel=-1)
+					else:
+						writemsg("  %s requires %s\n" % (task, atom),
+							noiselevel=-1)
+
 				portage.writemsg("\n", noiselevel=-1)
 			del dropped_tasks
 		else:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 47f1b60..a2f43f2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7477,7 +7477,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 	skip_masked = True
 	skip_unsatisfied = True
 	mergelist = mtimedb["resume"]["mergelist"]
-	dropped_tasks = set()
+	dropped_tasks = {}
 	frozen_config = _frozen_depgraph_config(settings, trees,
 		myopts, spinner)
 	while True:
@@ -7491,12 +7491,16 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				raise
 
 			graph = mydepgraph._dynamic_config.digraph
-			unsatisfied_parents = dict((dep.parent, dep.parent) \
+			unsatisfied_parents = dict((dep.parent, dep.atom) \
 				for dep in e.value)
 			traversed_nodes = set()
-			unsatisfied_stack = list(unsatisfied_parents)
+			unsatisfied_stack = list(unsatisfied_parents.items())
 			while unsatisfied_stack:
-				pkg = unsatisfied_stack.pop()
+				pkg, atom = unsatisfied_stack.pop()
+				if atom is not None and \
+					mydepgraph._select_pkg_from_installed(
+					pkg.root, atom)[0] is not None:
+					continue
 				if pkg in traversed_nodes:
 					continue
 				traversed_nodes.add(pkg)
@@ -7505,7 +7509,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				# package scheduled for merge, removing this
 				# package may cause the the parent package's
 				# dependency to become unsatisfied.
-				for parent_node in graph.parent_nodes(pkg):
+				for parent_node, atom in \
+					mydepgraph._dynamic_config._parent_atoms.get(pkg, []):
 					if not isinstance(parent_node, Package) \
 						or parent_node.operation not in ("merge", "nomerge"):
 						continue
@@ -7513,8 +7518,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 					# ensure that a package with an unsatisfied depenedency
 					# won't get pulled in, even indirectly via a soft
 					# dependency.
-					unsatisfied_parents[parent_node] = parent_node
-					unsatisfied_stack.append(parent_node)
+					unsatisfied_parents[parent_node] = atom
+					unsatisfied_stack.append((parent_node, atom))
 
 			unsatisfied_tuples = frozenset(tuple(parent_node)
 				for parent_node in unsatisfied_parents
@@ -7535,8 +7540,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 			# Exclude installed packages that have been removed from the graph due
 			# to failure to build/install runtime dependencies after the dependent
 			# package has already been installed.
-			dropped_tasks.update(pkg for pkg in \
-				unsatisfied_parents if pkg.operation != "nomerge")
+			dropped_tasks.update((pkg, atom) for pkg, atom in \
+				unsatisfied_parents.items() if pkg.operation != "nomerge")
 
 			del e, graph, traversed_nodes, \
 				unsatisfied_parents, unsatisfied_stack


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-02 10:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-02 10:48 UTC (permalink / raw
  To: gentoo-commits

commit:     373ef95f11e805c52be79c7563a73cc65062b615
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  2 06:03:54 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  2 10:45:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=373ef95f

resume_depgraph: check for alternative installed

When pruning packages from the merge list, only prune them if the
relevant dependency is not satisfied by an alternative package which
is already installed. This should fix bug #448176, and now there's also
reasons logged for why a particular package is dropped.

---
 pym/_emerge/Scheduler.py |    9 ++++++---
 pym/_emerge/actions.py   |   10 ++++++++--
 pym/_emerge/depgraph.py  |   29 +++++++++++++++++++----------
 3 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6a49497..a423274 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1791,7 +1791,7 @@ class Scheduler(PollScheduler):
 			#              scope
 			e = exc
 			mydepgraph = e.depgraph
-			dropped_tasks = set()
+			dropped_tasks = {}
 
 		if e is not None:
 			def unsatisfied_resume_dep_msg():
@@ -1841,7 +1841,7 @@ class Scheduler(PollScheduler):
 		self._init_graph(mydepgraph.schedulerGraph())
 
 		msg_width = 75
-		for task in dropped_tasks:
+		for task, atoms in dropped_tasks.items():
 			if not (isinstance(task, Package) and task.operation == "merge"):
 				continue
 			pkg = task
@@ -1849,7 +1849,10 @@ class Scheduler(PollScheduler):
 				" %s" % (pkg.cpv,)
 			if pkg.root_config.settings["ROOT"] != "/":
 				msg += " for %s" % (pkg.root,)
-			msg += " dropped due to unsatisfied dependency."
+			if not atoms:
+				msg += " dropped because it is masked or unavailable"
+			else:
+				msg += " dropped because it requires %s" % ", ".join(atoms)
 			for line in textwrap.wrap(msg, msg_width):
 				eerror(line, phase="other", key=pkg.cpv)
 			settings = self.pkgsettings[pkg.root]

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 6a3815a..19265d0 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -286,8 +286,14 @@ def action_build(settings, trees, mtimedb,
 					"dropped due to\n" + \
 					"!!! masking or unsatisfied dependencies:\n\n",
 					noiselevel=-1)
-				for task in dropped_tasks:
-					portage.writemsg("  " + str(task) + "\n", noiselevel=-1)
+				for task, atoms in dropped_tasks.items():
+					if not atoms:
+						writemsg("  %s is masked or unavailable\n" %
+							(task,), noiselevel=-1)
+					else:
+						writemsg("  %s requires %s\n" %
+							(task, ", ".join(atoms)), noiselevel=-1)
+
 				portage.writemsg("\n", noiselevel=-1)
 			del dropped_tasks
 		else:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 47f1b60..f02ccb6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7477,7 +7477,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 	skip_masked = True
 	skip_unsatisfied = True
 	mergelist = mtimedb["resume"]["mergelist"]
-	dropped_tasks = set()
+	dropped_tasks = {}
 	frozen_config = _frozen_depgraph_config(settings, trees,
 		myopts, spinner)
 	while True:
@@ -7491,12 +7491,21 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				raise
 
 			graph = mydepgraph._dynamic_config.digraph
-			unsatisfied_parents = dict((dep.parent, dep.parent) \
-				for dep in e.value)
+			unsatisfied_parents = {}
 			traversed_nodes = set()
-			unsatisfied_stack = list(unsatisfied_parents)
+			unsatisfied_stack = [(dep.parent, dep.atom) for dep in e.value]
 			while unsatisfied_stack:
-				pkg = unsatisfied_stack.pop()
+				pkg, atom = unsatisfied_stack.pop()
+				if atom is not None and \
+					mydepgraph._select_pkg_from_installed(
+					pkg.root, atom)[0] is not None:
+					continue
+				atoms = unsatisfied_parents.get(pkg)
+				if atoms is None:
+					atoms = []
+					unsatisfied_parents[pkg] = atoms
+				if atom is not None:
+					atoms.append(atom)
 				if pkg in traversed_nodes:
 					continue
 				traversed_nodes.add(pkg)
@@ -7505,7 +7514,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 				# package scheduled for merge, removing this
 				# package may cause the the parent package's
 				# dependency to become unsatisfied.
-				for parent_node in graph.parent_nodes(pkg):
+				for parent_node, atom in \
+					mydepgraph._dynamic_config._parent_atoms.get(pkg, []):
 					if not isinstance(parent_node, Package) \
 						or parent_node.operation not in ("merge", "nomerge"):
 						continue
@@ -7513,8 +7523,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 					# ensure that a package with an unsatisfied depenedency
 					# won't get pulled in, even indirectly via a soft
 					# dependency.
-					unsatisfied_parents[parent_node] = parent_node
-					unsatisfied_stack.append(parent_node)
+					unsatisfied_stack.append((parent_node, atom))
 
 			unsatisfied_tuples = frozenset(tuple(parent_node)
 				for parent_node in unsatisfied_parents
@@ -7535,8 +7544,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
 			# Exclude installed packages that have been removed from the graph due
 			# to failure to build/install runtime dependencies after the dependent
 			# package has already been installed.
-			dropped_tasks.update(pkg for pkg in \
-				unsatisfied_parents if pkg.operation != "nomerge")
+			dropped_tasks.update((pkg, atoms) for pkg, atoms in \
+				unsatisfied_parents.items() if pkg.operation != "nomerge")
 
 			del e, graph, traversed_nodes, \
 				unsatisfied_parents, unsatisfied_stack


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-03  2:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-03  2:54 UTC (permalink / raw
  To: gentoo-commits

commit:     819c830ed7bf301e3fdf972c0a5519eb6c2a9ee6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  3 02:51:47 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan  3 02:52:29 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=819c830e

emerge --depclean: show atoms in verbose output

---
 pym/_emerge/actions.py |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 19265d0..ac9a60f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -883,15 +883,27 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 			required_pkgs_total += 1
 
 	def show_parents(child_node):
-		parent_nodes = graph.parent_nodes(child_node)
-		if not parent_nodes:
+		parent_atoms = \
+			resolver._dynamic_config._parent_atoms.get(child_node, [])
+
+		# Never display the special internal protected_set.
+		parent_atoms = [parent_atom for parent_atom in parent_atoms
+			if not (isinstance(parent_atom[0], SetArg) and
+			parent_atom[0].name == protected_set_name)]
+
+		if not parent_atoms:
 			# With --prune, the highest version can be pulled in without any
 			# real parent since all installed packages are pulled in.  In that
 			# case there's nothing to show here.
 			return
+		parent_atom_dict = {}
+		for parent, atom in parent_atoms:
+			parent_atom_dict.setdefault(parent, []).append(atom)
+
 		parent_strs = []
-		for node in parent_nodes:
-			parent_strs.append(str(getattr(node, "cpv", node)))
+		for parent, atoms in parent_atom_dict.items():
+			parent_strs.append("%s requires %s" %
+				(getattr(parent, "cpv", parent), ", ".join(atoms)))
 		parent_strs.sort()
 		msg = []
 		msg.append("  %s pulled in by:\n" % (child_node.cpv,))
@@ -916,12 +928,6 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 			graph.debug_print()
 			writemsg("\n", noiselevel=-1)
 
-		# Never display the special internal protected_set.
-		for node in graph:
-			if isinstance(node, SetArg) and node.name == protected_set_name:
-				graph.remove(node)
-				break
-
 		pkgs_to_remove = []
 
 		if action == "depclean":


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-04  0:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-04  0:02 UTC (permalink / raw
  To: gentoo-commits

commit:     0fe235cfd0200644c205a7b4aabb1330e7f04402
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 00:02:28 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 00:02:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0fe235cf

SpawnProcess: support close_fds

---
 pym/_emerge/SpawnProcess.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 2045b2e..293e5be 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -1,4 +1,4 @@
-# Copyright 2008-2012 Gentoo Foundation
+# Copyright 2008-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.SubProcess import SubProcess
@@ -18,7 +18,7 @@ class SpawnProcess(SubProcess):
 
 	_spawn_kwarg_names = ("env", "opt_name", "fd_pipes",
 		"uid", "gid", "groups", "umask", "logfile",
-		"path_lookup", "pre_exec")
+		"path_lookup", "pre_exec", "close_fds")
 
 	__slots__ = ("args",) + \
 		_spawn_kwarg_names + ("_pipe_logger", "_selinux_type",)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-04  6:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-04  6:30 UTC (permalink / raw
  To: gentoo-commits

commit:     9d4fdf7ec5ccd4b78cbce2d7209ce91286fbbf26
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 06:08:56 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 06:08:56 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9d4fdf7e

PipeReader: support plain fd without file obj

---
 pym/_emerge/PipeReader.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index bb4e0dc..be93be3 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -35,9 +35,10 @@ class PipeReader(AbstractPollTask):
 			fcntl_flags |= fcntl.FD_CLOEXEC
 
 		for f in self.input_files.values():
-			fcntl.fcntl(f.fileno(), fcntl.F_SETFL,
-				fcntl.fcntl(f.fileno(), fcntl.F_GETFL) | fcntl_flags)
-			self._reg_ids.add(self.scheduler.io_add_watch(f.fileno(),
+			fd = isinstance(f, int) and f or f.fileno()
+			fcntl.fcntl(fd, fcntl.F_SETFL,
+				fcntl.fcntl(fd, fcntl.F_GETFL) | fcntl_flags)
+			self._reg_ids.add(self.scheduler.io_add_watch(fd,
 				self._registered_events, output_handler))
 		self._registered = True
 
@@ -113,6 +114,9 @@ class PipeReader(AbstractPollTask):
 
 		if self.input_files is not None:
 			for f in self.input_files.values():
-				f.close()
+				if isinstance(f, int):
+					os.close(f)
+				else:
+					f.close()
 			self.input_files = None
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-06  8:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-06  8:44 UTC (permalink / raw
  To: gentoo-commits

commit:     8b573eaae39ca805d29d527bbea96e97060d204a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  6 08:44:12 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan  6 08:44:12 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8b573eaa

MetadataRegen: fix signal interrupt handling

We have to force it out of the scheduling loop before
_termination_check can have an effect.

---
 pym/_emerge/MetadataRegen.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 80dbb5a..6203c78 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import portage
@@ -50,7 +50,7 @@ class MetadataRegen(AsyncScheduler):
 		consumer = self._consumer
 
 		for cp in self._cp_iter:
-			if self._terminated_tasks:
+			if self._terminated.is_set():
 				break
 			cp_set.add(cp)
 			portage.writemsg_stdout("Processing %s\n" % cp)
@@ -60,7 +60,7 @@ class MetadataRegen(AsyncScheduler):
 				repo = portdb.repositories.get_repo_for_location(mytree)
 				cpv_list = portdb.cp_list(cp, mytree=[repo.location])
 				for cpv in cpv_list:
-					if self._terminated_tasks:
+					if self._terminated.is_set():
 						break
 					valid_pkgs.add(cpv)
 					ebuild_path, repo_path = portdb.findname2(cpv, myrepo=repo.name)
@@ -86,6 +86,7 @@ class MetadataRegen(AsyncScheduler):
 		portdb = self._portdb
 		dead_nodes = {}
 
+		self._termination_check()
 		if self._terminated_tasks:
 			self.returncode = self._cancelled_returncode
 			return self.returncode


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-06  9:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-06  9:14 UTC (permalink / raw
  To: gentoo-commits

commit:     15d4ef127ea20c41f41434e7f99bbfbf9961e4f8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  6 09:14:18 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan  6 09:14:18 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=15d4ef12

MetadataRegen: portdbapi.cp_all() already sorted

---
 pym/_emerge/MetadataRegen.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 6203c78..8dc7ebe 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -36,7 +36,7 @@ class MetadataRegen(AsyncScheduler):
 		portage.writemsg_stdout("Listing available packages...\n")
 		every_cp = self._portdb.cp_all()
 		portage.writemsg_stdout("Regenerating cache entries...\n")
-		every_cp.sort(reverse=True)
+		every_cp.reverse()
 		try:
 			while not self._terminated_tasks:
 				yield every_cp.pop()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-08  2:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-08  2:10 UTC (permalink / raw
  To: gentoo-commits

commit:     2a05612d23561d4606e93e73a8e021dc91291ff6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  8 02:08:40 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan  8 02:09:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a05612d

SpawnProcess: stdout_fd FD_CLOEXEC

---
 pym/_emerge/SpawnProcess.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 293e5be..f226dcb 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -1,6 +1,12 @@
 # Copyright 2008-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+try:
+	import fcntl
+except ImportError:
+	# http://bugs.jython.org/issue1074
+	fcntl = None
+
 from _emerge.SubProcess import SubProcess
 import sys
 import portage
@@ -105,6 +111,15 @@ class SpawnProcess(SubProcess):
 		stdout_fd = None
 		if can_log and not self.background:
 			stdout_fd = os.dup(fd_pipes_orig[1])
+			if fcntl is not None:
+				try:
+					fcntl.FD_CLOEXEC
+				except AttributeError:
+					pass
+				else:
+					fcntl.fcntl(stdout_fd, fcntl.F_SETFL,
+						fcntl.fcntl(stdout_fd,
+						fcntl.F_GETFL) | fcntl.FD_CLOEXEC)
 
 		self._pipe_logger = PipeLogger(background=self.background,
 			scheduler=self.scheduler, input_fd=master_fd,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-09  1:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-09  1:06 UTC (permalink / raw
  To: gentoo-commits

commit:     8f63eff2c75f8c64fa7ea56425a557d869a64f2f
Author:     Ben Kohler <bkohler <AT> gmail <DOT> com>
AuthorDate: Wed Jan  9 01:06:01 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  9 01:06:01 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8f63eff2

autounmask: show file names for suggested changes

Also, advise the user to examine the proposed config changes carefully.

X-Gentoo-Bug: 450960
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=450960

---
 pym/_emerge/depgraph.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f02ccb6..428d414 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6578,22 +6578,22 @@ class depgraph(object):
 
 			if root in unstable_keyword_msg:
 				writemsg("\nThe following " + colorize("BAD", "keyword changes") + \
-					" are necessary to proceed:\n", noiselevel=-1)
+					" (package.accept_keywords) are necessary to proceed:\n", noiselevel=-1)
 				writemsg(format_msg(unstable_keyword_msg[root]), noiselevel=-1)
 
 			if root in p_mask_change_msg:
 				writemsg("\nThe following " + colorize("BAD", "mask changes") + \
-					" are necessary to proceed:\n", noiselevel=-1)
+					" (package.unmask) are necessary to proceed:\n", noiselevel=-1)
 				writemsg(format_msg(p_mask_change_msg[root]), noiselevel=-1)
 
 			if root in use_changes_msg:
 				writemsg("\nThe following " + colorize("BAD", "USE changes") + \
-					" are necessary to proceed:\n", noiselevel=-1)
+					" (package.use) are necessary to proceed:\n", noiselevel=-1)
 				writemsg(format_msg(use_changes_msg[root]), noiselevel=-1)
 
 			if root in license_msg:
 				writemsg("\nThe following " + colorize("BAD", "license changes") + \
-					" are necessary to proceed:\n", noiselevel=-1)
+					" (package.license) are necessary to proceed:\n", noiselevel=-1)
 				writemsg(format_msg(license_msg[root]), noiselevel=-1)
 
 		protect_obj = {}
@@ -6680,7 +6680,9 @@ class depgraph(object):
 			writemsg("\nAutounmask changes successfully written. Remember to run dispatch-conf.\n", \
 				noiselevel=-1)
 		elif not pretend and not autounmask_write and roots:
-			writemsg("\nUse --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).\n", \
+			writemsg("\nUse --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).  " + \
+				"Always examine the list of proposed changes before continuing with --autounmask-write, " + \
+				"as these changes may not be safe. \n", \
 				noiselevel=-1)
 
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-09  1:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-09  1:29 UTC (permalink / raw
  To: gentoo-commits

commit:     42e53d601895515cb51fd7189b95d54154de877e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  9 01:28:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan  9 01:28:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=42e53d60

autounmask: tweak --autounmask-write suggestion

---
 pym/_emerge/depgraph.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 428d414..96ba871 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6680,9 +6680,10 @@ class depgraph(object):
 			writemsg("\nAutounmask changes successfully written. Remember to run dispatch-conf.\n", \
 				noiselevel=-1)
 		elif not pretend and not autounmask_write and roots:
-			writemsg("\nUse --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).  " + \
-				"Always examine the list of proposed changes before continuing with --autounmask-write, " + \
-				"as these changes may not be safe. \n", \
+			writemsg("\nUse --autounmask-write to write changes to config files (honoring\n"
+				"CONFIG_PROTECT). Carefully examine the list of proposed changes,\n"
+				"paying special attention to mask or keyword changes that may expose\n"
+				"experimental or unstable packages.\n",
 				noiselevel=-1)
 
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-10 11:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-10 11:11 UTC (permalink / raw
  To: gentoo-commits

commit:     2642def0f2deb121a41ae9e20de38a67cfc0af16
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 10 11:11:35 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 10 11:11:35 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2642def0

SpawnProcess: handle fcntl ENOTTY for FreeBSD

---
 pym/_emerge/SpawnProcess.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index f226dcb..5d0fcf6 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -117,9 +117,14 @@ class SpawnProcess(SubProcess):
 				except AttributeError:
 					pass
 				else:
-					fcntl.fcntl(stdout_fd, fcntl.F_SETFL,
-						fcntl.fcntl(stdout_fd,
-						fcntl.F_GETFL) | fcntl.FD_CLOEXEC)
+					try:
+						fcntl.fcntl(stdout_fd, fcntl.F_SETFL,
+							fcntl.fcntl(stdout_fd,
+							fcntl.F_GETFL) | fcntl.FD_CLOEXEC)
+					except IOError:
+						# FreeBSD may return "Inappropriate ioctl for device"
+						# error here (ENOTTY).
+						pass
 
 		self._pipe_logger = PipeLogger(background=self.background,
 			scheduler=self.scheduler, input_fd=master_fd,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-15 14:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-15 14:25 UTC (permalink / raw
  To: gentoo-commits

commit:     04f8dfb158bcadc1017a64e9fad5e744d4f91f9c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 15 14:12:27 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 15 14:12:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04f8dfb1

SpawnProcess: avoid fd_pipes interference

This fixes a random collision that can occur with FileDigester,
triggering malfunction and a KeyError.

---
 pym/_emerge/SpawnProcess.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 5d0fcf6..9c754ad 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -76,8 +76,14 @@ class SpawnProcess(SubProcess):
 
 		else:
 			# Create a dummy pipe so the scheduler can monitor
-			# the process from inside a poll() loop.
-			fd_pipes[self._dummy_pipe_fd] = slave_fd
+			# the process from inside a poll() loop. Ensure that
+			# it doesn't interfere with a random fd that's already
+			# in fd_pipes though (as least FileDigester can pass
+			# in a random fd returned from os.pipe()).
+			unique_dummy_fd = self._dummy_pipe_fd
+			while unique_dummy_fd in fd_pipes:
+				unique_dummy_fd += 1
+			fd_pipes[unique_dummy_fd] = slave_fd
 			if self.background:
 				fd_pipes[1] = slave_fd
 				fd_pipes[2] = slave_fd


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-15 14:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-15 14:46 UTC (permalink / raw
  To: gentoo-commits

commit:     70bfb6b8ebdb74fe5fbe244532e35f86cab9742e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 15 14:45:46 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 15 14:45:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=70bfb6b8

test-fail-continue: mark complete, bug #452030

---
 pym/_emerge/EbuildPhase.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 61e9a6f..4931349 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -190,7 +190,14 @@ class EbuildPhase(CompositeTask):
 		if self._default_exit(ebuild_process) != os.EX_OK:
 			if self.phase == "test" and \
 				"test-fail-continue" in self.settings.features:
-				pass
+				# mark test phase as complete (bug #452030)
+				try:
+					open(_unicode_encode(os.path.join(
+						self.settings["PORTAGE_BUILDDIR"], ".tested"),
+						encoding=_encodings['fs'], errors='strict'),
+						'wb').close()
+				except OSError:
+					pass
 			else:
 				fail = True
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-15 22:42 Mike Frysinger
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Frysinger @ 2013-01-15 22:42 UTC (permalink / raw
  To: gentoo-commits

commit:     f906f1973a77e3e1bdb10de277c5404fda1d52e8
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 15 20:31:29 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Jan 15 20:31:29 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f906f197

emerge: add reference to the portage(5) man page when failing

For example, the current licensing error message looks like:

 The following license changes (package.license) are necessary to proceed:
 #required by quake3-bin (argument)
 >=games-fps/quake3-bin-1.32c-r1 GPL-2 Q3AEULA

If you don't know much about licensing issues, this error message
doesn't help.  Instead, give references to the man page so people
can easily delve further.  Now it looks like:

 The following license changes are necessary to proceed:
  (see package.license in the portage(5) man page for more details)
 #required by quake3-bin (argument)
 >=games-fps/quake3-bin-1.32c-r1 GPL-2 Q3AEULA

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 pym/_emerge/depgraph.py |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 96ba871..92e3b1c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6576,24 +6576,25 @@ class depgraph(object):
 			if len(roots) > 1:
 				writemsg("\nFor %s:\n" % abs_user_config, noiselevel=-1)
 
+			def _writemsg(reason, file):
+				writemsg(('\nThe following %s are necessary to proceed:\n'
+				          ' (see "%s" in the portage(5) man page for more details)\n')
+				         % (colorize('BAD', reason), file), noiselevel=-1)
+
 			if root in unstable_keyword_msg:
-				writemsg("\nThe following " + colorize("BAD", "keyword changes") + \
-					" (package.accept_keywords) are necessary to proceed:\n", noiselevel=-1)
+				_writemsg('keyword changes', 'package.accept_keywords')
 				writemsg(format_msg(unstable_keyword_msg[root]), noiselevel=-1)
 
 			if root in p_mask_change_msg:
-				writemsg("\nThe following " + colorize("BAD", "mask changes") + \
-					" (package.unmask) are necessary to proceed:\n", noiselevel=-1)
+				_writemsg('mask changes', 'package.unmask')
 				writemsg(format_msg(p_mask_change_msg[root]), noiselevel=-1)
 
 			if root in use_changes_msg:
-				writemsg("\nThe following " + colorize("BAD", "USE changes") + \
-					" (package.use) are necessary to proceed:\n", noiselevel=-1)
+				_writemsg('USE changes', 'package.use')
 				writemsg(format_msg(use_changes_msg[root]), noiselevel=-1)
 
 			if root in license_msg:
-				writemsg("\nThe following " + colorize("BAD", "license changes") + \
-					" (package.license) are necessary to proceed:\n", noiselevel=-1)
+				_writemsg('license changes', 'package.license')
 				writemsg(format_msg(license_msg[root]), noiselevel=-1)
 
 		protect_obj = {}


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-24  0:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-24  0:44 UTC (permalink / raw
  To: gentoo-commits

commit:     7b51d8519556124f3fcd99195741ef437d02f432
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 24 00:42:27 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 24 00:42:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7b51d851

Package: avoid redundant splitting of USE

---
 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 eee41eb..19b7c4c 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -489,13 +489,12 @@ class Package(Task):
 		# Share identical frozenset instances when available.
 		_frozensets = {}
 
-		def __init__(self, pkg, use_str):
+		def __init__(self, pkg, enabled_flags):
 			self._pkg = pkg
 			self._expand = None
 			self._expand_hidden = None
 			self._force = None
 			self._mask = None
-			enabled_flags = use_str.split()
 			if eapi_has_use_aliases(pkg.eapi):
 				for enabled_flag in enabled_flags:
 					enabled_flags.extend(pkg.iuse.alias_mapping.get(enabled_flag, []))
@@ -583,7 +582,7 @@ class Package(Task):
 			enabled_flags = [x for x in use_str.split() if is_valid_flag(x)]
 			use_str = " ".join(enabled_flags)
 			self._use = self._use_class(
-				self, use_str)
+				self, enabled_flags)
 		else:
 			try:
 				use_str = _PackageMetadataWrapperBase.__getitem__(
@@ -597,7 +596,7 @@ class Package(Task):
 			_PackageMetadataWrapperBase.__setitem__(
 				self._metadata, 'USE', use_str)
 			self._use = self._use_class(
-				self, use_str)
+				self, use_str.split())
 			# Initialize these now, since USE access has just triggered
 			# setcpv, and we want to cache the result of the force/mask
 			# calculations that were done.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-01-24  1:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-01-24  1:32 UTC (permalink / raw
  To: gentoo-commits

commit:     dfcc6b4ca03ba2105e88b88764bbde724b3bae09
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 24 01:32:01 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 24 01:32:01 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dfcc6b4c

Package._init_use: always sync _metadata

---
 pym/_emerge/Package.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 19b7c4c..ae03576 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -593,8 +593,6 @@ class Package(Task):
 			if not use_str:
 				use_str = self._get_pkgsettings()["PORTAGE_USE"]
 				calculated_use = True
-			_PackageMetadataWrapperBase.__setitem__(
-				self._metadata, 'USE', use_str)
 			self._use = self._use_class(
 				self, use_str.split())
 			# Initialize these now, since USE access has just triggered
@@ -603,6 +601,9 @@ class Package(Task):
 			if calculated_use:
 				self._use._init_force_mask()
 
+		_PackageMetadataWrapperBase.__setitem__(
+			self._metadata, 'USE', use_str)
+
 		return use_str
 
 	class _iuse(object):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-08 16:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-08 16:29 UTC (permalink / raw
  To: gentoo-commits

commit:     87d1b397eb61b51c657806a29a09828b6ad55137
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  8 16:29:05 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb  8 16:29:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87d1b397

Tweak "add to world" prompt, bug #455946.

---
 pym/_emerge/actions.py  |   57 ++++++++++++++++++++++++++--------------------
 pym/_emerge/depgraph.py |   33 +++++++++++++++++++-------
 2 files changed, 56 insertions(+), 34 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a95d7a1..0776f7b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -325,6 +325,7 @@ def action_build(settings, trees, mtimedb,
 			mydepgraph.display_problems()
 			return 1
 
+	mergecount = None
 	if "--pretend" not in myopts and \
 		("--ask" in myopts or "--tree" in myopts or \
 		"--verbose" in myopts) and \
@@ -356,6 +357,7 @@ def action_build(settings, trees, mtimedb,
 				if isinstance(x, Package) and x.operation == "merge":
 					mergecount += 1
 
+			prompt = None
 			if mergecount==0:
 				sets = trees[settings['EROOT']]['root_config'].sets
 				world_candidates = None
@@ -368,12 +370,11 @@ def action_build(settings, trees, mtimedb,
 					world_candidates = [x for x in favorites \
 						if not (x.startswith(SETPREFIX) and \
 						not sets[x[1:]].world_candidate)]
+
 				if "selective" in myparams and \
 					not oneshot and world_candidates:
-					print()
-					for x in world_candidates:
-						print(" %s %s" % (good("*"), x))
-					prompt="Would you like to add these packages to your world favorites?"
+					# Prompt later, inside saveNomergeFavorites.
+					prompt = None
 				elif settings["AUTOCLEAN"] and "yes"==settings["AUTOCLEAN"]:
 					prompt="Nothing to merge; would you like to auto-clean packages?"
 				else:
@@ -386,13 +387,15 @@ def action_build(settings, trees, mtimedb,
 			else:
 				prompt="Would you like to merge these packages?"
 		print()
-		if "--ask" in myopts and userquery(prompt, enter_invalid) == "No":
+		if prompt is not None and "--ask" in myopts and \
+			userquery(prompt, enter_invalid) == "No":
 			print()
 			print("Quitting.")
 			print()
 			return 128 + signal.SIGINT
 		# Don't ask again (e.g. when auto-cleaning packages after merge)
-		myopts.pop("--ask", None)
+		if mergecount != 0:
+			myopts.pop("--ask", None)
 
 	if ("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts):
 		if ("--resume" in myopts):
@@ -462,25 +465,29 @@ def action_build(settings, trees, mtimedb,
 
 			mydepgraph.saveNomergeFavorites()
 
-		mergetask = Scheduler(settings, trees, mtimedb, myopts,
-			spinner, favorites=favorites,
-			graph_config=mydepgraph.schedulerGraph())
-
-		del mydepgraph
-		clear_caches(trees)
-
-		retval = mergetask.merge()
-
-		if retval == os.EX_OK and not (buildpkgonly or fetchonly or pretend):
-			if "yes" == settings.get("AUTOCLEAN"):
-				portage.writemsg_stdout(">>> Auto-cleaning packages...\n")
-				unmerge(trees[settings['EROOT']]['root_config'],
-					myopts, "clean", [],
-					ldpath_mtimes, autoclean=1)
-			else:
-				portage.writemsg_stdout(colorize("WARN", "WARNING:")
-					+ " AUTOCLEAN is disabled.  This can cause serious"
-					+ " problems due to overlapping packages.\n")
+		if mergecount == 0:
+			retval = os.EX_OK
+		else:
+			mergetask = Scheduler(settings, trees, mtimedb, myopts,
+				spinner, favorites=favorites,
+				graph_config=mydepgraph.schedulerGraph())
+
+			del mydepgraph
+			clear_caches(trees)
+
+			retval = mergetask.merge()
+
+			if retval == os.EX_OK and \
+				not (buildpkgonly or fetchonly or pretend):
+				if "yes" == settings.get("AUTOCLEAN"):
+					portage.writemsg_stdout(">>> Auto-cleaning packages...\n")
+					unmerge(trees[settings['EROOT']]['root_config'],
+						myopts, "clean", [],
+						ldpath_mtimes, autoclean=1)
+				else:
+					portage.writemsg_stdout(colorize("WARN", "WARNING:")
+						+ " AUTOCLEAN is disabled.  This can cause serious"
+						+ " problems due to overlapping packages.\n")
 
 		return retval
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 73ee3e9..3f24267 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6879,16 +6879,31 @@ class depgraph(object):
 			all_added.append(SETPREFIX + k)
 		all_added.extend(added_favorites)
 		all_added.sort()
-		for a in all_added:
-			if a.startswith(SETPREFIX):
-				filename = "world_sets"
-			else:
-				filename = "world"
-			writemsg_stdout(
-				">>> Recording %s in \"%s\" favorites file...\n" %
-				(colorize("INFORM", _unicode(a)), filename), noiselevel=-1)
 		if all_added:
-			world_set.update(all_added)
+			skip = False
+			if "--ask" in self._frozen_config.myopts:
+				writemsg_stdout("\n", noiselevel=-1)
+				for a in all_added:
+					writemsg_stdout(" %s %s\n" % (colorize("GOOD", "*"), a),
+						noiselevel=-1)
+				writemsg_stdout("\n", noiselevel=-1)
+				prompt = "Would you like to add these packages to your world " \
+					"favorites?"
+				enter_invalid = '--ask-enter-invalid' in \
+					self._frozen_config.myopts
+				if userquery(prompt, enter_invalid) == "No":
+					skip = True
+
+			if not skip:
+				for a in all_added:
+					if a.startswith(SETPREFIX):
+						filename = "world_sets"
+					else:
+						filename = "world"
+					writemsg_stdout(
+						">>> Recording %s in \"%s\" favorites file...\n" %
+						(colorize("INFORM", _unicode(a)), filename), noiselevel=-1)
+				world_set.update(all_added)
 
 		if world_locked:
 			world_set.unlock()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-09 18:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-09 18:00 UTC (permalink / raw
  To: gentoo-commits

commit:     02d4bc55e96e01f4e7c5aeea3e52cdd28d69c120
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  9 17:58:59 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb  9 17:58:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=02d4bc55

emerge --sync: python 2.6.4 compat, bug #456236

Avoid "TypeError: keywords must be strings" issue triggered
by unicode_literals: http://bugs.python.org/issue4978

Also see commit e9a04922c144b267534e3335d2ff3d7bb8994b80.

---
 pym/_emerge/actions.py |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 0776f7b..b8cb2cd 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2109,7 +2109,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 		emergelog(xterm_titles, msg )
 		writemsg_level(msg + "\n")
 		exitcode = portage.process.spawn_bash("cd %s ; git pull" % \
-			(portage._shell_quote(myportdir),), **spawn_kwargs)
+			(portage._shell_quote(myportdir),),
+			**portage._native_kwargs(spawn_kwargs))
 		if exitcode != os.EX_OK:
 			msg = "!!! git pull error in %s." % myportdir
 			emergelog(xterm_titles, msg)
@@ -2398,7 +2399,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 								rsync_initial_timeout)
 
 						mypids.extend(portage.process.spawn(
-							mycommand, returnpid=True, **spawn_kwargs))
+							mycommand, returnpid=True,
+							**portage._native_kwargs(spawn_kwargs)))
 						exitcode = os.waitpid(mypids[0], 0)[1]
 						if usersync_uid is not None:
 							portage.util.apply_permissions(tmpservertimestampfile,
@@ -2464,7 +2466,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 				elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
 					# actual sync
 					mycommand = rsynccommand + [dosyncuri+"/", myportdir]
-					exitcode = portage.process.spawn(mycommand, **spawn_kwargs)
+					exitcode = portage.process.spawn(mycommand,
+						**portage._native_kwargs(spawn_kwargs))
 					if exitcode in [0,1,3,4,11,14,20,21]:
 						break
 			elif exitcode in [1,3,4,11,14,20,21]:
@@ -2542,7 +2545,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 			if portage.process.spawn_bash(
 					"cd %s; exec cvs -z0 -d %s co -P gentoo-x86" % \
 					(portage._shell_quote(cvsdir), portage._shell_quote(cvsroot)),
-					**spawn_kwargs) != os.EX_OK:
+					**portage._native_kwargs(spawn_kwargs)) != os.EX_OK:
 				print("!!! cvs checkout error; exiting.")
 				sys.exit(1)
 			os.rename(os.path.join(cvsdir, "gentoo-x86"), myportdir)
@@ -2551,7 +2554,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
 			print(">>> Starting cvs update with "+syncuri+"...")
 			retval = portage.process.spawn_bash(
 				"cd %s; exec cvs -z0 -q update -dP" % \
-				(portage._shell_quote(myportdir),), **spawn_kwargs)
+				(portage._shell_quote(myportdir),),
+				**portage._native_kwargs(spawn_kwargs))
 			if retval != os.EX_OK:
 				writemsg_level("!!! cvs update error; exiting.\n",
 					noiselevel=-1, level=logging.ERROR)
@@ -3133,7 +3137,7 @@ def load_emerge_config(trees=None):
 		v = os.environ.get(envvar, None)
 		if v and v.strip():
 			kwargs[k] = v
-	trees = portage.create_trees(trees=trees, **kwargs)
+	trees = portage.create_trees(trees=trees, **portage._native_kwargs(kwargs))
 
 	for root_trees in trees.values():
 		settings = root_trees["vartree"].settings


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-11  2:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-11  2:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e64dd7eb67c3a2fc7aa6c6e42d6df156d1553c8f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 11 02:24:51 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 11 02:24:51 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e64dd7eb

_slot_change_probe: handle masks

---
 pym/_emerge/depgraph.py |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 34a4604..c356010 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1045,15 +1045,27 @@ class depgraph(object):
 			return None
 
 		root_config = self._frozen_config.roots[dep.root]
+		matches = []
 		try:
-			unbuilt_child  = self._pkg(dep.child.cpv, "ebuild",
-				root_config, myrepo=dep.child.repo)
+			matches.append(self._pkg(dep.child.cpv, "ebuild",
+				root_config, myrepo=dep.child.repo))
 		except PackageNotFound:
-			for unbuilt_child in self._iter_match_pkgs(root_config,
-				"ebuild", Atom("=%s" % (dep.child.cpv,))):
-				break
-			else:
-				return None
+			pass
+
+		for unbuilt_child in chain(matches,
+			self._iter_match_pkgs(root_config, "ebuild",
+			Atom("=%s" % (dep.child.cpv,)))):
+			if unbuilt_child in self._dynamic_config._runtime_pkg_mask:
+				continue
+			if self._frozen_config.excluded_pkgs.findAtomForPackage(
+				unbuilt_child,
+				modified_use=self._pkg_use_enabled(unbuilt_child)):
+				continue
+			if not self._pkg_visibility_check(unbuilt_child):
+				continue
+			break
+		else:
+			return None
 
 		if unbuilt_child.slot == dep.child.slot and \
 			unbuilt_child.sub_slot == dep.child.sub_slot:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-11 23:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-11 23:57 UTC (permalink / raw
  To: gentoo-commits

commit:     0240b8b754ab5f642c50c863d4bec1dc3636ba29
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 11 23:43:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 11 23:56:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0240b8b7

_slot_operator_update_probe: detect insignificant

This avoids rebuilding of two packages due to a sub-slot change in the
child package without revision bump. The sub-slot change is considered
insignificant until one of its parent packages needs to be rebuilt.

---
 pym/_emerge/depgraph.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7423ae0..085ac9b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1176,6 +1176,7 @@ class depgraph(object):
 			return None
 
 		debug = "--debug" in self._frozen_config.myopts
+		selective = "selective" in self._dynamic_config.myparams
 		want_downgrade = None
 
 		for replacement_parent in self._iter_similar_available(dep.parent,
@@ -1225,6 +1226,18 @@ class depgraph(object):
 							if not want_downgrade:
 								continue
 
+					insignificant = False
+					if selective and \
+						dep.parent.installed and \
+						dep.child.installed and \
+						dep.parent.cpv == replacement_parent.cpv and \
+						dep.child.cpv == pkg.cpv:
+						# Then can happen if the child's sub-slot changed
+						# without a revision bump. The sub-slot change is
+						# considered insignificant until one of its parent
+						# packages needs to be rebuilt.
+						insignificant = True
+
 					if debug:
 						msg = []
 						msg.append("")
@@ -1234,10 +1247,15 @@ class depgraph(object):
 						msg.append("   existing parent package: %s" % dep.parent)
 						msg.append("   new child package:  %s" % pkg)
 						msg.append("   new parent package: %s" % replacement_parent)
+						if insignificant:
+							msg.append("insignificant changes detected")
 						msg.append("")
 						writemsg_level("\n".join(msg),
 							noiselevel=-1, level=logging.DEBUG)
 
+					if insignificant:
+						return None
+
 					return pkg
 
 		if debug:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-12  3:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-12  3:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e0bda3c5aaa19799ba297c30c6673f21c6483430
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 03:24:57 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 12 03:24:57 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e0bda3c5

_get_dep_chain: include repo names

---
 pym/_emerge/depgraph.py |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index eb88357..06a9a46 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3388,6 +3388,15 @@ class depgraph(object):
 		child = None
 		all_parents = self._dynamic_config._parent_atoms
 		graph = self._dynamic_config.digraph
+		verbose_main_repo_display = "--verbose-main-repo-display" in \
+			self._frozen_config.myopts
+
+		def format_pkg(pkg):
+			pkg_name = "%s" % (pkg.cpv,)
+			if verbose_main_repo_display or pkg.repo != \
+				pkg.root_config.settings.repositories.mainRepo().name:
+				pkg_name += _repo_separator + pkg.repo
+			return pkg_name
 
 		if target_atom is not None and isinstance(node, Package):
 			affecting_use = set()
@@ -3400,7 +3409,8 @@ class depgraph(object):
 					if not node.installed:
 						raise
 			affecting_use.difference_update(node.use.mask, node.use.force)
-			pkg_name = "%s" % (node.cpv,)
+			pkg_name = format_pkg(node)
+
 			if affecting_use:
 				usedep = []
 				for flag in affecting_use:
@@ -3497,7 +3507,7 @@ class depgraph(object):
 				affecting_use.difference_update(node.use.mask, \
 					node.use.force)
 
-				pkg_name = "%s" % (node.cpv,)
+				pkg_name = format_pkg(node)
 				if affecting_use:
 					usedep = []
 					for flag in affecting_use:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-13  4:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-13  4:44 UTC (permalink / raw
  To: gentoo-commits

commit:     87bf26543beaa36e8ad5634cd8587d90a4197f7c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 13 04:44:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 13 04:44:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87bf2654

emerge: don't traceback or invalid *.ebuild args

---
 pym/_emerge/depgraph.py |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 06a9a46..fd6db38 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2584,15 +2584,16 @@ class depgraph(object):
 				pkgdir = os.path.dirname(ebuild_path)
 				tree_root = os.path.dirname(os.path.dirname(pkgdir))
 				cp = pkgdir[len(tree_root)+1:]
-				e = portage.exception.PackageNotFound(
-					("%s is not in a valid portage tree " + \
-					"hierarchy or does not exist") % x)
+				error_msg = ("\n\n!!! '%s' is not in a valid portage tree "
+					"hierarchy or does not exist\n") % x
 				if not portage.isvalidatom(cp):
-					raise e
+					writemsg(error_msg, noiselevel=-1)
+					return 0, myfavorites
 				cat = portage.catsplit(cp)[0]
 				mykey = cat + "/" + os.path.basename(ebuild_path[:-7])
 				if not portage.isvalidatom("="+mykey):
-					raise e
+					writemsg(error_msg, noiselevel=-1)
+					return 0, myfavorites
 				ebuild_path = portdb.findname(mykey)
 				if ebuild_path:
 					if ebuild_path != os.path.join(os.path.realpath(tree_root),
@@ -2608,8 +2609,8 @@ class depgraph(object):
 						countdown(int(self._frozen_config.settings["EMERGE_WARNING_DELAY"]),
 							"Continuing...")
 				else:
-					raise portage.exception.PackageNotFound(
-						"%s is not in a valid portage tree hierarchy or does not exist" % x)
+					writemsg(error_msg, noiselevel=-1)
+					return 0, myfavorites
 				pkg = self._pkg(mykey, "ebuild", root_config,
 					onlydeps=onlydeps, myrepo=portdb.getRepositoryName(
 					os.path.dirname(os.path.dirname(os.path.dirname(ebuild_path)))))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-14  0:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-14  0:46 UTC (permalink / raw
  To: gentoo-commits

commit:     875e3bd72f8bcdc5e4a19ee4ba98f4267195ef0e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 14 00:45:45 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 14 00:45:45 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=875e3bd7

--complete-if-new-ver: check for slot change

---
 pym/_emerge/depgraph.py |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fd6db38..085e6cb 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4963,10 +4963,16 @@ class depgraph(object):
 					inst_pkg = vardb.match_pkgs(node.slot_atom)
 					if inst_pkg and inst_pkg[0].cp == node.cp:
 						inst_pkg = inst_pkg[0]
-						if complete_if_new_ver and \
-							(inst_pkg < node or node < inst_pkg):
-							version_change = True
-							break
+						if complete_if_new_ver:
+							if inst_pkg < node or node < inst_pkg:
+								version_change = True
+								break
+							elif not (inst_pkg.slot == node.slot and
+								inst_pkg.sub_slot == node.sub_slot):
+								# slot/sub-slot change without revbump gets
+								# similar treatment to a version change
+								version_change = True
+								break
 
 						# Intersect enabled USE with IUSE, in order to
 						# ignore forced USE from implicit IUSE flags, since
@@ -4982,7 +4988,8 @@ class depgraph(object):
 				if complete_if_new_slot:
 					cp_list = vardb.match_pkgs(Atom(node.cp))
 					if (cp_list and cp_list[0].cp == node.cp and
-						not any(node.slot == pkg.slot for pkg in cp_list)):
+						not any(node.slot == pkg.slot and
+						node.sub_slot == pkg.sub_slot for pkg in cp_list)):
 						version_change = True
 						break
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-14  3:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-14  3:40 UTC (permalink / raw
  To: gentoo-commits

commit:     9ea0fe8aabca82b8e8f6d05b0cde417316b635cd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 14 03:40:19 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 14 03:40:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ea0fe8a

_slot_operator_update_probe: handle slot conflict

The "insignificant change" detection from commit
0240b8b754ab5f642c50c863d4bec1dc3636ba29 is only valid when we are
not trying to resolve a slot conflict (see bug #457142).

---
 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 085e6cb..e0ea895 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1028,7 +1028,7 @@ class depgraph(object):
 				dep = Dependency(atom=atom, child=other_pkg,
 					parent=parent, root=pkg.root)
 
-				if self._slot_operator_update_probe(dep):
+				if self._slot_operator_update_probe(dep, slot_conflict=True):
 					self._slot_operator_update_backtrack(dep)
 					found_update = True
 
@@ -1154,7 +1154,8 @@ class depgraph(object):
 
 		self._dynamic_config._need_restart = True
 
-	def _slot_operator_update_probe(self, dep, new_child_slot=False):
+	def _slot_operator_update_probe(self, dep, new_child_slot=False,
+		slot_conflict=False):
 		"""
 		slot/sub-slot := operators tend to prevent updates from getting pulled in,
 		since installed packages pull in packages with the slot/sub-slot that they
@@ -1227,7 +1228,8 @@ class depgraph(object):
 								continue
 
 					insignificant = False
-					if selective and \
+					if not slot_conflict and \
+						selective and \
 						dep.parent.installed and \
 						dep.child.installed and \
 						dep.parent.cpv == replacement_parent.cpv and \
@@ -1235,7 +1237,8 @@ class depgraph(object):
 						# Then can happen if the child's sub-slot changed
 						# without a revision bump. The sub-slot change is
 						# considered insignificant until one of its parent
-						# packages needs to be rebuilt.
+						# packages needs to be rebuilt (which may trigger a
+						# slot conflict).
 						insignificant = True
 
 					if debug:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-18  4:50 Mike Frysinger
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Frysinger @ 2013-02-18  4:50 UTC (permalink / raw
  To: gentoo-commits

commit:     630047890226fa6e0e1994b931e5ce680f1cdfcc
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 18 02:19:04 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Feb 18 04:49:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=63004789

depgraph: tweak "required by" message format

The current output format for listing a chain of dependencies produces
one long flat line that can be hard to read.  For example, if you mask
dev-lang/ruby and then try to install dev-ruby/json, you'll see:
 The following mask changes are necessary to proceed:
  (see "package.unmask" in the portage(5) man page for more details)
 #required by dev-ruby/rdoc-3.12.1[ruby_targets_ruby19]
 # /etc/portage/package.mask/misc:
 =dev-lang/ruby-1.9.3_p385
 #required by dev-ruby/rubygems-1.8.24[ruby_targets_ruby18], required by virtual/rubygems-1, required by dev-ruby/racc-1.4.9[-test,ruby_targets_ruby18], required by dev-ruby/rdoc-3.12.1[ruby_targets_ruby18], required by dev-lang/ruby-1.9.3_p385[rdoc], required by dev-ruby/rake-0.9.2.2[ruby_targets_ruby19], required by dev-ruby/json-1.7.7[-test,-doc,ruby_targets_ruby19]
 # /etc/portage/package.mask/misc:
 =dev-lang/ruby-1.8.7_p371

Tracing your way through that list is not easy.  Instead, let's use
newlines and now we get:
 The following mask changes are necessary to proceed:
  (see "package.unmask" in the portage(5) man page for more details)
 # required by dev-ruby/rdoc-3.12.1[ruby_targets_ruby19]
 # /etc/portage/package.mask/misc:
 =dev-lang/ruby-1.9.3_p385
 # required by dev-ruby/rubygems-1.8.24[ruby_targets_ruby18]
 # required by virtual/rubygems-1
 # required by dev-ruby/racc-1.4.9[-test,ruby_targets_ruby18]
 # required by dev-ruby/rdoc-3.12.1[ruby_targets_ruby18]
 # required by dev-lang/ruby-1.9.3_p385[rdoc]
 # required by dev-ruby/rake-0.9.2.2[ruby_targets_ruby19]
 # required by dev-ruby/json-1.7.7[-test,-doc,ruby_targets_ruby19]
 # /etc/portage/package.mask/misc:
 =dev-lang/ruby-1.8.7_p371

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 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 bab1c32..6f7b673 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3617,7 +3617,7 @@ class depgraph(object):
 			else:
 				display_list.append("required by %s" % node)
 
-		msg = "#" + ", ".join(display_list) + "\n"
+		msg = "# " + "\n# ".join(display_list) + "\n"
 		return msg
 
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-02-21 14:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-02-21 14:29 UTC (permalink / raw
  To: gentoo-commits

commit:     ff864a499160f3abda33e7247e0e457bd7ba4270
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 21 14:28:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 21 14:28:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ff864a49

Remove "Starting parallel fetch" msg, bug #368297

---
 pym/_emerge/Scheduler.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index c495ae0..4b29c71 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -718,7 +718,6 @@ class Scheduler(PollScheduler):
 			return
 
 		if self._parallel_fetch:
-			self._status_msg("Starting parallel fetch")
 
 			prefetchers = self._prefetchers
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-02  0:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-02  0:58 UTC (permalink / raw
  To: gentoo-commits

commit:     dd75365b27460fc5ceea697bfbb7cb2c2ddcc1cf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  2 00:57:56 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 00:57:56 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd75365b

Fix autounmask/sub-slot interference, bug #459832

---
 pym/_emerge/depgraph.py |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6f7b673..7e51d03 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3058,6 +3058,10 @@ class depgraph(object):
 			self._dynamic_config._need_restart = True
 			return False, myfavorites
 
+		if self.need_restart():
+			# want_restart_for_use_change triggers this
+			return False, myfavorites
+
 		# Any failures except those due to autounmask *alone* should return
 		# before this point, since the success_without_autounmask flag that's
 		# set below is reserved for cases where there are *zero* other
@@ -4274,19 +4278,27 @@ class depgraph(object):
 		if self._dynamic_config._autounmask is True:
 			reset_pkg(pkg)
 
-			for autounmask_level in self._autounmask_levels():
-				if pkg is not None:
-					break
+			# Temporarily reset _need_restart state, in order to
+			# avoid interference as reported in bug #459832.
+			earlier_need_restart = self._dynamic_config._need_restart
+			self._dynamic_config._need_restart = False
+			try:
+				for autounmask_level in self._autounmask_levels():
+					if pkg is not None:
+						break
 
-				pkg, existing = \
-					self._wrapped_select_pkg_highest_available_imp(
-						root, atom, onlydeps=onlydeps,
-						autounmask_level=autounmask_level)
+					pkg, existing = \
+						self._wrapped_select_pkg_highest_available_imp(
+							root, atom, onlydeps=onlydeps,
+							autounmask_level=autounmask_level)
 
-				reset_pkg(pkg)
-			
-			if self._dynamic_config._need_restart:
-				return None, None
+					reset_pkg(pkg)
+
+				if self._dynamic_config._need_restart:
+					return None, None
+			finally:
+				if earlier_need_restart:
+					self._dynamic_config._need_restart = True
 
 		if pkg is None:
 			# This ensures that we can fall back to an installed package


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-02  2:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-02  2:55 UTC (permalink / raw
  To: gentoo-commits

commit:     d2fd1695b569ee8f6cf91dc012e4c0c7796ebe81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  2 02:55:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 02:55:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2fd1695

depgraph._set_args: fix atom_arg_map for refs > 1

Due to an indentation error, atom_arg_map only preserved a single
set reference, preventing slot-operator rebuilds from triggering
for atoms that were also pulled in via another set such as world.

---
 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 7e51d03..dddada0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3123,8 +3123,8 @@ class depgraph(object):
 				if refs is None:
 					refs = []
 					atom_arg_map[atom_key] = refs
-					if arg not in refs:
-						refs.append(arg)
+				if arg not in refs:
+					refs.append(arg)
 
 		for root in self._dynamic_config.sets:
 			depgraph_sets = self._dynamic_config.sets[root]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-05  1:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-05  1:07 UTC (permalink / raw
  To: gentoo-commits

commit:     70ea9fada67dde2c8d8e61857153d940cb596683
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  5 01:07:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  5 01:07:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=70ea9fad

Don't use splitext for .ebuild/.tbz2 check.

---
 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 b8cb2cd..e4f93c6 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3597,8 +3597,7 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 	del mytrees, mydb
 
 	for x in myfiles:
-		ext = os.path.splitext(x)[1]
-		if (ext == ".ebuild" or ext == ".tbz2") and \
+		if (x.endswith(".ebuild") or x.endswith(".tbz2")) and \
 			os.path.exists(os.path.abspath(x)):
 			print(colorize("BAD", "\n*** emerging by path is broken "
 				"and may not always work!!!\n"))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-05  1:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-05  1:21 UTC (permalink / raw
  To: gentoo-commits

commit:     60fb27fe4eaec68e32a07f70dda25700a1d124b8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  5 01:21:03 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  5 01:21:03 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60fb27fe

Use endswith(tuple).

---
 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 e4f93c6..fae293e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3597,7 +3597,7 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 	del mytrees, mydb
 
 	for x in myfiles:
-		if (x.endswith(".ebuild") or x.endswith(".tbz2")) and \
+		if x.endswith((".ebuild", ".tbz2")) and \
 			os.path.exists(os.path.abspath(x)):
 			print(colorize("BAD", "\n*** emerging by path is broken "
 				"and may not always work!!!\n"))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-05  1:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-05  1:39 UTC (permalink / raw
  To: gentoo-commits

commit:     12cc872ab3ae821874cd6f06bb9500061c538712
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  5 01:38:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  5 01:38:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12cc872a

_add_dep: remove questionable need_restart logic

This need_restart logic was apparently intended to interact with
want_restart_for_use_change, but doesn't appear to be necessary
anymore. We really don't want the need_restart flag to prevent
"missing dependency" backtracking.

---
 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 9033285..34ad413 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1695,9 +1695,13 @@ class depgraph(object):
 					self._slot_operator_unsatisfied_probe(dep):
 					self._slot_operator_unsatisfied_backtrack(dep)
 					return 1
-				elif not self.need_restart():
+				else:
 					# Do not backtrack if only USE have to be changed in
-					# order to satisfy the dependency.
+					# order to satisfy the dependency. Note that when
+					# want_restart_for_use_change sets the need_restart
+					# flag, it causes _select_pkg_highest_available to
+					# return None, and eventually we come through here
+					# and skip the "missing dependency" backtracking path.
 					dep_pkg, existing_node = \
 						self._select_package(dep.root, dep.atom.without_use,
 							onlydeps=dep.onlydeps)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-13  5:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-13  5:10 UTC (permalink / raw
  To: gentoo-commits

commit:     16e1f2185bb7ed36d3119b29a50ca0ff75fa8b71
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 13 05:10:08 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 13 05:10:08 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=16e1f218

expand_set_arguments: defer set load for depgraph

This allows the depgraph to display the "Calculating dependencies"
message before sets are loaded, as discussed in bug #461412.

---
 pym/_emerge/actions.py  |   12 +++++++++---
 pym/_emerge/depgraph.py |   28 ++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 7fe8e83..d7d248a 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3340,7 +3340,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
 	# world file, the depgraph performs set expansion later. It will get
 	# confused about where the atoms came from if it's not allowed to
 	# expand them itself.
-	do_not_expand = (None, )
+	do_not_expand = myaction is None
 	newargs = []
 	for a in myfiles:
 		if a in ("system", "world"):
@@ -3406,6 +3406,14 @@ def expand_set_arguments(myfiles, myaction, root_config):
 					for line in textwrap.wrap(msg, 50):
 						out.ewarn(line)
 				setconfig.active.append(s)
+
+				if do_not_expand:
+					# Loading sets can be slow, so skip it here, in order
+					# to allow the depgraph to indicate progress with the
+					# spinner while sets are loading (bug #461412).
+					newargs.append(a)
+					continue
+
 				try:
 					set_atoms = setconfig.getSetAtoms(s)
 				except portage.exception.PackageSetNotFound as e:
@@ -3426,8 +3434,6 @@ def expand_set_arguments(myfiles, myaction, root_config):
 					retval = 1
 				elif not set_atoms:
 					print("emerge: '%s' is an empty set" % s)
-				elif myaction not in do_not_expand:
-					newargs.extend(set_atoms)
 				else:
 					newargs.append(SETPREFIX+s)
 				for e in sets[s].errors:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 965d3bc..7e3a0eb 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2714,6 +2714,29 @@ class depgraph(object):
 						raise portage.exception.PackageSetNotFound(s)
 					if s in depgraph_sets.sets:
 						continue
+
+					try:
+						set_atoms = root_config.setconfig.getSetAtoms(s)
+					except portage.exception.PackageSetNotFound as e:
+						writemsg_level("\n\n", level=logging.ERROR,
+							noiselevel=-1)
+						for pset in list(depgraph_sets.sets.values()) + [sets[s]]:
+							for error_msg in pset.errors:
+								sys.stderr.write("%s\n" % (error_msg,))
+
+						writemsg_level(("emerge: the given set '%s' "
+							"contains a non-existent set named '%s'.\n") % \
+							(s, e), level=logging.ERROR, noiselevel=-1)
+						if s in ('world', 'selected') and \
+							SETPREFIX + e.value in sets['selected']:
+							writemsg_level(("Use `emerge --deselect %s%s` to "
+								"remove this set from world_sets.\n") %
+								(SETPREFIX, e,), level=logging.ERROR,
+								noiselevel=-1)
+						writemsg_level("\n", level=logging.ERROR,
+							noiselevel=-1)
+						return False, myfavorites
+
 					pset = sets[s]
 					depgraph_sets.sets[s] = pset
 					args.append(SetArg(arg=x, pset=pset,
@@ -7031,6 +7054,11 @@ class depgraph(object):
 
 		self._display_autounmask()
 
+		for depgraph_sets in self._dynamic_config.sets.values():
+			for pset in depgraph_sets.sets.values():
+				for e in pset.errors:
+					sys.stderr.write("%s\n" % (e,))
+
 		# TODO: Add generic support for "set problem" handlers so that
 		# the below warnings aren't special cases for world only.
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-13 15:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-13 15:10 UTC (permalink / raw
  To: gentoo-commits

commit:     cd6104c888c6e0e2f42bb234b919faf0dff3b3fe
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 13 15:10:03 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 13 15:10:03 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cd6104c8

expand_set_arguments: fix expansion breakage

This broke in commit 16e1f2185bb7ed36d3119b29a50ca0ff75fa8b71.

---
 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 d7d248a..008a5d5 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3435,7 +3435,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
 				elif not set_atoms:
 					print("emerge: '%s' is an empty set" % s)
 				else:
-					newargs.append(SETPREFIX+s)
+					newargs.extend(set_atoms)
 				for e in sets[s].errors:
 					print(e)
 		else:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-13 15:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-13 15:19 UTC (permalink / raw
  To: gentoo-commits

commit:     ca966f66b92a928c4296e5f0f5bca3c18d83e324
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 13 15:19:06 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 13 15:19:06 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca966f66

Use writemsg for unicode safety in set messages.

---
 pym/_emerge/actions.py  |   13 ++++++++-----
 pym/_emerge/depgraph.py |    8 +++++---
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 008a5d5..2c5a1b3 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3429,15 +3429,18 @@ def expand_set_arguments(myfiles, myaction, root_config):
 					return (None, 1)
 				if myaction in unmerge_actions and \
 						not sets[s].supportsOperation("unmerge"):
-					sys.stderr.write("emerge: the given set '%s' does " % s + \
-						"not support unmerge operations\n")
+					writemsg_level("emerge: the given set '%s' does " % s + \
+						"not support unmerge operations\n",
+						level=logging.ERROR, noiselevel=-1)
 					retval = 1
 				elif not set_atoms:
-					print("emerge: '%s' is an empty set" % s)
+					writemsg_level("emerge: '%s' is an empty set\n" % s,
+						level=logging.INFO, noiselevel=-1)
 				else:
 					newargs.extend(set_atoms)
-				for e in sets[s].errors:
-					print(e)
+				for error_msg in sets[s].errors:
+					writemsg_level("%s\n" % (error_msg,),
+						level=logging.ERROR, noiselevel=-1)
 		else:
 			newargs.append(a)
 	return (newargs, retval)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index dfef6a7..326dd68 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2742,7 +2742,8 @@ class depgraph(object):
 							noiselevel=-1)
 						for pset in list(depgraph_sets.sets.values()) + [sets[s]]:
 							for error_msg in pset.errors:
-								sys.stderr.write("%s\n" % (error_msg,))
+								writemsg_level("%s\n" % (error_msg,),
+									level=logging.ERROR, noiselevel=-1)
 
 						writemsg_level(("emerge: the given set '%s' "
 							"contains a non-existent set named '%s'.\n") % \
@@ -7076,8 +7077,9 @@ class depgraph(object):
 
 		for depgraph_sets in self._dynamic_config.sets.values():
 			for pset in depgraph_sets.sets.values():
-				for e in pset.errors:
-					sys.stderr.write("%s\n" % (e,))
+				for error_msg in pset.errors:
+					writemsg_level("%s\n" % (error_msg,),
+						level=logging.ERROR, noiselevel=-1)
 
 		# TODO: Add generic support for "set problem" handlers so that
 		# the below warnings aren't special cases for world only.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-18 10:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-18 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     4d51bdfc52e490dd8682922b16350859e4eb0240
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 10:21:42 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 10:21:42 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d51bdfc

insert_category_into_atom: handle wildcard

---
 pym/_emerge/is_valid_package_atom.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/is_valid_package_atom.py b/pym/_emerge/is_valid_package_atom.py
index c4f6ffd..112afc1 100644
--- a/pym/_emerge/is_valid_package_atom.py
+++ b/pym/_emerge/is_valid_package_atom.py
@@ -1,11 +1,12 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import re
 from portage.dep import isvalidatom
 
 def insert_category_into_atom(atom, category):
-	alphanum = re.search(r'\w', atom, re.UNICODE)
+	# Handle '*' character for "extended syntax" wildcard support.
+	alphanum = re.search(r'[\*\w]', atom, re.UNICODE)
 	if alphanum:
 		ret = atom[:alphanum.start()] + "%s/" % category + \
 			atom[alphanum.start():]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-19 18:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-19 18:37 UTC (permalink / raw
  To: gentoo-commits

commit:     38358b20857bb048ad6ba2fce514df3319a2f349
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 18:36:44 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 18:36:44 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=38358b20

Task: implement __repr__

---
 pym/_emerge/Task.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py
index 40f5066..769884b 100644
--- a/pym/_emerge/Task.py
+++ b/pym/_emerge/Task.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.util.SlotObject import SlotObject
@@ -41,3 +41,7 @@ class Task(SlotObject):
 		strings.
 		"""
 		return "(%s)" % ", ".join(("'%s'" % x for x in self._hash_key))
+
+	def __repr__(self):
+		return "<%s (%s)>" % (self.__class__.__name__,
+			", ".join(("'%s'" % x for x in self._hash_key)))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-19 18:47 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-19 18:47 UTC (permalink / raw
  To: gentoo-commits

commit:     ebecb93645d1d742e47792c40f4f79dff40362e5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 18:47:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 18:47:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ebecb936

autounmask: remove faulty reset_pkg() function

This function did not work as intended, due to the pkg variable being
updated in the wrong scope.

---
 pym/_emerge/depgraph.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 326dd68..a17398c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4342,15 +4342,12 @@ class depgraph(object):
 
 		default_selection = (pkg, existing)
 
-		def reset_pkg(pkg):
+		if self._dynamic_config._autounmask is True:
 			if pkg is not None and \
 				pkg.installed and \
 				not self._want_installed_pkg(pkg):
 				pkg = None
 
-		if self._dynamic_config._autounmask is True:
-			reset_pkg(pkg)
-
 			# Temporarily reset _need_restart state, in order to
 			# avoid interference as reported in bug #459832.
 			earlier_need_restart = self._dynamic_config._need_restart
@@ -4365,7 +4362,10 @@ class depgraph(object):
 							root, atom, onlydeps=onlydeps,
 							autounmask_level=autounmask_level)
 
-					reset_pkg(pkg)
+					if pkg is not None and \
+						pkg.installed and \
+						not self._want_installed_pkg(pkg):
+						pkg = None
 
 				if self._dynamic_config._need_restart:
 					return None, None


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-19 20:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-19 20:22 UTC (permalink / raw
  To: gentoo-commits

commit:     84fec97d714d417d9c70643a74889c4c5f2ba530
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 20:21:43 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 20:21:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84fec97d

Task.__repr__: handle python-trace

---
 pym/_emerge/Task.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py
index 769884b..250d458 100644
--- a/pym/_emerge/Task.py
+++ b/pym/_emerge/Task.py
@@ -43,5 +43,8 @@ class Task(SlotObject):
 		return "(%s)" % ", ".join(("'%s'" % x for x in self._hash_key))
 
 	def __repr__(self):
+		if self._hash_key is None:
+			# triggered by python-trace
+			return SlotObject.__repr__(self)
 		return "<%s (%s)>" % (self.__class__.__name__,
 			", ".join(("'%s'" % x for x in self._hash_key)))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-19 21:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-19 21:38 UTC (permalink / raw
  To: gentoo-commits

commit:     658dfb6d294bb1efcee503c6b392be74e192d9ac
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 21:38:33 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 21:38:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=658dfb6d

_iter_similar_available: do built checks together

---
 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 308c583..dceae52 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1475,9 +1475,9 @@ class depgraph(object):
 			if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
 				modified_use=self._pkg_use_enabled(pkg)):
 				continue
-			if pkg.built and self._equiv_binary_installed(pkg):
-				continue
 			if pkg.built:
+				if self._equiv_binary_installed(pkg):
+					continue
 				if not (not use_ebuild_visibility and
 					(usepkgonly or useoldpkg_atoms.findAtomForPackage(
 					pkg, modified_use=self._pkg_use_enabled(pkg)))) and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-23 22:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-23 22:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e43524dc88774f768441dcb386a534166a53f7fa
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 23 21:59:58 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 23 22:02:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e43524dc

SpawnProcess: disable FD_CLOEXEC on stdout for #456296

---
 pym/_emerge/SpawnProcess.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 9155050..c549884 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -14,6 +14,12 @@ from portage import os
 from portage.const import BASH_BINARY
 from portage.util._async.PipeLogger import PipeLogger
 
+# https://bugs.gentoo.org/show_bug.cgi?id=456296
+import platform
+if platform.system() in ("Darwin",):
+    # disable FD_CLOEXEC on stdout, breaks horribly
+    fcntl = None
+
 class SpawnProcess(SubProcess):
 
 	"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-23 23:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-23 23:00 UTC (permalink / raw
  To: gentoo-commits

commit:     751c636d562b1da459b65f18065070d406df2e28
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 23 23:00:17 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Mar 23 23:00:17 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=751c636d

SubProcess: re-organize Darwin/fcntl logic

---
 pym/_emerge/SpawnProcess.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index c549884..25859a9 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -7,18 +7,17 @@ except ImportError:
 	# http://bugs.jython.org/issue1074
 	fcntl = None
 
-from _emerge.SubProcess import SubProcess
+import platform
 import sys
+
+from _emerge.SubProcess import SubProcess
 import portage
 from portage import os
 from portage.const import BASH_BINARY
 from portage.util._async.PipeLogger import PipeLogger
 
-# https://bugs.gentoo.org/show_bug.cgi?id=456296
-import platform
-if platform.system() in ("Darwin",):
-    # disable FD_CLOEXEC on stdout, breaks horribly
-    fcntl = None
+# On Darwin, FD_CLOEXEC triggers errno 35 for stdout (bug #456296)
+_disable_cloexec_stdout = platform.system() in ("Darwin",)
 
 class SpawnProcess(SubProcess):
 
@@ -120,7 +119,7 @@ class SpawnProcess(SubProcess):
 		stdout_fd = None
 		if can_log and not self.background:
 			stdout_fd = os.dup(fd_pipes_orig[1])
-			if fcntl is not None:
+			if fcntl is not None and not _disable_cloexec_stdout:
 				try:
 					fcntl.FD_CLOEXEC
 				except AttributeError:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-27  5:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-27  5:19 UTC (permalink / raw
  To: gentoo-commits

commit:     80937b9c751d20b33babe1e78e874057088df31c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 27 05:19:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 27 05:19:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80937b9c

_autounmask_levels: refactor (no behavior change)

---
 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 dceae52..2b36853 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4351,15 +4351,12 @@ class depgraph(object):
 		autounmask_level.allow_license_changes = True
 		yield autounmask_level
 
-		for only_use_changes in (False,):
-
-			autounmask_level.allow_unstable_keywords = (not only_use_changes)
-			autounmask_level.allow_license_changes = (not only_use_changes)
+		autounmask_level.allow_unstable_keywords = True
+		yield autounmask_level
 
-			for missing_keyword, unmask in ((False,False), (True, False), (False, True), (True, True)):
+		if not autounmask_keep_masks:
 
-				if (only_use_changes or autounmask_keep_masks) and (missing_keyword or unmask):
-					break
+			for missing_keyword, unmask in ((True, False), (False, True), (True, True)):
 
 				autounmask_level.allow_missing_keywords = missing_keyword
 				autounmask_level.allow_unmasks = unmask


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-03-27  5:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-03-27  5:51 UTC (permalink / raw
  To: gentoo-commits

commit:     566347ec232f50b07c8ab219fee4fef0788c3560
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 27 05:51:18 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 27 05:51:18 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=566347ec

_autounmask_levels: respect keywords, bug #463394

This adds an additional autounmask level which tries to respect
keywords while discarding package.mask as discussed in bug #463394.

---
 pym/_emerge/depgraph.py |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2b36853..b6dd5ff 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4330,8 +4330,9 @@ class depgraph(object):
 		1. USE + license
 		2. USE + ~arch + license
 		3. USE + ~arch + license + missing keywords
-		4. USE + ~arch + license + masks
-		5. USE + ~arch + license + missing keywords + masks
+		4. USE + license + masks
+		5. USE + ~arch + license + masks
+		6. USE + ~arch + license + missing keywords + masks
 
 		Some thoughts:
 			* Do least invasive changes first.
@@ -4356,7 +4357,20 @@ class depgraph(object):
 
 		if not autounmask_keep_masks:
 
-			for missing_keyword, unmask in ((True, False), (False, True), (True, True)):
+			autounmask_level.allow_missing_keywords = True
+			yield autounmask_level
+
+			# 4. USE + license + masks
+			# Try to respect keywords while discarding
+			# package.mask (see bug #463394).
+			autounmask_level.allow_unstable_keywords = False
+			autounmask_level.allow_missing_keywords = False
+			autounmask_level.allow_unmasks = True
+			yield autounmask_level
+
+			autounmask_level.allow_unstable_keywords = True
+
+			for missing_keyword, unmask in ((False, True), (True, True)):
 
 				autounmask_level.allow_missing_keywords = missing_keyword
 				autounmask_level.allow_unmasks = unmask


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-04-02 19:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-04-02 19:29 UTC (permalink / raw
  To: gentoo-commits

commit:     5e09a02d257a94f415eaf4754c3f1d6c8f44fd6d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  2 19:29:23 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr  2 19:29:23 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e09a02d

emerge --exclude: avoid "world problems" warning

---
 pym/_emerge/depgraph.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b6dd5ff..a00c7fb 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3056,6 +3056,16 @@ class depgraph(object):
 						if pprovided_match:
 							continue
 
+						excluded = False
+						for any_match in self._iter_match_pkgs_any(
+							self._frozen_config.roots[myroot], atom):
+							if self._frozen_config.excluded_pkgs.findAtomForPackage(
+								any_match, modified_use=self._pkg_use_enabled(any_match)):
+								excluded = True
+								break
+						if excluded:
+							continue
+
 						if not (isinstance(arg, SetArg) and \
 							arg.name in ("selected", "system", "world")):
 							self._dynamic_config._unsatisfied_deps_for_display.append(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-04-11 23:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-04-11 23:14 UTC (permalink / raw
  To: gentoo-commits

commit:     62dbcaa4d873784f1082c184668fcdc34392925b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 11 23:13:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 11 23:13:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62dbcaa4

depgraph: don't _skip_restart for blockers

This prevents blockers from interfering with backtracking, as reported
in bug #465356, comment #15.

---
 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 a00c7fb..99b96bf 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5813,7 +5813,9 @@ class depgraph(object):
 		self._slot_operator_trigger_reinstalls()
 
 		if not self._validate_blockers():
-			self._dynamic_config._skip_restart = True
+			# Blockers don't trigger the _skip_restart flag, since
+			# backtracking may solve blockers when it solves slot
+			# conflicts (or by blind luck).
 			raise self._unknown_internal_error()
 
 	def _serialize_tasks(self):
@@ -6562,7 +6564,9 @@ class depgraph(object):
 			self._dynamic_config._unsatisfied_blockers_for_display = unsolvable_blockers
 			self._dynamic_config._serialized_tasks_cache = retlist[:]
 			self._dynamic_config._scheduler_graph = scheduler_graph
-			self._dynamic_config._skip_restart = True
+			# Blockers don't trigger the _skip_restart flag, since
+			# backtracking may solve blockers when it solves slot
+			# conflicts (or by blind luck).
 			raise self._unknown_internal_error()
 
 		if self._dynamic_config._slot_collision_info and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-04-22 16:35 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-04-22 16:35 UTC (permalink / raw
  To: gentoo-commits

commit:     a0cd7cf0191f27589dd2504dd6ab55199b78e7c7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 22 16:35:27 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 22 16:35:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a0cd7cf0

search: fix RuntimeError: No active exception

---
 pym/_emerge/search.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 5abc8a0..bd74fb7 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -69,7 +69,7 @@ class search(object):
 				return db.aux_get(*args, **kwargs)
 			except KeyError:
 				pass
-		raise
+		raise KeyError(args[0])
 
 	def _findname(self, *args, **kwargs):
 		for db in self._dbs:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-18 12:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-18 12:20 UTC (permalink / raw
  To: gentoo-commits

commit:     0d22dd6b813c4b7b49b1109ce332778e0e4cfc28
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 12:20:23 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 18 12:20:23 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0d22dd6b

Fix emerge --fetch --digest for bug #470238.

---
 pym/_emerge/EbuildBuild.py   |   10 ++++++++--
 pym/_emerge/EbuildFetcher.py |    3 ++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 599875a..845b115 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildExecuter import EbuildExecuter
@@ -15,6 +15,7 @@ import portage
 from portage import os
 from portage.output import colorize
 from portage.package.ebuild.digestcheck import digestcheck
+from portage.package.ebuild.digestgen import digestgen
 from portage.package.ebuild.doebuild import _check_temp_dir
 from portage.package.ebuild._spawn_nofetch import spawn_nofetch
 
@@ -91,7 +92,8 @@ class EbuildBuild(CompositeTask):
 		success = True
 
 		settings = self.settings
-		if 'strict' in settings.features:
+		if 'strict' in settings.features and \
+			'digest' not in settings.features:
 			settings['O'] = os.path.dirname(self._ebuild_path)
 			quiet_setting = settings.get('PORTAGE_QUIET')
 			settings['PORTAGE_QUIET'] = '1'
@@ -160,6 +162,10 @@ class EbuildBuild(CompositeTask):
 		if self.returncode != os.EX_OK:
 			portdb = self.pkg.root_config.trees[self._tree].dbapi
 			spawn_nofetch(portdb, self._ebuild_path, settings=self.settings)
+		if 'digest' in self.settings.features:
+			if not digestgen(mysettings=self.settings,
+				myportdb=self.pkg.root_config.trees[self._tree].dbapi):
+				self.returncode = 1
 		self.wait()
 
 	def _pre_clean_exit(self, pre_clean_phase):

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index df790b0..d98d007 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -165,7 +165,8 @@ class EbuildFetcher(ForkProcess):
 			not in ('yes', 'true')
 
 		rval = 1
-		allow_missing = self._get_manifest().allow_missing
+		allow_missing = self._get_manifest().allow_missing or \
+			'digest' in self._settings.features
 		if fetch(self._uri_map, self._settings, fetchonly=self.fetchonly,
 			digests=copy.deepcopy(self._get_digests()),
 			allow_missing_digests=allow_missing):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-18 12:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-18 12:29 UTC (permalink / raw
  To: gentoo-commits

commit:     f86a5a7364417e4a67e6b925f3def5e9d638ce98
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 12:29:20 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 18 12:29:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f86a5a73

EbuildBuild: don't digest if fetch failed

---
 pym/_emerge/EbuildBuild.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 845b115..75d906f 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -162,7 +162,7 @@ class EbuildBuild(CompositeTask):
 		if self.returncode != os.EX_OK:
 			portdb = self.pkg.root_config.trees[self._tree].dbapi
 			spawn_nofetch(portdb, self._ebuild_path, settings=self.settings)
-		if 'digest' in self.settings.features:
+		elif 'digest' in self.settings.features:
 			if not digestgen(mysettings=self.settings,
 				myportdb=self.pkg.root_config.trees[self._tree].dbapi):
 				self.returncode = 1


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-18 18:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-18 18:18 UTC (permalink / raw
  To: gentoo-commits

commit:     d7ad6e26a4e2e2f7e8e8823b67c021ef9d8b724f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 18:16:14 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 18 18:16:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7ad6e26

JobStatusDisplay: fix tigetstr for pypy-2.0_beta2

This will fix bug #470258.

---
 pym/_emerge/JobStatusDisplay.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/JobStatusDisplay.py b/pym/_emerge/JobStatusDisplay.py
index f48b213..9f6f09b 100644
--- a/pym/_emerge/JobStatusDisplay.py
+++ b/pym/_emerge/JobStatusDisplay.py
@@ -122,7 +122,8 @@ class JobStatusDisplay(object):
 
 		term_codes = {}
 		for k, capname in self._termcap_name_map.items():
-			code = tigetstr(capname)
+			# Use _native_string for PyPy compat (bug #470258).
+			code = tigetstr(portage._native_string(capname))
 			if code is None:
 				code = self._default_term_codes[capname]
 			term_codes[k] = code


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-19 17:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-19 17:25 UTC (permalink / raw
  To: gentoo-commits

commit:     63ecaedb3bb95bc64987c233029a5d6d62c44ee2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 19 17:25:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 19 17:25:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=63ecaedb

EMERGE_DEFAULT_OPTS: shlex for embedded quotes

---
 pym/_emerge/main.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 8afb56d..ce00ae3 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1043,7 +1043,8 @@ def emerge_main(args=None):
 
 	tmpcmdline = []
 	if "--ignore-default-opts" not in myopts:
-		tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split())
+		tmpcmdline.extend(portage.util.shlex_split(
+			settings.get("EMERGE_DEFAULT_OPTS", "")))
 	tmpcmdline.extend(args)
 	myaction, myopts, myfiles = parse_opts(tmpcmdline)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-24 18:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-24 18:12 UTC (permalink / raw
  To: gentoo-commits

commit:     13020ad05b8aca4de723c7fd55fc05dcd7937939
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 18:12:23 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 24 18:12:23 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=13020ad0

_find_bad_atoms: use insert_category_into_atom

This shares/aligns logic with is_valid_package_atom.

---
 pym/_emerge/main.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index ce00ae3..e066c87 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -9,11 +9,13 @@ import sys
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
 	'logging',
+	'portage.dep:Atom',
 	'portage.util:writemsg_level',
 	'textwrap',
 	'_emerge.actions:load_emerge_config,run_action,' + \
 		'validate_ebuild_environment',
 	'_emerge.help:help@emerge_help',
+	'_emerge.is_valid_package_atom:insert_category_into_atom'
 )
 from portage import os
 
@@ -258,14 +260,17 @@ def _find_bad_atoms(atoms, less_strict=False):
 	"""
 	bad_atoms = []
 	for x in ' '.join(atoms).split():
+		atom = x
+		if "/" not in x.split(":")[0]:
+			x_cat = insert_category_into_atom(x, 'dummy-category')
+			if x_cat is not None:
+				atom = x_cat
+
 		bad_atom = False
 		try:
-			atom = portage.dep.Atom(x, allow_wildcard=True, allow_repo=less_strict)
+			atom = Atom(atom, allow_wildcard=True, allow_repo=less_strict)
 		except portage.exception.InvalidAtom:
-			try:
-				atom = portage.dep.Atom("*/"+x, allow_wildcard=True, allow_repo=less_strict)
-			except portage.exception.InvalidAtom:
-				bad_atom = True
+			bad_atom = True
 
 		if bad_atom or (atom.operator and not less_strict) or atom.blocker or atom.use:
 			bad_atoms.append(x)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-31 22:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-31 22:43 UTC (permalink / raw
  To: gentoo-commits

commit:     debf30ee98b29894bd913b3ec691662143c0f30e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 31 22:43:07 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 31 22:43:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=debf30ee

depgraph: buidpkgonly error earlier, bug #471910

---
 pym/_emerge/actions.py  | 27 +--------------------------
 pym/_emerge/depgraph.py | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a46f565..7b2cf54 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -418,33 +418,8 @@ def action_build(settings, trees, mtimedb,
 			mergelist_shown = True
 			if retval != os.EX_OK:
 				return retval
-			if "--buildpkgonly" in myopts:
-				graph_copy = mydepgraph._dynamic_config.digraph.copy()
-				removed_nodes = set()
-				for node in graph_copy:
-					if not isinstance(node, Package) or \
-						node.operation == "nomerge":
-						removed_nodes.add(node)
-				graph_copy.difference_update(removed_nodes)
-				if not graph_copy.hasallzeros(ignore_priority = \
-					DepPrioritySatisfiedRange.ignore_medium):
-					print("\n!!! --buildpkgonly requires all dependencies to be merged.")
-					print("!!! You have to merge the dependencies before you can build this package.\n")
-					return 1
+
 	else:
-		if "--buildpkgonly" in myopts:
-			graph_copy = mydepgraph._dynamic_config.digraph.copy()
-			removed_nodes = set()
-			for node in graph_copy:
-				if not isinstance(node, Package) or \
-					node.operation == "nomerge":
-					removed_nodes.add(node)
-			graph_copy.difference_update(removed_nodes)
-			if not graph_copy.hasallzeros(ignore_priority = \
-				DepPrioritySatisfiedRange.ignore_medium):
-				print("\n!!! --buildpkgonly requires all dependencies to be merged.")
-				print("!!! Cannot merge requested packages. Merge deps and try again.\n")
-				return 1
 
 		if not mergelist_shown:
 			# If we haven't already shown the merge list above, at

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 99b96bf..7929a78 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -424,6 +424,7 @@ class _dynamic_depgraph_config(object):
 		self._skip_restart = False
 		self._backtrack_infos = {}
 
+		self._buildpkgonly_deps_unsatisfied = False
 		self._autounmask = depgraph._frozen_config.myopts.get('--autounmask') != 'n'
 		self._success_without_autounmask = False
 		self._traverse_ignored_deps = False
@@ -3175,6 +3176,21 @@ class depgraph(object):
 			# want_restart_for_use_change triggers this
 			return False, myfavorites
 
+		if "--fetchonly" not in self._frozen_config.myopts and \
+			"--buildpkgonly" in self._frozen_config.myopts:
+			graph_copy = self._dynamic_config.digraph.copy()
+			removed_nodes = set()
+			for node in graph_copy:
+				if not isinstance(node, Package) or \
+					node.operation == "nomerge":
+					removed_nodes.add(node)
+			graph_copy.difference_update(removed_nodes)
+			if not graph_copy.hasallzeros(ignore_priority = \
+				DepPrioritySatisfiedRange.ignore_medium):
+				self._dynamic_config._buildpkgonly_deps_unsatisfied = True
+				self._dynamic_config._skip_restart = True
+				return False, myfavorites
+
 		# Any failures except those due to autounmask *alone* should return
 		# before this point, since the success_without_autounmask flag that's
 		# set below is reserved for cases where there are *zero* other
@@ -7239,6 +7255,13 @@ class depgraph(object):
 			self._show_unsatisfied_dep(*pargs,
 				**portage._native_kwargs(kwargs))
 
+		if self._dynamic_config._buildpkgonly_deps_unsatisfied:
+			self._show_merge_list()
+			writemsg("\n!!! --buildpkgonly requires all "
+				"dependencies to be merged.\n", noiselevel=-1)
+			writemsg("!!! Cannot merge requested packages. "
+				"Merge deps and try again.\n\n", noiselevel=-1)
+
 	def saveNomergeFavorites(self):
 		"""Find atoms in favorites that are not in the mergelist and add them
 		to the world file if necessary."""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-31 23:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-31 23:24 UTC (permalink / raw
  To: gentoo-commits

commit:     4d031fd366f2ee135145181d449c5047badbc7e5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 31 23:24:32 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 31 23:24:32 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d031fd3

depgraph: tuple display list, avoid copies

TODO: Optimize _show_merge_list to use reference comparison more
instead of == comparison.

---
 pym/_emerge/depgraph.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7929a78..9c0a966 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5704,9 +5704,13 @@ class depgraph(object):
 			except self._serialize_tasks_retry:
 				pass
 
-		retlist = self._dynamic_config._serialized_tasks_cache[:]
+		retlist = self._dynamic_config._serialized_tasks_cache
 		if reversed:
+			# TODO: deprecate the "reversed" parameter (builtin name collision)
+			retlist = list(retlist)
 			retlist.reverse()
+			retlist = tuple(retlist)
+
 		return retlist
 
 	def _implicit_libc_deps(self, mergelist, graph):
@@ -6575,10 +6579,12 @@ class depgraph(object):
 		for blocker in unsolvable_blockers:
 			retlist.append(blocker)
 
+		retlist = tuple(retlist)
+
 		if unsolvable_blockers and \
 			not self._accept_blocker_conflicts():
 			self._dynamic_config._unsatisfied_blockers_for_display = unsolvable_blockers
-			self._dynamic_config._serialized_tasks_cache = retlist[:]
+			self._dynamic_config._serialized_tasks_cache = retlist
 			self._dynamic_config._scheduler_graph = scheduler_graph
 			# Blockers don't trigger the _skip_restart flag, since
 			# backtracking may solve blockers when it solves slot
@@ -6587,7 +6593,7 @@ class depgraph(object):
 
 		if self._dynamic_config._slot_collision_info and \
 			not self._accept_blocker_conflicts():
-			self._dynamic_config._serialized_tasks_cache = retlist[:]
+			self._dynamic_config._serialized_tasks_cache = retlist
 			self._dynamic_config._scheduler_graph = scheduler_graph
 			raise self._unknown_internal_error()
 
@@ -6641,12 +6647,13 @@ class depgraph(object):
 	def _show_merge_list(self):
 		if self._dynamic_config._serialized_tasks_cache is not None and \
 			not (self._dynamic_config._displayed_list is not None and \
-			(self._dynamic_config._displayed_list == self._dynamic_config._serialized_tasks_cache or \
+			(self._dynamic_config._displayed_list is self._dynamic_config._serialized_tasks_cache or \
+			self._dynamic_config._displayed_list == self._dynamic_config._serialized_tasks_cache or \
 			self._dynamic_config._displayed_list == \
 				list(reversed(self._dynamic_config._serialized_tasks_cache)))):
-			display_list = self._dynamic_config._serialized_tasks_cache[:]
+			display_list = self._dynamic_config._serialized_tasks_cache
 			if "--tree" in self._frozen_config.myopts:
-				display_list.reverse()
+				display_list = tuple(reversed(display_list))
 			self.display(display_list)
 
 	def _show_unsatisfied_blockers(self, blockers):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-05-31 23:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-05-31 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     1ea42d5d12ff3f8e59ebcfd12025d401b51894e1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 31 23:24:32 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 31 23:51:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ea42d5d

depgraph: tuple display list, avoid copies

TODO: Optimize _show_merge_list to use reference comparison more
instead of == comparison.

---
 pym/_emerge/Scheduler.py |  2 +-
 pym/_emerge/depgraph.py  | 19 +++++++++++++------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5930550..4e8b223 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1830,7 +1830,7 @@ class Scheduler(PollScheduler):
 			mylist = mydepgraph.altlist()
 			if mylist:
 				if "--tree" in self.myopts:
-					mylist.reverse()
+					mylist = tuple(reversed(mylist))
 				mydepgraph.display(mylist, favorites=self._favorites)
 
 		if not success:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7929a78..9c0a966 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5704,9 +5704,13 @@ class depgraph(object):
 			except self._serialize_tasks_retry:
 				pass
 
-		retlist = self._dynamic_config._serialized_tasks_cache[:]
+		retlist = self._dynamic_config._serialized_tasks_cache
 		if reversed:
+			# TODO: deprecate the "reversed" parameter (builtin name collision)
+			retlist = list(retlist)
 			retlist.reverse()
+			retlist = tuple(retlist)
+
 		return retlist
 
 	def _implicit_libc_deps(self, mergelist, graph):
@@ -6575,10 +6579,12 @@ class depgraph(object):
 		for blocker in unsolvable_blockers:
 			retlist.append(blocker)
 
+		retlist = tuple(retlist)
+
 		if unsolvable_blockers and \
 			not self._accept_blocker_conflicts():
 			self._dynamic_config._unsatisfied_blockers_for_display = unsolvable_blockers
-			self._dynamic_config._serialized_tasks_cache = retlist[:]
+			self._dynamic_config._serialized_tasks_cache = retlist
 			self._dynamic_config._scheduler_graph = scheduler_graph
 			# Blockers don't trigger the _skip_restart flag, since
 			# backtracking may solve blockers when it solves slot
@@ -6587,7 +6593,7 @@ class depgraph(object):
 
 		if self._dynamic_config._slot_collision_info and \
 			not self._accept_blocker_conflicts():
-			self._dynamic_config._serialized_tasks_cache = retlist[:]
+			self._dynamic_config._serialized_tasks_cache = retlist
 			self._dynamic_config._scheduler_graph = scheduler_graph
 			raise self._unknown_internal_error()
 
@@ -6641,12 +6647,13 @@ class depgraph(object):
 	def _show_merge_list(self):
 		if self._dynamic_config._serialized_tasks_cache is not None and \
 			not (self._dynamic_config._displayed_list is not None and \
-			(self._dynamic_config._displayed_list == self._dynamic_config._serialized_tasks_cache or \
+			(self._dynamic_config._displayed_list is self._dynamic_config._serialized_tasks_cache or \
+			self._dynamic_config._displayed_list == self._dynamic_config._serialized_tasks_cache or \
 			self._dynamic_config._displayed_list == \
 				list(reversed(self._dynamic_config._serialized_tasks_cache)))):
-			display_list = self._dynamic_config._serialized_tasks_cache[:]
+			display_list = self._dynamic_config._serialized_tasks_cache
 			if "--tree" in self._frozen_config.myopts:
-				display_list.reverse()
+				display_list = tuple(reversed(display_list))
 			self.display(display_list)
 
 	def _show_unsatisfied_blockers(self, blockers):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-08 11:47 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-08 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     fe6c6665fac0a4f2257bd9e0c2171c9e182ebc8f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  8 11:47:01 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  8 11:47:01 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe6c6665

emerge --metadata/regen: flush portdbapi cache

---
 pym/_emerge/MetadataRegen.py | 2 ++
 pym/_emerge/actions.py       | 1 +
 2 files changed, 3 insertions(+)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index bdf2fa7..d92b6a0 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -86,6 +86,7 @@ class MetadataRegen(AsyncScheduler):
 
 		self._termination_check()
 		if self._terminated_tasks:
+			portdb.flush_cache()
 			self.returncode = self._cancelled_returncode
 			return self.returncode
 
@@ -130,6 +131,7 @@ class MetadataRegen(AsyncScheduler):
 					except (KeyError, CacheError):
 						pass
 
+		portdb.flush_cache()
 		return self.returncode
 
 	def _task_exit(self, metadata_process):

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index d6e8100..1629d92 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1968,6 +1968,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 		print()
 		signal.signal(signal.SIGWINCH, signal.SIG_DFL)
 
+	portdb.flush_cache()
 	sys.stdout.flush()
 	os.umask(old_umask)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-08 20:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-08 20:48 UTC (permalink / raw
  To: gentoo-commits

commit:     8ee7bafff1c81d129f1a4392b4df7c5ded05c1bc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  8 20:45:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  8 20:45:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8ee7baff

emerge_main: hold large objects in emerge_config

This allows emerge_main to avoid having direct local references to
large local objects (like "settings" and "trees"), making it easier to
ensure that stale objects can be garbage collected when other functions
refresh the config with calls to load_emerge_config(). This will be
much more flexible than the "gc_locals" approach that was introduce in
commit e9fd283aedf54e2effc73f4157524fe9a26993c0.

---
 pym/_emerge/actions.py | 61 ++++++++++++++++++++++++++++++++++++--------------
 pym/_emerge/main.py    | 13 ++++++-----
 2 files changed, 51 insertions(+), 23 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 1629d92..c7139d4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -55,6 +55,7 @@ from portage._sets.base import InternalPackageSet
 from portage.util import cmp_sort_key, writemsg, varexpand, \
 	writemsg_level, writemsg_stdout
 from portage.util.digraph import digraph
+from portage.util.SlotObject import SlotObject
 from portage.util._async.run_main_scheduler import run_main_scheduler
 from portage.util._async.SchedulerInterface import SchedulerInterface
 from portage.util._eventloop.global_event_loop import global_event_loop
@@ -3128,25 +3129,49 @@ def git_sync_timestamps(portdb, portdir):
 
 	return os.EX_OK
 
-def load_emerge_config(trees=None):
+class _emerge_config(SlotObject):
+
+	__slots__ = ('action', 'args', 'mtimedb', 'opts', 'settings', 'trees')
+
+	# Support unpack as tuple, for load_emerge_config backward compatibility.
+	def __getitem__(self, index):
+		if index == 0:
+			return self.settings
+		elif index == 1:
+			return self.trees
+		elif index == 2:
+			return self.mtimedb
+		raise IndexError(index)
+
+	def __len__(self):
+		return 3
+
+def load_emerge_config(emerge_config=None, **kargs):
+
+	if emerge_config is None:
+		emerge_config = _emerge_config(**kargs)
+
 	kwargs = {}
 	for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")):
 		v = os.environ.get(envvar, None)
 		if v and v.strip():
 			kwargs[k] = v
-	trees = portage.create_trees(trees=trees, **portage._native_kwargs(kwargs))
+	emerge_config.trees = portage.create_trees(trees=emerge_config.trees,
+				**portage._native_kwargs(kwargs))
 
-	for root_trees in trees.values():
+	for root_trees in emerge_config.trees.values():
 		settings = root_trees["vartree"].settings
 		settings._init_dirs()
 		setconfig = load_default_config(settings, root_trees)
 		root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
 
-	settings = trees[trees._target_eroot]['vartree'].settings
-	mtimedbfile = os.path.join(settings['EROOT'], portage.CACHE_PATH, "mtimedb")
-	mtimedb = portage.MtimeDB(mtimedbfile)
-	QueryCommand._db = trees
-	return settings, trees, mtimedb
+	target_eroot = emerge_config.trees._target_eroot
+	emerge_config.settings = emerge_config.trees[target_eroot]['vartree'].settings
+	emerge_config.mtimedb = portage.MtimeDB(
+		os.path.join(target_eroot, portage.CACHE_PATH, "mtimedb"))
+	QueryCommand._db = emerge_config.trees
+
+	return emerge_config
 
 def getgccversion(chost):
 	"""
@@ -3506,14 +3531,14 @@ def repo_name_duplicate_check(trees):
 
 	return bool(ignored_repos)
 
-def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
-	gc_locals=None):
+def run_action(emerge_config):
 
-	# The caller may have its local variables garbage collected, so
-	# they don't consume any memory during this long-running function.
-	if gc_locals is not None:
-		gc_locals()
-		gc_locals = None
+	myaction = emerge_config.action
+	myfiles = emerge_config.args
+	mtimedb = emerge_config.mtimedb
+	myopts = emerge_config.opts
+	settings = emerge_config.settings
+	trees = emerge_config.trees
 
 	# skip global updates prior to sync, since it's called after sync
 	if myaction not in ('help', 'info', 'sync', 'version') and \
@@ -3521,7 +3546,8 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 		_global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
 		mtimedb.commit()
 		# Reload the whole config from scratch.
-		settings, trees, mtimedb = load_emerge_config(trees=trees)
+		settings, trees, mtimedb = \
+			load_emerge_config(emerge_config=emerge_config)
 
 	xterm_titles = "notitles" not in settings.features
 	if xterm_titles:
@@ -3531,7 +3557,8 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 		os.environ["FEATURES"] = os.environ.get("FEATURES","") + " digest"
 		# Reload the whole config from scratch so that the portdbapi internal
 		# config is updated with new FEATURES.
-		settings, trees, mtimedb = load_emerge_config(trees=trees)
+		settings, trees, mtimedb = \
+			load_emerge_config(emerge_config=emerge_config)
 
 	# NOTE: adjust_configs() can map options to FEATURES, so any relevant
 	# options adjustments should be made prior to calling adjust_configs().

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index e066c87..4b9af7c 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1041,17 +1041,18 @@ def emerge_main(args=None):
 	os.umask(0o22)
 	if myaction == "sync":
 		portage._sync_disabled_warnings = True
-	settings, trees, mtimedb = load_emerge_config()
-	rval = profile_check(trees, myaction)
+	emerge_config = load_emerge_config(
+		action=myaction, args=myfiles, opts=myopts)
+	rval = profile_check(emerge_config.trees, emerge_config.action)
 	if rval != os.EX_OK:
 		return rval
 
 	tmpcmdline = []
 	if "--ignore-default-opts" not in myopts:
 		tmpcmdline.extend(portage.util.shlex_split(
-			settings.get("EMERGE_DEFAULT_OPTS", "")))
+			emerge_config.settings.get("EMERGE_DEFAULT_OPTS", "")))
 	tmpcmdline.extend(args)
-	myaction, myopts, myfiles = parse_opts(tmpcmdline)
+	emerge_config.action, emerge_config.opts, emerge_config.args = \
+		parse_opts(tmpcmdline)
 
-	return run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
-		gc_locals=locals().clear)
+	return run_action(emerge_config)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-09  1:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-09  1:17 UTC (permalink / raw
  To: gentoo-commits

commit:     55101e694525c823c23a787547b7fa982b2c8456
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  9 01:17:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun  9 01:17:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=55101e69

emerge_main: call portdbapi destructors

---
 pym/_emerge/main.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 4b9af7c..689d136 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1055,4 +1055,11 @@ def emerge_main(args=None):
 	emerge_config.action, emerge_config.opts, emerge_config.args = \
 		parse_opts(tmpcmdline)
 
-	return run_action(emerge_config)
+	try:
+		return run_action(emerge_config)
+	finally:
+		# Call destructors for our portdbapi instances.
+		for x in emerge_config.trees.values():
+			if "porttree" in x.lazy_items:
+				continue
+			x["porttree"].dbapi.close_caches()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-10  3:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-10  3:50 UTC (permalink / raw
  To: gentoo-commits

commit:     9ec23b6212ed3b930c1bb5133740de5c15c5b978
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 03:50:16 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 03:50:16 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ec23b62

_emerge_config: implement __iter__

---
 pym/_emerge/actions.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c7139d4..2ee2a5b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3134,6 +3134,11 @@ class _emerge_config(SlotObject):
 	__slots__ = ('action', 'args', 'mtimedb', 'opts', 'settings', 'trees')
 
 	# Support unpack as tuple, for load_emerge_config backward compatibility.
+	def __iter__(self):
+		yield self.settings
+		yield self.trees
+		yield self.mtimedb
+
 	def __getitem__(self, index):
 		if index == 0:
 			return self.settings


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-10  4:01 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-10  4:01 UTC (permalink / raw
  To: gentoo-commits

commit:     95ca465d2a0b30488efea0b0f76ad6191f96e25c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 04:01:26 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 04:01:26 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=95ca465d

_emerge_config: simplify __getitem__

---
 pym/_emerge/actions.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 2ee2a5b..767a614 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3140,13 +3140,7 @@ class _emerge_config(SlotObject):
 		yield self.mtimedb
 
 	def __getitem__(self, index):
-		if index == 0:
-			return self.settings
-		elif index == 1:
-			return self.trees
-		elif index == 2:
-			return self.mtimedb
-		raise IndexError(index)
+		return list(self)[index]
 
 	def __len__(self):
 		return 3


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-13 18:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-13 18:54 UTC (permalink / raw
  To: gentoo-commits

commit:     26a165565aac75dd3247579909ce86bdd2cd1c09
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 18:53:57 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 18:53:57 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=26a16556

emerge --autounmask-write: chk_updated_cfg_files

Instead of suggesting to call dispatch-conf, call chk_updated_cfg_files
in order to display a config update message when appropriate.

---
 pym/_emerge/depgraph.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3e29508..4005584 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -50,6 +50,7 @@ from _emerge.AtomArg import AtomArg
 from _emerge.Blocker import Blocker
 from _emerge.BlockerCache import BlockerCache
 from _emerge.BlockerDepPriority import BlockerDepPriority
+from .chk_updated_cfg_files import chk_updated_cfg_files
 from _emerge.countdown import countdown
 from _emerge.create_world_atom import create_world_atom
 from _emerge.Dependency import Dependency
@@ -7119,8 +7120,11 @@ class depgraph(object):
 				noiselevel=-1)
 			writemsg("".join(problems), noiselevel=-1)
 		elif write_to_file and roots:
-			writemsg("\nAutounmask changes successfully written. Remember to run dispatch-conf.\n", \
+			writemsg("\nAutounmask changes successfully written.\n",
 				noiselevel=-1)
+			for root in roots:
+				chk_updated_cfg_files(root,
+					[os.path.join(os.sep, USER_CONFIG_PATH)])
 		elif not pretend and not autounmask_write and roots:
 			writemsg("\nUse --autounmask-write to write changes to config files (honoring\n"
 				"CONFIG_PROTECT). Carefully examine the list of proposed changes,\n"


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-15  0:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-15  0:12 UTC (permalink / raw
  To: gentoo-commits

commit:     fe107452a9a9f3a76aa729ec3e52b26a84c65b50
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 15 00:11:50 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 15 00:11:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe107452

Show unevaluated atom in blocker parent display.

---
 pym/_emerge/depgraph.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4005584..c988ee6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6734,7 +6734,14 @@ class depgraph(object):
 					else:
 						# Display the specific atom from SetArg or
 						# Package types.
-						msg.append("%s required by %s" % (atom, parent))
+						if atom != atom.unevaluated_atom:
+							# Show the unevaluated atom, since it can reveal
+							# issues with conditional use-flags missing
+							# from IUSE.
+							msg.append("%s (%s) required by %s" %
+								(atom.unevaluated_atom, atom, parent))
+						else:
+							msg.append("%s required by %s" % (atom, parent))
 					msg.append("\n")
 
 				msg.append("\n")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-15 23:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-15 23:33 UTC (permalink / raw
  To: gentoo-commits

commit:     7cc7bf61103044501a89509ae1ade77b6035a272
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 15 23:33:36 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 15 23:33:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7cc7bf61

run_action: use emerge_config attrs, not locals

---
 pym/_emerge/RootConfig.py |   4 +-
 pym/_emerge/actions.py    | 344 +++++++++++++++++++++++++---------------------
 pym/_emerge/main.py       |   3 +-
 3 files changed, 189 insertions(+), 162 deletions(-)

diff --git a/pym/_emerge/RootConfig.py b/pym/_emerge/RootConfig.py
index bb0d768..1348570 100644
--- a/pym/_emerge/RootConfig.py
+++ b/pym/_emerge/RootConfig.py
@@ -1,10 +1,10 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 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")
+	__slots__ = ("mtimedb", "root", "setconfig", "sets", "settings", "trees")
 
 	pkg_tree_map = {
 		"ebuild"    : "porttree",

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 767a614..fd8c0b4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3131,13 +3131,14 @@ def git_sync_timestamps(portdb, portdir):
 
 class _emerge_config(SlotObject):
 
-	__slots__ = ('action', 'args', 'mtimedb', 'opts', 'settings', 'trees')
+	__slots__ = ('action', 'args', 'opts',
+		'running_config', 'target_config', 'trees')
 
 	# Support unpack as tuple, for load_emerge_config backward compatibility.
 	def __iter__(self):
-		yield self.settings
+		yield self.target_config.settings
 		yield self.trees
-		yield self.mtimedb
+		yield self.target_config.mtimedb
 
 	def __getitem__(self, index):
 		return list(self)[index]
@@ -3165,9 +3166,12 @@ def load_emerge_config(emerge_config=None, **kargs):
 		root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
 
 	target_eroot = emerge_config.trees._target_eroot
-	emerge_config.settings = emerge_config.trees[target_eroot]['vartree'].settings
-	emerge_config.mtimedb = portage.MtimeDB(
+	emerge_config.target_config = \
+		emerge_config.trees[target_eroot]['root_config']
+	emerge_config.target_config.mtimedb = portage.MtimeDB(
 		os.path.join(target_eroot, portage.CACHE_PATH, "mtimedb"))
+	emerge_config.running_config = emerge_config.trees[
+		emerge_config.trees._running_eroot]['root_config']
 	QueryCommand._db = emerge_config.trees
 
 	return emerge_config
@@ -3532,204 +3536,211 @@ def repo_name_duplicate_check(trees):
 
 def run_action(emerge_config):
 
-	myaction = emerge_config.action
-	myfiles = emerge_config.args
-	mtimedb = emerge_config.mtimedb
-	myopts = emerge_config.opts
-	settings = emerge_config.settings
-	trees = emerge_config.trees
-
 	# skip global updates prior to sync, since it's called after sync
-	if myaction not in ('help', 'info', 'sync', 'version') and \
-		myopts.get('--package-moves') != 'n' and \
-		_global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
-		mtimedb.commit()
+	if emerge_config.action not in ('help', 'info', 'sync', 'version') and \
+		emerge_config.opts.get('--package-moves') != 'n' and \
+		_global_updates(emerge_config.trees,
+		emerge_config.target_config.mtimedb["updates"],
+		quiet=("--quiet" in emerge_config.opts)):
+		emerge_config.target_config.mtimedb.commit()
 		# Reload the whole config from scratch.
-		settings, trees, mtimedb = \
-			load_emerge_config(emerge_config=emerge_config)
+		load_emerge_config(emerge_config=emerge_config)
 
-	xterm_titles = "notitles" not in settings.features
+	xterm_titles = "notitles" not in \
+		emerge_config.target_config.settings.features
 	if xterm_titles:
 		xtermTitle("emerge")
 
-	if "--digest" in myopts:
+	if "--digest" in emerge_config.opts:
 		os.environ["FEATURES"] = os.environ.get("FEATURES","") + " digest"
 		# Reload the whole config from scratch so that the portdbapi internal
 		# config is updated with new FEATURES.
-		settings, trees, mtimedb = \
-			load_emerge_config(emerge_config=emerge_config)
+		load_emerge_config(emerge_config=emerge_config)
 
 	# NOTE: adjust_configs() can map options to FEATURES, so any relevant
 	# options adjustments should be made prior to calling adjust_configs().
-	if "--buildpkgonly" in myopts:
-		myopts["--buildpkg"] = True
+	if "--buildpkgonly" in emerge_config.opts:
+		emerge_config.opts["--buildpkg"] = True
 
-	if "getbinpkg" in settings.features:
-		myopts["--getbinpkg"] = True
+	if "getbinpkg" in emerge_config.target_config.settings.features:
+		emerge_config.opts["--getbinpkg"] = True
 
-	if "--getbinpkgonly" in myopts:
-		myopts["--getbinpkg"] = True
+	if "--getbinpkgonly" in emerge_config.opts:
+		emerge_config.opts["--getbinpkg"] = True
 
-	if "--getbinpkgonly" in myopts:
-		myopts["--usepkgonly"] = True
+	if "--getbinpkgonly" in emerge_config.opts:
+		emerge_config.opts["--usepkgonly"] = True
 
-	if "--getbinpkg" in myopts:
-		myopts["--usepkg"] = True
+	if "--getbinpkg" in emerge_config.opts:
+		emerge_config.opts["--usepkg"] = True
 
-	if "--usepkgonly" in myopts:
-		myopts["--usepkg"] = True
+	if "--usepkgonly" in emerge_config.opts:
+		emerge_config.opts["--usepkg"] = True
 
-	if "--buildpkgonly" in myopts:
+	if "--buildpkgonly" in emerge_config.opts:
 		# --buildpkgonly will not merge anything, so
 		# it cancels all binary package options.
 		for opt in ("--getbinpkg", "--getbinpkgonly",
 			"--usepkg", "--usepkgonly"):
-			myopts.pop(opt, None)
+			emerge_config.opts.pop(opt, None)
 
-	adjust_configs(myopts, trees)
-	apply_priorities(settings)
+	adjust_configs(emerge_config.opts, emerge_config.trees)
+	apply_priorities(emerge_config.target_config.settings)
 
-	if myaction == 'version':
+	if emerge_config.action == 'version':
 		writemsg_stdout(getportageversion(
-			settings["PORTDIR"], None,
-			settings.profile_path, settings["CHOST"],
-			trees[settings['EROOT']]['vartree'].dbapi) + '\n', noiselevel=-1)
+			emerge_config.target_config.settings["PORTDIR"],
+			None,
+			emerge_config.target_config.settings.profile_path,
+			emerge_config.target_config.settings["CHOST"],
+			emerge_config.target_config.trees['vartree'].dbapi) + '\n',
+			noiselevel=-1)
 		return 0
-	elif myaction == 'help':
+	elif emerge_config.action == 'help':
 		emerge_help()
 		return 0
 
 	spinner = stdout_spinner()
-	if "candy" in settings.features:
+	if "candy" in emerge_config.target_config.settings.features:
 		spinner.update = spinner.update_scroll
 
-	if "--quiet" not in myopts:
-		portage.deprecated_profile_check(settings=settings)
+	if "--quiet" not in emerge_config.opts:
+		portage.deprecated_profile_check(
+			settings=emerge_config.target_config.settings)
 		if portage.const._ENABLE_REPO_NAME_WARN:
 			# Bug #248603 - Disable warnings about missing
 			# repo_name entries for stable branch.
-			repo_name_check(trees)
-		repo_name_duplicate_check(trees)
-		config_protect_check(trees)
+			repo_name_check(emerge_config.trees)
+		repo_name_duplicate_check(emerge_config.trees)
+		config_protect_check(emerge_config.trees)
 	check_procfs()
 
-	for mytrees in trees.values():
+	for mytrees in emerge_config.trees.values():
 		mydb = mytrees["porttree"].dbapi
 		# Freeze the portdbapi for performance (memoize all xmatch results).
 		mydb.freeze()
 
-		if myaction in ('search', None) and \
-			"--usepkg" in myopts:
+		if emerge_config.action in ('search', None) and \
+			"--usepkg" in emerge_config.opts:
 			# Populate the bintree with current --getbinpkg setting.
 			# This needs to happen before expand_set_arguments(), in case
 			# any sets use the bintree.
 			mytrees["bintree"].populate(
-				getbinpkgs="--getbinpkg" in myopts)
+				getbinpkgs="--getbinpkg" in emerge_config.opts)
 
 	del mytrees, mydb
 
-	for x in myfiles:
+	for x in emerge_config.args:
 		if x.endswith((".ebuild", ".tbz2")) and \
 			os.path.exists(os.path.abspath(x)):
 			print(colorize("BAD", "\n*** emerging by path is broken "
 				"and may not always work!!!\n"))
 			break
 
-	root_config = trees[settings['EROOT']]['root_config']
-
-	if myaction == "list-sets":
-		writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
+	if emerge_config.action == "list-sets":
+		writemsg_stdout("".join("%s\n" % s for s in
+			sorted(emerge_config.target_config.sets)))
 		return os.EX_OK
-	elif myaction == "check-news":
+	elif emerge_config.action == "check-news":
 		news_counts = count_unread_news(
-			root_config.trees["porttree"].dbapi,
-			root_config.trees["vartree"].dbapi)
+			emerge_config.target_config.trees["porttree"].dbapi,
+			emerge_config.target_config.trees["vartree"].dbapi)
 		if any(news_counts.values()):
 			display_news_notifications(news_counts)
-		elif "--quiet" not in myopts:
+		elif "--quiet" not in emerge_config.opts:
 			print("", colorize("GOOD", "*"), "No news items were found.")
 		return os.EX_OK
 
-	ensure_required_sets(trees)
+	ensure_required_sets(emerge_config.trees)
 
 	# only expand sets for actions taking package arguments
-	oldargs = myfiles[:]
-	if myaction in ("clean", "config", "depclean",
+	oldargs = emerge_config.args[:]
+	if emerge_config.action in ("clean", "config", "depclean",
 		"info", "prune", "unmerge", None):
-		myfiles, retval = expand_set_arguments(myfiles, myaction, root_config)
+		newargs, retval = expand_set_arguments(
+			emerge_config.args, emerge_config.action,
+			emerge_config.target_config)
 		if retval != os.EX_OK:
 			return retval
 
 		# Need to handle empty sets specially, otherwise emerge will react 
 		# with the help message for empty argument lists
-		if oldargs and not myfiles:
+		if oldargs and not newargs:
 			print("emerge: no targets left after set expansion")
 			return 0
 
-	if ("--tree" in myopts) and ("--columns" in myopts):
+		emerge_config.args = newargs
+
+	if "--tree" in emerge_config.opts and \
+		"--columns" in emerge_config.opts:
 		print("emerge: can't specify both of \"--tree\" and \"--columns\".")
 		return 1
 
-	if '--emptytree' in myopts and '--noreplace' in myopts:
+	if '--emptytree' in emerge_config.opts and \
+		'--noreplace' in emerge_config.opts:
 		writemsg_level("emerge: can't specify both of " + \
 			"\"--emptytree\" and \"--noreplace\".\n",
 			level=logging.ERROR, noiselevel=-1)
 		return 1
 
-	if ("--quiet" in myopts):
+	if ("--quiet" in emerge_config.opts):
 		spinner.update = spinner.update_quiet
 		portage.util.noiselimit = -1
 
-	if "--fetch-all-uri" in myopts:
-		myopts["--fetchonly"] = True
+	if "--fetch-all-uri" in emerge_config.opts:
+		emerge_config.opts["--fetchonly"] = True
 
-	if "--skipfirst" in myopts and "--resume" not in myopts:
-		myopts["--resume"] = True
+	if "--skipfirst" in emerge_config.opts and \
+		"--resume" not in emerge_config.opts:
+		emerge_config.opts["--resume"] = True
 
 	# Allow -p to remove --ask
-	if "--pretend" in myopts:
-		myopts.pop("--ask", None)
+	if "--pretend" in emerge_config.opts:
+		emerge_config.opts.pop("--ask", None)
 
 	# forbid --ask when not in a terminal
 	# note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway.
-	if ("--ask" in myopts) and (not sys.stdin.isatty()):
+	if ("--ask" in emerge_config.opts) and (not sys.stdin.isatty()):
 		portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n",
 			noiselevel=-1)
 		return 1
 
-	if settings.get("PORTAGE_DEBUG", "") == "1":
+	if emerge_config.target_config.settings.get("PORTAGE_DEBUG", "") == "1":
 		spinner.update = spinner.update_quiet
 		portage.util.noiselimit = 0
-		if "python-trace" in settings.features:
+		if "python-trace" in emerge_config.target_config.settings.features:
 			portage.debug.set_trace(True)
 
-	if not ("--quiet" in myopts):
-		if '--nospinner' in myopts or \
-			settings.get('TERM') == 'dumb' or \
+	if not ("--quiet" in emerge_config.opts):
+		if '--nospinner' in emerge_config.opts or \
+			emerge_config.target_config.settings.get('TERM') == 'dumb' or \
 			not sys.stdout.isatty():
 			spinner.update = spinner.update_basic
 
-	if "--debug" in myopts:
-		print("myaction", myaction)
-		print("myopts", myopts)
+	if "--debug" in emerge_config.opts:
+		print("myaction", emerge_config.action)
+		print("myopts", emerge_config.opts)
 
-	if not myaction and not myfiles and "--resume" not in myopts:
+	if not emerge_config.action and not emerge_config.args and \
+		"--resume" not in emerge_config.opts:
 		emerge_help()
 		return 1
 
-	pretend = "--pretend" in myopts
-	fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
-	buildpkgonly = "--buildpkgonly" in myopts
+	pretend = "--pretend" in emerge_config.opts
+	fetchonly = "--fetchonly" in emerge_config.opts or \
+		"--fetch-all-uri" in emerge_config.opts
+	buildpkgonly = "--buildpkgonly" in emerge_config.opts
 
 	# check if root user is the current user for the actions where emerge needs this
 	if portage.data.secpass < 2:
 		# We've already allowed "--version" and "--help" above.
-		if "--pretend" not in myopts and myaction not in ("search","info"):
-			need_superuser = myaction in ('clean', 'depclean', 'deselect',
-				'prune', 'unmerge') or not \
+		if "--pretend" not in emerge_config.opts and \
+			emerge_config.action not in ("search", "info"):
+			need_superuser = emerge_config.action in ('clean', 'depclean',
+				'deselect', 'prune', 'unmerge') or not \
 				(fetchonly or \
 				(buildpkgonly and portage.data.secpass >= 1) or \
-				myaction in ("metadata", "regen", "sync"))
+				emerge_config.action in ("metadata", "regen", "sync"))
 			if portage.data.secpass < 1 or \
 				need_superuser:
 				if need_superuser:
@@ -3738,16 +3749,16 @@ def run_action(emerge_config):
 					access_desc = "portage group"
 				# Always show portage_group_warning() when only portage group
 				# access is required but the user is not in the portage group.
-				if "--ask" in myopts:
+				if "--ask" in emerge_config.opts:
 					writemsg_stdout("This action requires %s access...\n" % \
 						(access_desc,), noiselevel=-1)
 					if portage.data.secpass < 1 and not need_superuser:
 						portage.data.portage_group_warning()
 					if userquery("Would you like to add --pretend to options?",
-						"--ask-enter-invalid" in myopts) == "No":
+						"--ask-enter-invalid" in emerge_config.opts) == "No":
 						return 128 + signal.SIGINT
-					myopts["--pretend"] = True
-					myopts.pop("--ask")
+					emerge_config.opts["--pretend"] = True
+					emerge_config.opts.pop("--ask")
 				else:
 					sys.stderr.write(("emerge: %s access is required\n") \
 						% access_desc)
@@ -3760,12 +3771,12 @@ def run_action(emerge_config):
 	# parsers like genlop.
 	disable_emergelog = False
 	for x in ("--pretend", "--fetchonly", "--fetch-all-uri"):
-		if x in myopts:
+		if x in emerge_config.opts:
 			disable_emergelog = True
 			break
 	if disable_emergelog:
 		pass
-	elif myaction in ("search", "info"):
+	elif emerge_config.action in ("search", "info"):
 		disable_emergelog = True
 	elif portage.data.secpass < 1:
 		disable_emergelog = True
@@ -3774,24 +3785,27 @@ def run_action(emerge_config):
 	_emerge.emergelog._disable = disable_emergelog
 
 	if not disable_emergelog:
-		if 'EMERGE_LOG_DIR' in settings:
+		emerge_log_dir = \
+			emerge_config.target_config.settings.get('EMERGE_LOG_DIR')
+		if emerge_log_dir:
 			try:
 				# At least the parent needs to exist for the lock file.
-				portage.util.ensure_dirs(settings['EMERGE_LOG_DIR'])
+				portage.util.ensure_dirs(emerge_log_dir)
 			except portage.exception.PortageException as e:
 				writemsg_level("!!! Error creating directory for " + \
 					"EMERGE_LOG_DIR='%s':\n!!! %s\n" % \
-					(settings['EMERGE_LOG_DIR'], e),
+					(emerge_log_dir, e),
 					noiselevel=-1, level=logging.ERROR)
 				portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
 			else:
-				_emerge.emergelog._emerge_log_dir = settings["EMERGE_LOG_DIR"]
+				_emerge.emergelog._emerge_log_dir = emerge_log_dir
 		else:
 			_emerge.emergelog._emerge_log_dir = os.path.join(os.sep,
-				settings["EPREFIX"].lstrip(os.sep), "var", "log")
+				emerge_config.target_config.settings["EPREFIX"].lstrip(os.sep),
+				"var", "log")
 			portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
 
-	if not "--pretend" in myopts:
+	if not "--pretend" in emerge_config.opts:
 		time_fmt = "%b %d, %Y %H:%M:%S"
 		if sys.hexversion < 0x3000000:
 			time_fmt = portage._unicode_encode(time_fmt)
@@ -3802,9 +3816,9 @@ def run_action(emerge_config):
 			encoding=_encodings['content'], errors='replace')
 		emergelog(xterm_titles, "Started emerge on: %s" % time_str)
 		myelogstr=""
-		if myopts:
+		if emerge_config.opts:
 			opt_list = []
-			for opt, arg in myopts.items():
+			for opt, arg in emerge_config.opts.items():
 				if arg is True:
 					opt_list.append(opt)
 				elif isinstance(arg, list):
@@ -3814,9 +3828,9 @@ def run_action(emerge_config):
 				else:
 					opt_list.append("%s=%s" % (opt, arg))
 			myelogstr=" ".join(opt_list)
-		if myaction:
-			myelogstr += " --" + myaction
-		if myfiles:
+		if emerge_config.action:
+			myelogstr += " --" + emerge_config.action
+		if oldargs:
 			myelogstr += " " + " ".join(oldargs)
 		emergelog(xterm_titles, " *** emerge " + myelogstr)
 
@@ -3832,71 +3846,78 @@ def run_action(emerge_config):
 
 	def emergeexit():
 		"""This gets out final log message in before we quit."""
-		if "--pretend" not in myopts:
+		if "--pretend" not in emerge_config.opts:
 			emergelog(xterm_titles, " *** terminating.")
 		if xterm_titles:
 			xtermTitleReset()
 	portage.atexit_register(emergeexit)
 
-	if myaction in ("config", "metadata", "regen", "sync"):
-		if "--pretend" in myopts:
+	if emerge_config.action in ("config", "metadata", "regen", "sync"):
+		if "--pretend" in emerge_config.opts:
 			sys.stderr.write(("emerge: The '%s' action does " + \
-				"not support '--pretend'.\n") % myaction)
+				"not support '--pretend'.\n") % emerge_config.action)
 			return 1
 
-	if "sync" == myaction:
-		return action_sync(settings, trees, mtimedb, myopts, myaction)
-	elif "metadata" == myaction:
-		action_metadata(settings,
-			trees[settings['EROOT']]['porttree'].dbapi, myopts)
-	elif myaction=="regen":
-		validate_ebuild_environment(trees)
-		return action_regen(settings,
-			trees[settings['EROOT']]['porttree'].dbapi, myopts.get("--jobs"),
-			myopts.get("--load-average"))
+	if "sync" == emerge_config.action:
+		return action_sync(emerge_config.target_config.settings,
+			emerge_config.trees, emerge_config.target_config.mtimedb,
+			emerge_config.opts, emerge_config.action)
+	elif "metadata" == emerge_config.action:
+		action_metadata(emerge_config.target_config.settings,
+			emerge_config.target_config.trees['porttree'].dbapi,
+			emerge_config.opts)
+	elif emerge_config.action=="regen":
+		validate_ebuild_environment(emerge_config.trees)
+		return action_regen(emerge_config.target_config.settings,
+			emerge_config.target_config.trees['porttree'].dbapi,
+			emerge_config.opts.get("--jobs"),
+			emerge_config.opts.get("--load-average"))
 	# HELP action
-	elif "config"==myaction:
-		validate_ebuild_environment(trees)
-		action_config(settings, trees, myopts, myfiles)
+	elif "config" == emerge_config.action:
+		validate_ebuild_environment(emerge_config.trees)
+		action_config(emerge_config.target_config.settings,
+			emerge_config.trees, emerge_config.opts, emerge_config.args)
 
 	# SEARCH action
-	elif "search"==myaction:
-		validate_ebuild_environment(trees)
-		action_search(trees[settings['EROOT']]['root_config'],
-			myopts, myfiles, spinner)
-
-	elif myaction in ('clean', 'depclean', 'deselect', 'prune', 'unmerge'):
-		validate_ebuild_environment(trees)
-		rval = action_uninstall(settings, trees, mtimedb["ldpath"],
-			myopts, myaction, myfiles, spinner)
-		if not (myaction == 'deselect' or
+	elif "search" == emerge_config.action:
+		validate_ebuild_environment(emerge_config.trees)
+		action_search(emerge_config.target_config,
+			emerge_config.opts, emerge_config.args, spinner)
+
+	elif emerge_config.action in \
+		('clean', 'depclean', 'deselect', 'prune', 'unmerge'):
+		validate_ebuild_environment(emerge_config.trees)
+		rval = action_uninstall(emerge_config.target_config.settings,
+			emerge_config.trees, emerge_config.target_config.mtimedb["ldpath"],
+			emerge_config.opts, emerge_config.action,
+			emerge_config.args, spinner)
+		if not (emerge_config.action == 'deselect' or
 			buildpkgonly or fetchonly or pretend):
-			post_emerge(myaction, myopts, myfiles, settings['EROOT'],
-				trees, mtimedb, rval)
+			post_emerge(emerge_config.action, emerge_config.opts,
+				emerge_config.args, emerge_config.target_config.root,
+				emerge_config.trees, emerge_config.target_config.mtimedb, rval)
 		return rval
 
-	elif myaction == 'info':
+	elif emerge_config.action == 'info':
 
 		# Ensure atoms are valid before calling unmerge().
-		vardb = trees[settings['EROOT']]['vartree'].dbapi
-		portdb = trees[settings['EROOT']]['porttree'].dbapi
-		bindb = trees[settings['EROOT']]["bintree"].dbapi
+		vardb = emerge_config.target_config.trees['vartree'].dbapi
+		portdb = emerge_config.target_config.trees['porttree'].dbapi
+		bindb = emerge_config.target_config.trees['bintree'].dbapi
 		valid_atoms = []
-		for x in myfiles:
+		for x in emerge_config.args:
 			if is_valid_package_atom(x, allow_repo=True):
 				try:
 					#look at the installed files first, if there is no match
 					#look at the ebuilds, since EAPI 4 allows running pkg_info
 					#on non-installed packages
-					valid_atom = dep_expand(x, mydb=vardb, settings=settings)
+					valid_atom = dep_expand(x, mydb=vardb)
 					if valid_atom.cp.split("/")[0] == "null":
-						valid_atom = dep_expand(x,
-							mydb=portdb, settings=settings)
+						valid_atom = dep_expand(x, mydb=portdb)
 
 					if valid_atom.cp.split("/")[0] == "null" and \
-						"--usepkg" in myopts:
-						valid_atom = dep_expand(x,
-							mydb=bindb, settings=settings)
+						"--usepkg" in emerge_config.opts:
+						valid_atom = dep_expand(x, mydb=bindb)
 
 					valid_atoms.append(valid_atom)
 
@@ -3921,13 +3942,14 @@ def run_action(emerge_config):
 				level=logging.ERROR, noiselevel=-1)
 			return 1
 
-		return action_info(settings, trees, myopts, valid_atoms)
+		return action_info(emerge_config.target_config.settings,
+			emerge_config.trees, emerge_config.opts, valid_atoms)
 
 	# "update", "system", or just process files:
 	else:
-		validate_ebuild_environment(trees)
+		validate_ebuild_environment(emerge_config.trees)
 
-		for x in myfiles:
+		for x in emerge_config.args:
 			if x.startswith(SETPREFIX) or \
 				is_valid_package_atom(x, allow_repo=True):
 				continue
@@ -3946,11 +3968,15 @@ def run_action(emerge_config):
 			return 1
 
 		# GLEP 42 says to display news *after* an emerge --pretend
-		if "--pretend" not in myopts:
-			display_news_notification(root_config, myopts)
-		retval = action_build(settings, trees, mtimedb,
-			myopts, myaction, myfiles, spinner)
-		post_emerge(myaction, myopts, myfiles, settings['EROOT'],
-			trees, mtimedb, retval)
+		if "--pretend" not in emerge_config.opts:
+			display_news_notification(
+				emerge_config.target_config, emerge_config.opts)
+		retval = action_build(emerge_config.target_config.settings,
+			emerge_config.trees, emerge_config.target_config.mtimedb,
+			emerge_config.opts, emerge_config.action,
+			emerge_config.args, spinner)
+		post_emerge(emerge_config.action, emerge_config.opts,
+			emerge_config.args, emerge_config.target_config.root,
+			emerge_config.trees, emerge_config.target_config.mtimedb, retval)
 
 		return retval

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 689d136..fdbd4f9 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1050,7 +1050,8 @@ def emerge_main(args=None):
 	tmpcmdline = []
 	if "--ignore-default-opts" not in myopts:
 		tmpcmdline.extend(portage.util.shlex_split(
-			emerge_config.settings.get("EMERGE_DEFAULT_OPTS", "")))
+			emerge_config.target_config.settings.get(
+			"EMERGE_DEFAULT_OPTS", "")))
 	tmpcmdline.extend(args)
 	emerge_config.action, emerge_config.opts, emerge_config.args = \
 		parse_opts(tmpcmdline)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-16  1:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-16  1:22 UTC (permalink / raw
  To: gentoo-commits

commit:     f4058826bd2928fb9f12b5cac1d225d79e58c993
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 16 01:22:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 01:22:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f4058826

Show blocker parents for non slot-conflict pkgs.

Show parents for packages involved in blocker conflicts but not
directly involved in slot conflicts, since this information may be
helpful for troubleshooting blocker conflicts. This information had
been hidded when there were unrelated simultaneous slot conflicts,
since commit 77b651300731ec007cd535a83b8ee9a898602783.

---
 pym/_emerge/depgraph.py | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index c988ee6..cb7d3d6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6673,10 +6673,18 @@ class depgraph(object):
 		# the reasons are not apparent from the normal merge list
 		# display.
 
+		slot_collision_info = self._dynamic_config._slot_collision_info
+
 		conflict_pkgs = {}
 		for blocker in blockers:
 			for pkg in chain(self._dynamic_config._blocked_pkgs.child_nodes(blocker), \
 				self._dynamic_config._blocker_parents.parent_nodes(blocker)):
+				if (pkg.slot_atom, pkg.root) in slot_collision_info:
+					# The slot conflict display has better noise reduction
+					# than the unsatisfied blockers display, so skip
+					# unsatisfied blockers display for packages involved
+					# directly in slot conflicts (see bug #385391).
+					continue
 				parent_atoms = self._dynamic_config._parent_atoms.get(pkg)
 				if not parent_atoms:
 					atom = self._dynamic_config._blocked_world_pkgs.get(pkg)
@@ -7153,15 +7161,18 @@ class depgraph(object):
 			self._show_circular_deps(
 				self._dynamic_config._circular_deps_for_display)
 
-		# The slot conflict display has better noise reduction than
-		# the unsatisfied blockers display, so skip unsatisfied blockers
-		# display if there are slot conflicts (see bug #385391).
+		unresolved_conflicts = False
 		if self._dynamic_config._slot_collision_info:
+			unresolved_conflicts = True
 			self._show_slot_collision_notice()
-		elif self._dynamic_config._unsatisfied_blockers_for_display is not None:
+		if self._dynamic_config._unsatisfied_blockers_for_display is not None:
+			unresolved_conflicts = True
 			self._show_unsatisfied_blockers(
 				self._dynamic_config._unsatisfied_blockers_for_display)
-		else:
+
+		# Only show missed updates if there are no unresolved conflicts,
+		# since they may be irrelevant after the conflicts are solved.
+		if not unresolved_conflicts:
 			self._show_missed_update()
 
 		self._show_ignored_binaries()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-17  5:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-17  5:59 UTC (permalink / raw
  To: gentoo-commits

commit:     6de6e2dcb9dd4bc115ab34ddcbd08d48504801ff
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 17 05:59:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 05:59:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6de6e2dc

action_build: remove useless --ask autoclean

This autoclean invocation would should have no effect anyway, unless
the vdb happens to be in an inconsistent state due to a previously
interrupted emerge (relatively rare).

---
 pym/_emerge/actions.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index fd8c0b4..6dc384b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -375,8 +375,6 @@ def action_build(settings, trees, mtimedb,
 					not oneshot and world_candidates:
 					# Prompt later, inside saveNomergeFavorites.
 					prompt = None
-				elif settings["AUTOCLEAN"] and "yes"==settings["AUTOCLEAN"]:
-					prompt="Nothing to merge; would you like to auto-clean packages?"
 				else:
 					print()
 					print("Nothing to merge; quitting.")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-18 14:59 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-18 14:59 UTC (permalink / raw
  To: gentoo-commits

commit:     488a1881e51c7cec15e4d07d0e00fc1d543e543a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 14:58:52 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 14:58:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=488a1881

RootConfig: mtimedb AttributeError, bug #473710

---
 pym/_emerge/RootConfig.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/RootConfig.py b/pym/_emerge/RootConfig.py
index 1348570..6b0f8ac 100644
--- a/pym/_emerge/RootConfig.py
+++ b/pym/_emerge/RootConfig.py
@@ -31,4 +31,8 @@ class RootConfig(object):
 		Shallow copy all attributes from another instance.
 		"""
 		for k in self.__slots__:
-			setattr(self, k, getattr(other, k))
+			try:
+				setattr(self, k, getattr(other, k))
+			except AttributeError:
+				# mtimedb is currently not a required attribute
+				pass


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-18 15:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-18 15:48 UTC (permalink / raw
  To: gentoo-commits

commit:     654b4dbb193f6e7e74403764a3c67bce57964288
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 15:48:16 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 15:48:16 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=654b4dbb

RootConfig.update: call delattr when appropriate

---
 pym/_emerge/RootConfig.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/RootConfig.py b/pym/_emerge/RootConfig.py
index 6b0f8ac..3648d01 100644
--- a/pym/_emerge/RootConfig.py
+++ b/pym/_emerge/RootConfig.py
@@ -35,4 +35,7 @@ class RootConfig(object):
 				setattr(self, k, getattr(other, k))
 			except AttributeError:
 				# mtimedb is currently not a required attribute
-				pass
+				try:
+					delattr(self, k)
+				except AttributeError:
+					pass


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-19 20:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-19 20:05 UTC (permalink / raw
  To: gentoo-commits

commit:     ca2e34f3b9615c4f1e1d6d258fa5dab6f6c3d6dd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 20:05:28 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 20:05:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca2e34f3

depgraph: fix --exclude/--newuse interaction

This fixes a case where an installed package could possibly be rejected
due to --newuse, even though it was selected by --exclude. The problem
may have been triggered randomly by differences in graph traversal
order, which may have been affected by hash randomization (enabled by
default since Python 3.3).

---
 pym/_emerge/depgraph.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index cb7d3d6..3c52159 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4915,7 +4915,12 @@ class depgraph(object):
 						break
 					# Compare built package to current config and
 					# reject the built package if necessary.
-					if built and not useoldpkg and (not installed or matched_pkgs_ignore_use) and \
+					if built and not useoldpkg and \
+						(not installed or
+						any(other_pkg != pkg for other_pkg in matched_pkgs_ignore_use)) and \
+						not (installed and
+						self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
+						modified_use=self._pkg_use_enabled(pkg))) and \
 						("--newuse" in self._frozen_config.myopts or \
 						"--reinstall" in self._frozen_config.myopts or \
 						(not installed and self._dynamic_config.myparams.get(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-06-19 21:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-06-19 21:07 UTC (permalink / raw
  To: gentoo-commits

commit:     f74f301e869b3cac9060a1f35b89df673805c08a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 21:07:17 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 21:07:17 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f74f301e

depgraph: fix installed/newuse logic more

The matched_pkgs_ignore_use logic, introduced in commit
dc8d70479dfb54a1f2561ba3fe82d7a62d97964f, is questionable because we
need to ensure that an installed package can be selected if there are
no other available packages that match a given USE-dep.

---
 pym/_emerge/depgraph.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3c52159..b2d79a8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4642,7 +4642,6 @@ class depgraph(object):
 		vardb = self._frozen_config.roots[root].trees["vartree"].dbapi
 		# List of acceptable packages, ordered by type preference.
 		matched_packages = []
-		matched_pkgs_ignore_use = []
 		highest_version = None
 		if not isinstance(atom, portage.dep.Atom):
 			atom = portage.dep.Atom(atom)
@@ -4824,7 +4823,6 @@ class depgraph(object):
 
 					if atom.use:
 
-						matched_pkgs_ignore_use.append(pkg)
 						if autounmask_level and autounmask_level.allow_use_changes and not pkg.built:
 							target_use = {}
 							for flag in atom.use.enabled:
@@ -4916,8 +4914,7 @@ class depgraph(object):
 					# Compare built package to current config and
 					# reject the built package if necessary.
 					if built and not useoldpkg and \
-						(not installed or
-						any(other_pkg != pkg for other_pkg in matched_pkgs_ignore_use)) and \
+						(not installed or matched_packages) and \
 						not (installed and
 						self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
 						modified_use=self._pkg_use_enabled(pkg))) and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-05  5:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-05  5:34 UTC (permalink / raw
  To: gentoo-commits

commit:     541539c8bd89e4ee82ddfa250aa5bc82a0a167d0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  5 05:33:52 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  5 05:33:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=541539c8

emerge --info: KeyError with ROOT, bug #475778

The KeyError was triggered when calling vardbapi.aux_get() on a
vardbapi instance from the wrong ROOT.

---
 pym/_emerge/actions.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c31ad1d..9463be8 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1470,7 +1470,6 @@ def action_info(settings, trees, myopts, myfiles):
 	output_buffer = []
 	append = output_buffer.append
 	root_config = trees[settings['EROOT']]['root_config']
-	running_eroot = trees._running_eroot
 	chost = settings.get("CHOST")
 
 	append(getportageversion(settings["PORTDIR"], None,
@@ -1558,7 +1557,6 @@ def action_info(settings, trees, myopts, myfiles):
 	           "sys-devel/binutils", "sys-devel/libtool",  "dev-lang/python"]
 	myvars += portage.util.grabfile(settings["PORTDIR"]+"/profiles/info_pkgs")
 	atoms = []
-	vardb = trees[running_eroot]['vartree'].dbapi
 	for x in myvars:
 		try:
 			x = Atom(x)
@@ -1571,7 +1569,6 @@ def action_info(settings, trees, myopts, myfiles):
 
 	myvars = sorted(set(atoms))
 
-	portdb = trees[running_eroot]['porttree'].dbapi
 	main_repo = portdb.getRepositoryName(portdb.porttree_root)
 	cp_map = {}
 	cp_max_len = 0


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-06 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-06 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     a4d3e4b3aaec27c49b8e7c8d66102b34f438fd5c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  6 21:52:09 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jul  6 21:52:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a4d3e4b3

_ignore_satisfied_buildtime: tweak optional

---
 pym/_emerge/DepPrioritySatisfiedRange.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/DepPrioritySatisfiedRange.py b/pym/_emerge/DepPrioritySatisfiedRange.py
index e5fdba9..391f540 100644
--- a/pym/_emerge/DepPrioritySatisfiedRange.py
+++ b/pym/_emerge/DepPrioritySatisfiedRange.py
@@ -51,10 +51,11 @@ class DepPrioritySatisfiedRange(object):
 	def _ignore_satisfied_buildtime(cls, priority):
 		if priority.__class__ is not DepPriority:
 			return False
+		if priority.optional:
+			return True
 		if priority.buildtime_slot_op:
 			return False
-		return bool(priority.optional or \
-			priority.satisfied)
+		return bool(priority.satisfied)
 
 	@classmethod
 	def _ignore_satisfied_buildtime_slot_op(cls, priority):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-09 19:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-09 19:22 UTC (permalink / raw
  To: gentoo-commits

commit:     cdba27014ff945deeef145a7a4aa4f15a26fb754
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 19:21:37 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul  9 19:21:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cdba2701

EbuildPhase: fd_pipes NameError, bug #476312

---
 pym/_emerge/EbuildPhase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 51952f6..b1f7c21 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -349,7 +349,7 @@ class EbuildPhase(CompositeTask):
 		portage.elog.elog_process(self.settings.mycpv, self.settings)
 		phase = "clean"
 		clean_phase = EbuildPhase(background=self.background,
-			fd_pipes=fd_pipes, phase=phase, scheduler=self.scheduler,
+			fd_pipes=self.fd_pipes, phase=phase, scheduler=self.scheduler,
 			settings=self.settings)
 		self._start_task(clean_phase, self._fail_clean_exit)
 		return


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-09 20:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-09 20:52 UTC (permalink / raw
  To: gentoo-commits

commit:     ba8b9b3212e75cc8e539617cce9632c0b9bcc03c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 20:52:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul  9 20:52:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ba8b9b32

Delay for loadavg after SIGCONT, bug #476104

---
 pym/_emerge/Scheduler.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 94d3d3f..5cb4128 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -251,6 +251,12 @@ class Scheduler(PollScheduler):
 		self._job_delay_max = 5
 		self._previous_job_start_time = None
 
+		# The load average takes some time to respond when after
+		# a SIGSTOP/SIGCONT cycle, so delay scheduling for some
+		# time after SIGCONT is received.
+		self._sigcont_delay = 5
+		self._sigcont_time = None
+
 		# This is used to memoize the _choose_pkg() result when
 		# no packages can be chosen until one of the existing
 		# jobs completes.
@@ -1005,6 +1011,8 @@ class Scheduler(PollScheduler):
 
 			earlier_sigint_handler = signal.signal(signal.SIGINT, sighandler)
 			earlier_sigterm_handler = signal.signal(signal.SIGTERM, sighandler)
+			earlier_sigcont_handler = \
+				signal.signal(signal.SIGCONT, self._sigcont_handler)
 
 			try:
 				rval = self._merge()
@@ -1018,6 +1026,10 @@ class Scheduler(PollScheduler):
 					signal.signal(signal.SIGTERM, earlier_sigterm_handler)
 				else:
 					signal.signal(signal.SIGTERM, signal.SIG_DFL)
+				if earlier_sigcont_handler is not None:
+					signal.signal(signal.SIGCONT, earlier_sigcont_handler)
+				else:
+					signal.signal(signal.SIGCONT, signal.SIG_DFL)
 
 			if received_signal:
 				sys.exit(received_signal[0])
@@ -1579,6 +1591,9 @@ class Scheduler(PollScheduler):
 				not self._task_queues.merge)):
 				break
 
+	def _sigcont_handler(self, signum, frame):
+		self._sigcont_time = time.time()
+
 	def _job_delay(self):
 		"""
 		@rtype: bool
@@ -1588,6 +1603,23 @@ class Scheduler(PollScheduler):
 		if self._jobs and self._max_load is not None:
 
 			current_time = time.time()
+
+			if self._sigcont_time is not None:
+
+				elapsed_seconds = current_time - self._sigcont_time
+				# elapsed_seconds < 0 means the system clock has been adjusted
+				if elapsed_seconds > 0 and \
+					elapsed_seconds < self._sigcont_delay:
+					self._event_loop.timeout_add(
+						1000 * (self._sigcont_delay - elapsed_seconds),
+						self._schedule_once)
+					return True
+
+				# Only set this to None after the delay has expired,
+				# since this method may be called again before the
+				# delay has expired.
+				self._sigcont_time = None
+
 			try:
 				avg1, avg5, avg15 = getloadavg()
 			except OSError:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-09 21:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-09 21:20 UTC (permalink / raw
  To: gentoo-commits

commit:     0feda7b9d411ea972ec49b55da818b73cc9fd800
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  9 21:20:05 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul  9 21:20:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0feda7b9

_job_delay: prevent accumlation of timeouts

---
 pym/_emerge/Scheduler.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 5cb4128..d663e97 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -250,6 +250,7 @@ class Scheduler(PollScheduler):
 		# new jobs.
 		self._job_delay_max = 5
 		self._previous_job_start_time = None
+		self._job_delay_timeout_id = None
 
 		# The load average takes some time to respond when after
 		# a SIGSTOP/SIGCONT cycle, so delay scheduling for some
@@ -1610,7 +1611,12 @@ class Scheduler(PollScheduler):
 				# elapsed_seconds < 0 means the system clock has been adjusted
 				if elapsed_seconds > 0 and \
 					elapsed_seconds < self._sigcont_delay:
-					self._event_loop.timeout_add(
+
+					if self._job_delay_timeout_id is not None:
+						self._event_loop.source_remove(
+							self._job_delay_timeout_id)
+
+					self._job_delay_timeout_id = self._event_loop.timeout_add(
 						1000 * (self._sigcont_delay - elapsed_seconds),
 						self._schedule_once)
 					return True
@@ -1631,7 +1637,12 @@ class Scheduler(PollScheduler):
 			elapsed_seconds = current_time - self._previous_job_start_time
 			# elapsed_seconds < 0 means the system clock has been adjusted
 			if elapsed_seconds > 0 and elapsed_seconds < delay:
-				self._event_loop.timeout_add(
+
+				if self._job_delay_timeout_id is not None:
+					self._event_loop.source_remove(
+						self._job_delay_timeout_id)
+
+				self._job_delay_timeout_id = self._event_loop.timeout_add(
 					1000 * (delay - elapsed_seconds), self._schedule_once)
 				return True
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-23 19:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-23 19:14 UTC (permalink / raw
  To: gentoo-commits

commit:     7641490497bbee863af3eecdbc9ec47374420751
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 19:14:11 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 19:14:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=76414904

action_sync: use emerge_config parameter

---
 pym/_emerge/actions.py | 63 +++++++++++++++++++++++++++++++-------------------
 1 file changed, 39 insertions(+), 24 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 11a8698..0fecc8f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -18,6 +18,7 @@ import sys
 import tempfile
 import textwrap
 import time
+import warnings
 from itertools import chain
 
 import portage
@@ -2009,37 +2010,50 @@ def action_search(root_config, myopts, myfiles, spinner):
 				sys.exit(1)
 			searchinstance.output()
 
-def action_sync(settings, trees, myopts):
-	xterm_titles = "notitles" not in settings.features
+def action_sync(emerge_config, trees=DeprecationWarning, opts=DeprecationWarning):
+
+	if not isinstance(emerge_config, _emerge_config):
+		warnings.warn("_emerge.actions.action_sync() now expects "
+			"an _emerge_config instance as the first parameter",
+			DeprecationWarning, stacklevel=2)
+		emerge_config = load_emerge_config(
+			action='sync', args=[], trees=trees, opts=opts)
+
+	xterm_titles = "notitles" not in \
+		emerge_config.target_config.settings.features
 	emergelog(xterm_titles, " === sync")
 
-	for repo in settings.repositories:
+	for repo in emerge_config.target_config.settings.repositories:
 		if repo.sync_type is not None:
-			returncode = _sync_repo(repo, settings, trees, myopts)
+			returncode = _sync_repo(emerge_config, repo)
 			if returncode != os.EX_OK:
 				return returncode
 
 	# Reload the whole config from scratch.
 	portage._sync_disabled_warnings = False
-	settings, trees, mtimedb = load_emerge_config(trees=trees)
-	adjust_configs(myopts, trees)
-	portdb = trees[settings['EROOT']]['porttree'].dbapi
-	root_config = trees[settings['EROOT']]['root_config']
+	load_emerge_config(emerge_config=emerge_config)
+	adjust_configs(emerge_config.opts, emerge_config.trees)
 
-	if myopts.get('--package-moves') != 'n' and _global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
-		mtimedb.commit()
+	if emerge_config.opts.get('--package-moves') != 'n' and \
+		_global_updates(emerge_config.trees,
+		emerge_config.target_config.mtimedb["updates"],
+		quiet=("--quiet" in emerge_config.opts)):
+		emerge_config.target_config.mtimedb.commit()
 		# Reload the whole config from scratch.
-		settings, trees, mtimedb = load_emerge_config(trees=trees)
-		adjust_configs(myopts, trees)
-		portdb = trees[settings['EROOT']]['porttree'].dbapi
-		root_config = trees[settings['EROOT']]['root_config']
+		load_emerge_config(emerge_config=emerge_config)
+		adjust_configs(emerge_config.opts, emerge_config.trees)
 
-	mybestpv = portdb.xmatch("bestmatch-visible", portage.const.PORTAGE_PACKAGE_ATOM)
-	mypvs = portage.best(trees[settings['EROOT']]['vartree'].dbapi.match(portage.const.PORTAGE_PACKAGE_ATOM))
+	mybestpv = emerge_config.target_config.trees['porttree'].dbapi.xmatch(
+		"bestmatch-visible", portage.const.PORTAGE_PACKAGE_ATOM)
+	mypvs = portage.best(
+		emerge_config.target_config.trees['vartree'].dbapi.match(
+			portage.const.PORTAGE_PACKAGE_ATOM))
 
-	chk_updated_cfg_files(settings["EROOT"], portage.util.shlex_split(settings.get("CONFIG_PROTECT", "")))
+	chk_updated_cfg_files(emerge_config.target_config.root,
+		portage.util.shlex_split(
+			emerge_config.target_config.settings.get("CONFIG_PROTECT", "")))
 
-	if mybestpv != mypvs and "--quiet" not in myopts:
+	if mybestpv != mypvs and "--quiet" not in emerge_config.opts:
 		print()
 		print(warn(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended")
 		print(warn(" * ")+"that you update portage now, before any other packages are updated.")
@@ -2047,10 +2061,12 @@ def action_sync(settings, trees, myopts):
 		print(warn(" * ")+"To update portage, run 'emerge --oneshot portage' now.")
 		print()
 
-	display_news_notification(root_config, myopts)
+	display_news_notification(emerge_config.target_config, emerge_config.opts)
 	return os.EX_OK
 
-def _sync_repo(repo, settings, trees, myopts):
+def _sync_repo(emerge_config, repo):
+	settings, trees, mtimedb = emerge_config
+	myopts = emerge_config.opts
 	enter_invalid = '--ask-enter-invalid' in myopts
 	xterm_titles = "notitles" not in settings.features
 	msg = ">>> Synchronization of repository '%s' located in '%s'..." % (repo.name, repo.location)
@@ -2577,8 +2593,8 @@ def _sync_repo(repo, settings, trees, myopts):
 		dosyncuri = syncuri
 
 	# Reload the whole config from scratch.
-	settings, trees, mtimedb = load_emerge_config(trees=trees)
-	adjust_configs(myopts, trees)
+	settings, trees, mtimedb = load_emerge_config(emerge_config=emerge_config)
+	adjust_configs(emerge_config.opts, emerge_config.trees)
 	portdb = trees[settings['EROOT']]['porttree'].dbapi
 
 	if repo.sync_type == "git":
@@ -3842,8 +3858,7 @@ def run_action(emerge_config):
 			return 1
 
 	if "sync" == emerge_config.action:
-		return action_sync(emerge_config.target_config.settings,
-			emerge_config.trees, emerge_config.opts)
+		return action_sync(emerge_config)
 	elif "metadata" == emerge_config.action:
 		action_metadata(emerge_config.target_config.settings,
 			emerge_config.target_config.trees['porttree'].dbapi,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-23 19:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-23 19:44 UTC (permalink / raw
  To: gentoo-commits

commit:     22c7578d1cf407a342a1fda2f6e1fc7bdfce6eb7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 19:44:30 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 19:44:30 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=22c7578d

action_sync: backward compatible parameters

---
 pym/_emerge/actions.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 8c314b3..5d20e00 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2010,14 +2010,16 @@ def action_search(root_config, myopts, myfiles, spinner):
 				sys.exit(1)
 			searchinstance.output()
 
-def action_sync(emerge_config, trees=DeprecationWarning, opts=DeprecationWarning):
+def action_sync(emerge_config, trees=DeprecationWarning,
+	mtimedb=DeprecationWarning, opts=DeprecationWarning,
+	action=DeprecationWarning):
 
 	if not isinstance(emerge_config, _emerge_config):
 		warnings.warn("_emerge.actions.action_sync() now expects "
 			"an _emerge_config instance as the first parameter",
 			DeprecationWarning, stacklevel=2)
 		emerge_config = load_emerge_config(
-			action='sync', args=[], trees=trees, opts=opts)
+			action=action, args=[], trees=trees, opts=opts)
 
 	xterm_titles = "notitles" not in \
 		emerge_config.target_config.settings.features


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-23 20:16 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-23 20:16 UTC (permalink / raw
  To: gentoo-commits

commit:     2cd31a4a18ae470dd35ee5326885b1b1cfba2087
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 20:15:09 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 20:15:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2cd31a4a

emerge --sync: support repo arguments

---
 pym/_emerge/actions.py | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 5d20e00..c5ee353 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2025,7 +2025,38 @@ def action_sync(emerge_config, trees=DeprecationWarning,
 		emerge_config.target_config.settings.features
 	emergelog(xterm_titles, " === sync")
 
-	for repo in emerge_config.target_config.settings.repositories:
+	selected_repos = []
+	unknown_repo_names = []
+	missing_sync_type = []
+	if emerge_config.args:
+		for repo_name in emerge_config.args:
+			try:
+				repo = emerge_config.target_config.settings.repositories[repo_name]
+			except KeyError:
+				unknown_repo_names.append(repo_name)
+			else:
+				selected_repos.append(repo)
+				if repo.sync_type is None:
+					missing_sync_type.append(repo)
+
+		if unknown_repo_names:
+			writemsg_level("!!! %s\n" % _("Unknown repo(s): %s") %
+				" ".join(unknown_repo_names),
+				level=logging.ERROR, noiselevel=-1)
+
+		if missing_sync_type:
+			writemsg_level("!!! %s\n" %
+				_("Missing sync-type for repo(s): %s") %
+				" ".join(repo.name for repo in missing_sync_type),
+				level=logging.ERROR, noiselevel=-1)
+
+		if unknown_repo_names or missing_sync_type:
+			return 1
+
+	else:
+		selected_repos.extend(emerge_config.target_config.settings.repositories)
+
+	for repo in selected_repos:
 		if repo.sync_type is not None:
 			returncode = _sync_repo(emerge_config, repo)
 			if returncode != os.EX_OK:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-28 23:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-28 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     6175b127b82dc2c777c7d134085457946d1e36e5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 23:02:46 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 28 23:02:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6175b127

depgraph: avoid conflicts during _complete_graph

During _complete_graph, it was possible for _select_pkg_from_graph to
make some poor package selections that would result in conflicts when
there were two matches in different slots that conflicted with
eachother.

---
 pym/_emerge/depgraph.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 939adde..a7316f0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5084,9 +5084,16 @@ class depgraph(object):
 		matches = graph_db.match_pkgs(atom)
 		if not matches:
 			return None, None
-		pkg = matches[-1] # highest match
-		in_graph = self._dynamic_config._slot_pkg_map[root].get(pkg.slot_atom)
-		return pkg, in_graph
+
+		# There may be multiple matches, and they may
+		# conflict with eachother, so choose the highest
+		# version that has already been added to the graph.
+		for pkg in reversed(matches):
+			if pkg in self._dynamic_config.digraph:
+				return pkg, pkg
+
+		# Fall back to installed packages
+		return self._select_pkg_from_installed(root, atom, onlydeps=onlydeps)
 
 	def _select_pkg_from_installed(self, root, atom, onlydeps=False):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-07-30  5:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-07-30  5:41 UTC (permalink / raw
  To: gentoo-commits

commit:     668c82dd9f651a688ee0302275ae6b8d9c43228b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 30 05:41:11 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 05:41:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=668c82dd

_want_update_pkg: respect --exclude

---
 pym/_emerge/depgraph.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index c1f1ab0..76fda2c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4317,6 +4317,11 @@ class depgraph(object):
 		return not arg
 
 	def _want_update_pkg(self, parent, pkg):
+
+		if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg,
+			modified_use=self._pkg_use_enabled(pkg)):
+			return False
+
 		arg_atoms = None
 		try:
 			arg_atoms = list(self._iter_atoms_for_pkg(pkg))


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-02  8:54 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-02  8:54 UTC (permalink / raw
  To: gentoo-commits

commit:     f3b89e80bc5779a784427b1435758c0f88946c05
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 08:54:25 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 08:54:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f3b89e80

_slot_confict_backtrack: simplify code

The order of backtrack_data is simply based on version comparison
since commit 9b6f69e2a66c0f1d1d6545208edb3c45eacfd845.

---
 pym/_emerge/depgraph.py | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 39ae3ea..4f9d0f0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6,7 +6,6 @@ from __future__ import print_function, unicode_literals
 import errno
 import io
 import logging
-import operator
 import stat
 import sys
 import textwrap
@@ -959,20 +958,11 @@ class depgraph(object):
 
 		debug = "--debug" in self._frozen_config.myopts
 		existing_node = self._dynamic_config._slot_pkg_map[root][slot_atom]
+		# In order to avoid a missed update, first mask lower versions
+		# that conflict with higher versions (the backtracker visits
+		# these in reverse order).
+		conflict_pkgs.sort(reverse=True)
 		backtrack_data = []
-		# The ordering of backtrack_data can make
-		# a difference here, because both mask actions may lead
-		# to valid, but different, solutions and the one with
-		# 'existing_node' masked is usually the better one. Because
-		# of that, we choose an order such that
-		# the backtracker will first explore the choice with
-		# existing_node masked. The backtracker reverses the
-		# order, so the order it uses is the reverse of the
-		# order shown here. See bug #339606.
-		if existing_node in conflict_pkgs and \
-			existing_node is not conflict_pkgs[-1]:
-			conflict_pkgs.remove(existing_node)
-			conflict_pkgs.append(existing_node)
 		for to_be_masked in conflict_pkgs:
 			# For missed update messages, find out which
 			# atoms matched to_be_selected that did not
@@ -983,11 +973,6 @@ class depgraph(object):
 				if parent_atom not in parent_atoms)
 			backtrack_data.append((to_be_masked, conflict_atoms))
 
-		if len(backtrack_data) > 1:
-			# In order to avoid a missed update, first mask lower
-			# versions that conflict with higher versions.
-			backtrack_data.sort(key=operator.itemgetter(0), reverse=True)
-
 		to_be_masked = backtrack_data[-1][0]
 
 		self._dynamic_config._backtrack_infos.setdefault(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-02  9:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-02  9:49 UTC (permalink / raw
  To: gentoo-commits

commit:     9a141c62a44cd3d05e009129457f74c88b00e7d5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  2 09:48:57 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  2 09:48:57 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9a141c62

emerge: portage.util._argparse

---
 pym/_emerge/main.py | 56 ++++++++---------------------------------------------
 1 file changed, 8 insertions(+), 48 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index edf40a5..2e68a05 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -18,6 +18,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 	'_emerge.is_valid_package_atom:insert_category_into_atom'
 )
 from portage import os
+from portage.util._argparse import ArgumentParser
 
 if sys.hexversion >= 0x3000000:
 	long = int
@@ -298,31 +299,26 @@ def parse_opts(tmpcmdline, silent=False):
 		"--ask": {
 			"shortopt" : "-a",
 			"help"    : "prompt before performing any actions",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--autounmask": {
 			"help"    : "automatically unmask packages",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--autounmask-unrestricted-atoms": {
 			"help"    : "write autounmask changes with >= atoms if possible",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--autounmask-keep-masks": {
 			"help"    : "don't add package.unmask entries",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--autounmask-write": {
 			"help"    : "write changes made by --autounmask to disk",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
@@ -347,7 +343,6 @@ def parse_opts(tmpcmdline, silent=False):
 		"--buildpkg": {
 			"shortopt" : "-b",
 			"help"     : "build binary packages",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
@@ -365,25 +360,21 @@ def parse_opts(tmpcmdline, silent=False):
 		},
 		"--color": {
 			"help":"enable or disable color output",
-			"type":"choice",
 			"choices":("y", "n")
 		},
 
 		"--complete-graph": {
 			"help"    : "completely account for all known dependencies",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--complete-graph-if-new-use": {
 			"help"    : "trigger --complete-graph behavior if USE or IUSE will change for an installed package",
-			"type"    : "choice",
 			"choices" : y_or_n
 		},
 
 		"--complete-graph-if-new-ver": {
 			"help"    : "trigger --complete-graph behavior if an installed package version will change (upgrade or downgrade)",
-			"type"    : "choice",
 			"choices" : y_or_n
 		},
 
@@ -401,19 +392,16 @@ def parse_opts(tmpcmdline, silent=False):
 
 		"--depclean-lib-check": {
 			"help"    : "check for consumers of libraries before removing them",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--deselect": {
 			"help"    : "remove atoms/sets from the world file",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--dynamic-deps": {
 			"help": "substitute the dependencies of installed packages with the dependencies of unbuilt ebuilds",
-			"type": "choice",
 			"choices": y_or_n
 		},
 
@@ -427,7 +415,6 @@ def parse_opts(tmpcmdline, silent=False):
 
 		"--fail-clean": {
 			"help"    : "clean temp files after build failure",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
@@ -437,7 +424,6 @@ def parse_opts(tmpcmdline, silent=False):
 				"only for debugging purposes, and it only affects built packages "
 				"that specify slot/sub-slot := operator dependencies using the "
 				"experimental \"4-slot-abi\" EAPI.",
-			"type": "choice",
 			"choices": y_or_n
 		},
 
@@ -453,7 +439,6 @@ def parse_opts(tmpcmdline, silent=False):
 
 		"--keep-going": {
 			"help"    : "continue as much as possible after an error",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
@@ -468,18 +453,15 @@ def parse_opts(tmpcmdline, silent=False):
 
 		"--misspell-suggestions": {
 			"help"    : "enable package name misspell suggestions",
-			"type"    : "choice",
 			"choices" : ("y", "n")
 		},
 
 		"--with-bdeps": {
 			"help":"include unnecessary build time dependencies",
-			"type":"choice",
 			"choices":("y", "n")
 		},
 		"--reinstall": {
 			"help":"specify conditions to trigger package reinstallation",
-			"type":"choice",
 			"choices":["changed-use"]
 		},
 
@@ -494,21 +476,18 @@ def parse_opts(tmpcmdline, silent=False):
 		"--binpkg-respect-use": {
 			"help"    : "discard binary packages if their use flags \
 				don't match the current configuration",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--getbinpkg": {
 			"shortopt" : "-g",
 			"help"     : "fetch binary packages",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
 		"--getbinpkgonly": {
 			"shortopt" : "-G",
 			"help"     : "fetch binary packages only",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
@@ -537,7 +516,6 @@ def parse_opts(tmpcmdline, silent=False):
 
 		"--package-moves": {
 			"help"     : "perform package moves when necessary",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
@@ -554,19 +532,16 @@ def parse_opts(tmpcmdline, silent=False):
 		"--quiet": {
 			"shortopt" : "-q",
 			"help"     : "reduced or condensed output",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
 		"--quiet-build": {
 			"help"     : "redirect build output to logs",
-			"type"     : "choice",
 			"choices"  : true_y_or_n,
 		},
 
 		"--quiet-fail": {
 			"help"     : "suppresses display of the build log on stdout",
-			"type"     : "choice",
 			"choices"  : true_y_or_n,
 		},
 
@@ -575,7 +550,6 @@ def parse_opts(tmpcmdline, silent=False):
 				"operator dependencies can be satisfied by a newer slot, so that "
 				"older packages slots will become eligible for removal by the "
 				"--depclean action as soon as possible."),
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
@@ -584,7 +558,6 @@ def parse_opts(tmpcmdline, silent=False):
 				"used at both build-time and run-time are built, " + \
 				"if the dependency is not already installed with the " + \
 				"same version and revision.",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
@@ -593,21 +566,18 @@ def parse_opts(tmpcmdline, silent=False):
 				"used at both build-time and run-time are built, " + \
 				"if the dependency is not already installed with the " + \
 				"same version. Revision numbers are ignored.",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
 		"--rebuild-if-unbuilt": {
 			"help"     : "Rebuild packages when dependencies that are " + \
 				"used at both build-time and run-time are built.",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
 		"--rebuilt-binaries": {
 			"help"     : "replace installed packages with binary " + \
 			             "packages that have been rebuilt",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 		
@@ -624,7 +594,6 @@ def parse_opts(tmpcmdline, silent=False):
 
 		"--root-deps": {
 			"help"    : "modify interpretation of depedencies",
-			"type"    : "choice",
 			"choices" :("True", "rdeps")
 		},
 
@@ -632,19 +601,16 @@ def parse_opts(tmpcmdline, silent=False):
 			"shortopt" : "-w",
 			"help"    : "add specified packages to the world set " + \
 			            "(inverse of --oneshot)",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--selective": {
 			"help"    : "identical to --noreplace",
-			"type"    : "choice",
 			"choices" : true_y_or_n
 		},
 
 		"--use-ebuild-visibility": {
 			"help"     : "use unbuilt ebuild metadata for visibility checks on built packages",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
@@ -658,41 +624,35 @@ def parse_opts(tmpcmdline, silent=False):
 		"--usepkg": {
 			"shortopt" : "-k",
 			"help"     : "use binary packages",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
 		"--usepkgonly": {
 			"shortopt" : "-K",
 			"help"     : "use only binary packages",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 
 		"--verbose": {
 			"shortopt" : "-v",
 			"help"     : "verbose output",
-			"type"     : "choice",
 			"choices"  : true_y_or_n
 		},
 	}
 
-	from optparse import OptionParser
-	parser = OptionParser()
-	if parser.has_option("--help"):
-		parser.remove_option("--help")
+	parser = ArgumentParser(add_help=False)
 
 	for action_opt in actions:
-		parser.add_option("--" + action_opt, action="store_true",
+		parser.add_argument("--" + action_opt, action="store_true",
 			dest=action_opt.replace("-", "_"), default=False)
 	for myopt in options:
-		parser.add_option(myopt, action="store_true",
+		parser.add_argument(myopt, action="store_true",
 			dest=myopt.lstrip("--").replace("-", "_"), default=False)
 	for shortopt, longopt in shortmapping.items():
-		parser.add_option("-" + shortopt, action="store_true",
+		parser.add_argument("-" + shortopt, action="store_true",
 			dest=longopt.lstrip("--").replace("-", "_"), default=False)
 	for myalias, myopt in longopt_aliases.items():
-		parser.add_option(myalias, action="store_true",
+		parser.add_argument(myalias, action="store_true",
 			dest=myopt.lstrip("--").replace("-", "_"), default=False)
 
 	for myopt, kwargs in argument_options.items():
@@ -700,12 +660,12 @@ def parse_opts(tmpcmdline, silent=False):
 		args = [myopt]
 		if shortopt is not None:
 			args.append(shortopt)
-		parser.add_option(dest=myopt.lstrip("--").replace("-", "_"),
+		parser.add_argument(dest=myopt.lstrip("--").replace("-", "_"),
 			*args, **kwargs)
 
 	tmpcmdline = insert_optional_args(tmpcmdline)
 
-	myoptions, myargs = parser.parse_args(args=tmpcmdline)
+	myoptions, myargs = parser.parse_known_args(args=tmpcmdline)
 
 	if myoptions.ask in true_y:
 		myoptions.ask = True


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-04 20:21 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-04 20:21 UTC (permalink / raw
  To: gentoo-commits

commit:     c6679936d162f35a330ce541ec4cd0567ccf76d8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  4 20:21:19 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug  4 20:21:19 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6679936

depgraph: trigger reinstalls if backtrack allowed

This should fix cases where it tries to backtrack but simply aborts
with --backtrack=0.

---
 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4f9d0f0..7b77edc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5863,7 +5863,8 @@ class depgraph(object):
 
 		self._process_slot_conflicts()
 
-		self._slot_operator_trigger_reinstalls()
+		if self._dynamic_config._allow_backtracking:
+			self._slot_operator_trigger_reinstalls()
 
 		if not self._validate_blockers():
 			# Blockers don't trigger the _skip_restart flag, since


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-19  9:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-19  9:38 UTC (permalink / raw
  To: gentoo-commits

commit:     a500fbdae1098424e64356f8a24ac3c25bbff908
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 19 09:37:01 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 19 09:37:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a500fbda

cgroup: use SIGKILL to guarantee killing processes.

---
 pym/_emerge/SpawnProcess.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 60bd3f1..061770d 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -205,7 +205,7 @@ class SpawnProcess(SubProcess):
 			# step 1: kill all orphans
 			pids = get_pids(self.cgroup)
 			if pids:
-				kill_all(pids, signal.SIGTERM)
+				kill_all(pids, signal.SIGKILL)
 
 			# step 2: remove the cgroup
 			try:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-22  3:30 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-22  3:30 UTC (permalink / raw
  To: gentoo-commits

commit:     289b46d271cadfa7fd054e20e13c9045dd764f81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 03:29:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 03:29:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=289b46d2

SpawnProcess: add unshare_ipc and unshare_net

---
 pym/_emerge/SpawnProcess.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 061770d..994f3dd 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -31,7 +31,8 @@ class SpawnProcess(SubProcess):
 
 	_spawn_kwarg_names = ("env", "opt_name", "fd_pipes",
 		"uid", "gid", "groups", "umask", "logfile",
-		"path_lookup", "pre_exec", "close_fds", "cgroup")
+		"path_lookup", "pre_exec", "close_fds", "cgroup",
+		"unshare_ipc", "unshare_net")
 
 	__slots__ = ("args",) + \
 		_spawn_kwarg_names + ("_pipe_logger", "_selinux_type",)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-24 16:07 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-24 16:07 UTC (permalink / raw
  To: gentoo-commits

commit:     3eac8cfa814159d52cd73bdc81dcdae92701d335
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 16:07:13 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 16:07:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3eac8cfa

emerge --sync: discard timestamp for partial sync

---
 pym/_emerge/actions.py | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 52ceba4..27abd5d 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2533,8 +2533,31 @@ def _sync_repo(emerge_config, repo):
 				elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
 					# actual sync
 					mycommand = rsynccommand + [dosyncuri+"/", repo.location]
-					exitcode = portage.process.spawn(mycommand,
-						**portage._native_kwargs(spawn_kwargs))
+					exitcode = None
+					try:
+						exitcode = portage.process.spawn(mycommand,
+							**portage._native_kwargs(spawn_kwargs))
+					finally:
+						if exitcode is None:
+							# interrupted
+							exitcode = 128 + signal.SIGINT
+
+					#   0	Success
+					#   1	Syntax or usage error
+					#   2	Protocol incompatibility
+					#   5	Error starting client-server protocol
+					#  35	Timeout waiting for daemon connection
+					if exitcode not in (0, 1, 2, 5, 35):
+						# If the exit code is not amonge those listed above,
+						# then we may have a partial/inconsistent sync state,
+						# so our previously read timstamp as well as the
+						# corresponding file can no longer be trusted.
+						mytimestamp = 0
+						try:
+							os.unlink(servertimestampfile)
+						except OSError:
+							pass
+
 					if exitcode in [0,1,3,4,11,14,20,21]:
 						break
 			elif exitcode in [1,3,4,11,14,20,21]:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-24 16:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-24 16:10 UTC (permalink / raw
  To: gentoo-commits

commit:     858d9302126422f11a1d9e69bee84da0ae829470
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 16:07:13 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 16:09:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=858d9302

emerge --sync: discard timestamp for partial sync

---
 pym/_emerge/actions.py | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 52ceba4..2aec61c 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2533,8 +2533,31 @@ def _sync_repo(emerge_config, repo):
 				elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
 					# actual sync
 					mycommand = rsynccommand + [dosyncuri+"/", repo.location]
-					exitcode = portage.process.spawn(mycommand,
-						**portage._native_kwargs(spawn_kwargs))
+					exitcode = None
+					try:
+						exitcode = portage.process.spawn(mycommand,
+							**portage._native_kwargs(spawn_kwargs))
+					finally:
+						if exitcode is None:
+							# interrupted
+							exitcode = 128 + signal.SIGINT
+
+					#   0	Success
+					#   1	Syntax or usage error
+					#   2	Protocol incompatibility
+					#   5	Error starting client-server protocol
+					#  35	Timeout waiting for daemon connection
+					if exitcode not in (0, 1, 2, 5, 35):
+						# If the exit code is not among those listed above,
+						# then we may have a partial/inconsistent sync state,
+						# so our previously read timstamp as well as the
+						# corresponding file can no longer be trusted.
+						mytimestamp = 0
+						try:
+							os.unlink(servertimestampfile)
+						except OSError:
+							pass
+
 					if exitcode in [0,1,3,4,11,14,20,21]:
 						break
 			elif exitcode in [1,3,4,11,14,20,21]:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-24 16:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-24 16:12 UTC (permalink / raw
  To: gentoo-commits

commit:     8ec7fc968784a77e302ae79053e817710f0237d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 16:07:13 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 16:12:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8ec7fc96

emerge --sync: discard timestamp for partial sync

---
 pym/_emerge/actions.py | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 52ceba4..bb6e496 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2533,8 +2533,31 @@ def _sync_repo(emerge_config, repo):
 				elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
 					# actual sync
 					mycommand = rsynccommand + [dosyncuri+"/", repo.location]
-					exitcode = portage.process.spawn(mycommand,
-						**portage._native_kwargs(spawn_kwargs))
+					exitcode = None
+					try:
+						exitcode = portage.process.spawn(mycommand,
+							**portage._native_kwargs(spawn_kwargs))
+					finally:
+						if exitcode is None:
+							# interrupted
+							exitcode = 128 + signal.SIGINT
+
+					#   0	Success
+					#   1	Syntax or usage error
+					#   2	Protocol incompatibility
+					#   5	Error starting client-server protocol
+					#  35	Timeout waiting for daemon connection
+					if exitcode not in (0, 1, 2, 5, 35):
+						# If the exit code is not among those listed above,
+						# then we may have a partial/inconsistent sync state,
+						# so our previously read timestamp as well as the
+						# corresponding file can no longer be trusted.
+						mytimestamp = 0
+						try:
+							os.unlink(servertimestampfile)
+						except OSError:
+							pass
+
 					if exitcode in [0,1,3,4,11,14,20,21]:
 						break
 			elif exitcode in [1,3,4,11,14,20,21]:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-08-24 16:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-08-24 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     a9e79995f6ee561d543ed517e826966f9c3cf7df
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 16:17:11 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 16:17:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a9e79995

emerge --sync: discard timestamp after SIGINT

---
 pym/_emerge/actions.py | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index bb6e496..47a9703 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2542,21 +2542,22 @@ def _sync_repo(emerge_config, repo):
 							# interrupted
 							exitcode = 128 + signal.SIGINT
 
-					#   0	Success
-					#   1	Syntax or usage error
-					#   2	Protocol incompatibility
-					#   5	Error starting client-server protocol
-					#  35	Timeout waiting for daemon connection
-					if exitcode not in (0, 1, 2, 5, 35):
-						# If the exit code is not among those listed above,
-						# then we may have a partial/inconsistent sync state,
-						# so our previously read timestamp as well as the
-						# corresponding file can no longer be trusted.
-						mytimestamp = 0
-						try:
-							os.unlink(servertimestampfile)
-						except OSError:
-							pass
+						#   0	Success
+						#   1	Syntax or usage error
+						#   2	Protocol incompatibility
+						#   5	Error starting client-server protocol
+						#  35	Timeout waiting for daemon connection
+						if exitcode not in (0, 1, 2, 5, 35):
+							# If the exit code is not among those listed above,
+							# then we may have a partial/inconsistent sync
+							# state, so our previously read timestamp as well
+							# as the corresponding file can no longer be
+							# trusted.
+							mytimestamp = 0
+							try:
+								os.unlink(servertimestampfile)
+							except OSError:
+								pass
 
 					if exitcode in [0,1,3,4,11,14,20,21]:
 						break


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-09-02  0:27 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-09-02  0:27 UTC (permalink / raw
  To: gentoo-commits

commit:     8e39ac038b29a358aa1bf9cf4eaeb2987f1eacec
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  2 00:27:35 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 00:27:35 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8e39ac03

FakeVartree: infinite _aux_get_wrapper recursion

---
 pym/_emerge/FakeVartree.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index fd87f6c..14be50c 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -166,8 +166,13 @@ class FakeVartree(vartree):
 			if self._global_updates is None:
 				self._global_updates = \
 					grab_global_updates(self._portdb)
+
+			# Bypass _aux_get_wrapper, since calling that
+			# here would trigger infinite recursion.
+			aux_keys = Package._dep_keys + self.dbapi._pkg_str_aux_keys
+			aux_dict = dict(zip(aux_keys, self._aux_get(pkg.cpv, aux_keys)))
 			perform_global_updates(
-				pkg.cpv, self.dbapi, self._global_updates)
+				pkg.cpv, aux_dict, self.dbapi, self._global_updates)
 
 	def dynamic_deps_preload(self, pkg, metadata):
 		if metadata is not None:
@@ -300,9 +305,7 @@ def grab_global_updates(portdb):
 
 	return retupdates
 
-def perform_global_updates(mycpv, mydb, myupdates):
-	aux_keys = Package._dep_keys + mydb._pkg_str_aux_keys
-	aux_dict = dict(zip(aux_keys, mydb.aux_get(mycpv, aux_keys)))
+def perform_global_updates(mycpv, aux_dict, mydb, myupdates):
 	try:
 		pkg = _pkg_str(mycpv, metadata=aux_dict, settings=mydb.settings)
 	except InvalidData:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-09-02 19:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-09-02 19:49 UTC (permalink / raw
  To: gentoo-commits

commit:     450ce209bebe9dde62107bf7a867844182010685
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  2 19:48:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 19:48:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=450ce209

SpawnProcess: Don't handle FreeBSD fcntl ENOTTY

This error does not occur since the fcntl call was fixed to properly
use the F_GETFD/F_SETFD commands in commit
30c652a9db1014fc720f7d6055520a07b731c984.

---
 pym/_emerge/SpawnProcess.py | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index c7872ca..021e546 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -132,16 +132,9 @@ class SpawnProcess(SubProcess):
 				except AttributeError:
 					pass
 				else:
-					try:
-						fcntl.fcntl(stdout_fd, fcntl.F_SETFD,
-							fcntl.fcntl(stdout_fd,
-							fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
-					except IOError:
-						# FreeBSD may return "Inappropriate ioctl for device"
-						# error here (ENOTTY). TODO: Test this again now that
-						# it's been fixed to use F_GETFD/F_SETFD instead of
-						# F_GETFL/F_SETFL.
-						pass
+					fcntl.fcntl(stdout_fd, fcntl.F_SETFD,
+						fcntl.fcntl(stdout_fd,
+						fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
 
 		self._pipe_logger = PipeLogger(background=self.background,
 			scheduler=self.scheduler, input_fd=master_fd,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-09-04 19:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-09-04 19:00 UTC (permalink / raw
  To: gentoo-commits

commit:     f029338fd0e9417d7ed7700940b8506134fdb977
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  4 18:59:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep  4 18:59:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f029338f

action_info: don't use print(), bug #483628

Mixing print() with direct writing to stdout triggered incorrect
buffering/formatting if stdout was a pipe, at least with Python 3.3.

---
 pym/_emerge/actions.py | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 47a9703..86d67d2 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1692,6 +1692,7 @@ def action_info(settings, trees, myopts, myfiles):
 	append("")
 	writemsg_stdout("\n".join(output_buffer),
 		noiselevel=-1)
+	del output_buffer[:]
 
 	# If some packages were found...
 	if mypkgs:
@@ -1705,11 +1706,15 @@ def action_info(settings, trees, myopts, myfiles):
 		# Loop through each package
 		# Only print settings if they differ from global settings
 		header_title = "Package Settings"
-		print(header_width * "=")
-		print(header_title.rjust(int(header_width/2 + len(header_title)/2)))
-		print(header_width * "=")
-		from portage.output import EOutput
-		out = EOutput()
+		append(header_width * "=")
+		append(header_title.rjust(int(header_width/2 + len(header_title)/2)))
+		append(header_width * "=")
+		append("")
+		writemsg_stdout("\n".join(output_buffer),
+			noiselevel=-1)
+		del output_buffer[:]
+
+		out = portage.output.EOutput()
 		for mypkg in mypkgs:
 			cpv = mypkg[0]
 			pkg_type = mypkg[1]
@@ -1727,28 +1732,32 @@ def action_info(settings, trees, myopts, myfiles):
 				root_config=root_config, type_name=pkg_type)
 
 			if pkg_type == "installed":
-				print("\n%s was built with the following:" % \
+				append("\n%s was built with the following:" % \
 					colorize("INFORM", str(pkg.cpv)))
 			elif pkg_type == "ebuild":
-				print("\n%s would be build with the following:" % \
+				append("\n%s would be build with the following:" % \
 					colorize("INFORM", str(pkg.cpv)))
 			elif pkg_type == "binary":
-				print("\n%s (non-installed binary) was built with the following:" % \
+				append("\n%s (non-installed binary) was built with the following:" % \
 					colorize("INFORM", str(pkg.cpv)))
 
-			writemsg_stdout('%s\n' % pkg_use_display(pkg, myopts),
-				noiselevel=-1)
+			append('%s' % pkg_use_display(pkg, myopts))
 			if pkg_type == "installed":
 				for myvar in mydesiredvars:
 					if metadata[myvar].split() != settings.get(myvar, '').split():
-						print("%s=\"%s\"" % (myvar, metadata[myvar]))
-			print()
+						append("%s=\"%s\"" % (myvar, metadata[myvar]))
+			append("")
+			append("")
+			writemsg_stdout("\n".join(output_buffer),
+				noiselevel=-1)
+			del output_buffer[:]
 
 			if metadata['DEFINED_PHASES']:
 				if 'info' not in metadata['DEFINED_PHASES'].split():
 					continue
 
-			print(">>> Attempting to run pkg_info() for '%s'" % pkg.cpv)
+			writemsg_stdout(">>> Attempting to run pkg_info() for '%s'\n"
+				% pkg.cpv, noiselevel=-1)
 
 			if pkg_type == "installed":
 				ebuildpath = vardb.findname(pkg.cpv)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-09-09 16:53 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-09-09 16:53 UTC (permalink / raw
  To: gentoo-commits

commit:     2cd7f834919be0d9549bbe5d8f712e03ce95d5eb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  9 16:49:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  9 16:49:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2cd7f834

Handle EPERM from os.kill(), bug #358211.

---
 pym/_emerge/SpawnProcess.py | 10 +++++++++-
 pym/_emerge/SubProcess.py   | 19 +++++++++++++++++--
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 021e546..6024ef7 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -8,6 +8,7 @@ except ImportError:
 	fcntl = None
 
 import errno
+import logging
 import platform
 import signal
 import sys
@@ -16,6 +17,7 @@ from _emerge.SubProcess import SubProcess
 import portage
 from portage import os
 from portage.const import BASH_BINARY
+from portage.util import writemsg_level
 from portage.util._async.PipeLogger import PipeLogger
 
 # On Darwin, FD_CLOEXEC triggers errno 35 for stdout (bug #456296)
@@ -198,7 +200,13 @@ class SpawnProcess(SubProcess):
 					try:
 						os.kill(int(p), sig)
 					except OSError as e:
-						if e.errno != errno.ESRCH:
+						if e.errno == errno.EPERM:
+							# Reported with hardened kernel (bug #358211).
+							writemsg_level(
+								"!!! kill: (%i) - Operation not permitted\n" %
+								(p,), level=logging.ERROR,
+								noiselevel=-1)
+						elif e.errno != errno.ESRCH:
 							raise
 
 			# step 1: kill all orphans

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 4ccf916..13d9382 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -1,7 +1,10 @@
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import logging
+
 from portage import os
+from portage.util import writemsg_level
 from _emerge.AbstractPollTask import AbstractPollTask
 import signal
 import errno
@@ -45,7 +48,13 @@ class SubProcess(AbstractPollTask):
 			try:
 				os.kill(self.pid, signal.SIGTERM)
 			except OSError as e:
-				if e.errno != errno.ESRCH:
+				if e.errno == errno.EPERM:
+					# Reported with hardened kernel (bug #358211).
+					writemsg_level(
+						"!!! kill: (%i) - Operation not permitted\n" %
+						(self.pid,), level=logging.ERROR,
+						noiselevel=-1)
+				elif e.errno != errno.ESRCH:
 					raise
 
 	def isAlive(self):
@@ -64,7 +73,13 @@ class SubProcess(AbstractPollTask):
 					try:
 						os.kill(self.pid, signal.SIGKILL)
 					except OSError as e:
-						if e.errno != errno.ESRCH:
+						if e.errno == errno.EPERM:
+							# Reported with hardened kernel (bug #358211).
+							writemsg_level(
+								"!!! kill: (%i) - Operation not permitted\n" %
+								(self.pid,), level=logging.ERROR,
+								noiselevel=-1)
+						elif e.errno != errno.ESRCH:
 							raise
 						del e
 					self._wait_loop(timeout=self._cancel_timeout)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-09-09 16:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-09-09 16:57 UTC (permalink / raw
  To: gentoo-commits

commit:     a5641bf514ded96c160e6cb94a1fdf9ede84778a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  9 16:56:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  9 16:56:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a5641bf5

SpawnProcess: convert cgroup pids to int earlier

---
 pym/_emerge/SpawnProcess.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 6024ef7..b36d15f 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -190,7 +190,7 @@ class SpawnProcess(SubProcess):
 			def get_pids(cgroup):
 				try:
 					with open(os.path.join(cgroup, 'cgroup.procs'), 'r') as f:
-						return f.read().split()
+						return [int(p) for p in f.read().split()]
 				except OSError:
 					# cgroup removed already?
 					return []
@@ -198,7 +198,7 @@ class SpawnProcess(SubProcess):
 			def kill_all(pids, sig):
 				for p in pids:
 					try:
-						os.kill(int(p), sig)
+						os.kill(p, sig)
 					except OSError as e:
 						if e.errno == errno.EPERM:
 							# Reported with hardened kernel (bug #358211).


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-09-18 18:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2013-09-18 18:29 UTC (permalink / raw
  To: gentoo-commits

commit:     025594aa80109ced31ea3ea8fec4eb50e964bdc3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 18 18:29:27 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 18 18:29:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=025594aa

SpawnProcess: enable FD_CLOEXEC for Darwin

Bug #456296 is now handled by the F_GETFD/F_SETFD commands in commit
30c652a9db1014fc720f7d6055520a07b731c984.

---
 pym/_emerge/SpawnProcess.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index b36d15f..15d3dc5 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -9,7 +9,6 @@ except ImportError:
 
 import errno
 import logging
-import platform
 import signal
 import sys
 
@@ -20,11 +19,6 @@ from portage.const import BASH_BINARY
 from portage.util import writemsg_level
 from portage.util._async.PipeLogger import PipeLogger
 
-# On Darwin, FD_CLOEXEC triggers errno 35 for stdout (bug #456296)
-# TODO: Test this again now that it's been fixed to use
-# F_GETFD/F_SETFD instead of F_GETFL/F_SETFL.
-_disable_cloexec_stdout = platform.system() in ("Darwin",)
-
 class SpawnProcess(SubProcess):
 
 	"""
@@ -128,7 +122,7 @@ class SpawnProcess(SubProcess):
 		if can_log and not self.background:
 			stdout_fd = os.dup(fd_pipes_orig[1])
 			# FD_CLOEXEC is enabled by default in Python >=3.4.
-			if sys.hexversion < 0x3040000 and fcntl is not None and not _disable_cloexec_stdout:
+			if sys.hexversion < 0x3040000 and fcntl is not None:
 				try:
 					fcntl.FD_CLOEXEC
 				except AttributeError:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-11-26 13:50 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2013-11-26 13:50 UTC (permalink / raw
  To: gentoo-commits

commit:     5842e87872fd738cdfc7d0698463f1d11ffe5dee
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Nov 25 22:11:41 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Nov 26 09:14:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5842e878

Fix slot operator handling bug

emerge would backtrack once for each package that needed a rebuild.
This caused it to hit the backtrack limit and to not rebuild all
packages.
It also sometimes failed to install the packages that caused the rebuild
in the first place, making the rebuilds pointless.
This fixes bug 486580.

---
 pym/_emerge/depgraph.py | 56 ++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 41 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a6efa63..033057b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -650,11 +650,18 @@ class depgraph(object):
 		# has a parent that is matched by one of the atoms from above.
 		forced_rebuilds = {}
 		for (root, slot_atom), deps in self._dynamic_config._slot_operator_deps.items():
-			if slot_atom not in atoms.get(root, []):
-				continue
+			rebuild_atoms = atoms.get(root, set())
 
 			for dep in deps:
-				if dep.parent.installed:
+				if dep.parent.installed or dep.child.installed or \
+					dep.parent.slot_atom not in rebuild_atoms:
+					continue
+
+				# Make sure the child's slot/subslot has changed. If it hasn't,
+				# then another child has forced this rebuild.
+				installed_pkg, _ = self._select_pkg_from_installed(root, dep.child.slot_atom)
+				if installed_pkg and installed_pkg.slot == dep.child.slot and \
+					installed_pkg.sub_slot == dep.child.sub_slot:
 					continue
 
 				# The child has forced a rebuild of the parent
@@ -1627,12 +1634,10 @@ class depgraph(object):
 					if new_dep is not None:
 						self._slot_operator_update_backtrack(dep,
 							new_child_slot=new_dep.child)
-						break
 
 				if dep.want_update:
 					if self._slot_operator_update_probe(dep):
 						self._slot_operator_update_backtrack(dep)
-						break
 
 	def _reinstall_for_flags(self, pkg, forced_flags,
 		orig_use, orig_iuse, cur_use, cur_iuse):
@@ -2518,7 +2523,7 @@ class depgraph(object):
 				yield (atom, None)
 				continue
 			dep_pkg, existing_node = self._select_package(
-				root_config.root, atom)
+				root_config.root, atom, parent=parent)
 			if dep_pkg is None:
 				yield (atom, None)
 				continue
@@ -4345,12 +4350,12 @@ class depgraph(object):
 						yield inst_pkg
 						return
 
-	def _select_pkg_highest_available(self, root, atom, onlydeps=False):
+	def _select_pkg_highest_available(self, root, atom, onlydeps=False, parent=None):
 		cache_key = (root, atom, atom.unevaluated_atom, onlydeps, self._dynamic_config._autounmask)
 		ret = self._dynamic_config._highest_pkg_cache.get(cache_key)
 		if ret is not None:
 			return ret
-		ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps)
+		ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps, parent=parent)
 		self._dynamic_config._highest_pkg_cache[cache_key] = ret
 		pkg, existing = ret
 		if pkg is not None:
@@ -4511,8 +4516,9 @@ class depgraph(object):
 				yield autounmask_level
 
 
-	def _select_pkg_highest_available_imp(self, root, atom, onlydeps=False):
-		pkg, existing = self._wrapped_select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps)
+	def _select_pkg_highest_available_imp(self, root, atom, onlydeps=False, parent=None):
+		pkg, existing = self._wrapped_select_pkg_highest_available_imp(
+			root, atom, onlydeps=onlydeps, parent=parent)
 
 		default_selection = (pkg, existing)
 
@@ -4534,7 +4540,7 @@ class depgraph(object):
 					pkg, existing = \
 						self._wrapped_select_pkg_highest_available_imp(
 							root, atom, onlydeps=onlydeps,
-							autounmask_level=autounmask_level)
+							autounmask_level=autounmask_level, parent=parent)
 
 					if pkg is not None and \
 						pkg.installed and \
@@ -4740,7 +4746,7 @@ class depgraph(object):
 				self._dynamic_config._need_restart = True
 		return new_use
 
-	def _wrapped_select_pkg_highest_available_imp(self, root, atom, onlydeps=False, autounmask_level=None):
+	def _wrapped_select_pkg_highest_available_imp(self, root, atom, onlydeps=False, autounmask_level=None, parent=None):
 		root_config = self._frozen_config.roots[root]
 		pkgsettings = self._frozen_config.pkgsettings[root]
 		dbs = self._dynamic_config._filtered_trees[root]["dbs"]
@@ -5107,6 +5113,26 @@ class depgraph(object):
 			return existing_node, existing_node
 
 		if len(matched_packages) > 1:
+			if parent is not None and \
+				(parent.root, parent.slot_atom) in self._dynamic_config._slot_operator_replace_installed:
+				# We're forcing a rebuild of the parent because we missed some
+				# update because of a slot operator dep.
+				if atom.slot_operator == "=" and atom.sub_slot is None:
+					# This one is a slot operator dep. Exclude the installed packages if a newer non-installed
+					# pkg exists.
+					highest_installed = None
+					for pkg in matched_packages:
+						if pkg.installed:
+							if highest_installed is None or pkg.version > highest_installed.version:
+								highest_installed = pkg
+
+					if highest_installed:
+						non_installed = [pkg for pkg in matched_packages \
+							if not pkg.installed and pkg.version > highest_installed.version]
+
+						if non_installed:
+							matched_packages = non_installed
+
 			if rebuilt_binaries:
 				inst_pkg = None
 				built_pkg = None
@@ -5172,7 +5198,7 @@ class depgraph(object):
 		# ordered by type preference ("ebuild" type is the last resort)
 		return  matched_packages[-1], existing_node
 
-	def _select_pkg_from_graph(self, root, atom, onlydeps=False):
+	def _select_pkg_from_graph(self, root, atom, onlydeps=False, parent=None):
 		"""
 		Select packages that have already been added to the graph or
 		those that are installed and have not been scheduled for
@@ -5191,9 +5217,9 @@ class depgraph(object):
 				return pkg, pkg
 
 		# Fall back to installed packages
-		return self._select_pkg_from_installed(root, atom, onlydeps=onlydeps)
+		return self._select_pkg_from_installed(root, atom, onlydeps=onlydeps, parent=parent)
 
-	def _select_pkg_from_installed(self, root, atom, onlydeps=False):
+	def _select_pkg_from_installed(self, root, atom, onlydeps=False, parent=None):
 		"""
 		Select packages that are installed.
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-11-26 13:50 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2013-11-26 13:50 UTC (permalink / raw
  To: gentoo-commits

commit:     98f227be79361d83766b074403efd53f570fa3f3
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Nov 25 18:46:27 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Nov 26 09:14:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=98f227be

Show packages forcing rebuilds (bug 472104)

---
 pym/_emerge/depgraph.py | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7b77edc..a6efa63 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -619,6 +619,94 @@ class depgraph(object):
 		if self._frozen_config.spinner:
 			self._frozen_config.spinner.update()
 
+	def _compute_abi_rebuild_info(self):
+		"""
+		Fill self._forced_rebuilds with packages that cause rebuilds.
+		"""
+
+		debug = "--debug" in self._frozen_config.myopts
+
+		# Get all atoms that might have caused a forced rebuild.
+		atoms = {}
+		for s in self._dynamic_config._initial_arg_list:
+			if s.force_reinstall:
+				root = s.root_config.root
+				atoms.setdefault(root, set()).update(s.pset)
+
+		if debug:
+			writemsg_level("forced reinstall atoms:\n",
+				level=logging.DEBUG, noiselevel=-1)
+
+			for root in atoms:
+				writemsg_level("   root: %s\n" % root,
+					level=logging.DEBUG, noiselevel=-1)
+				for atom in atoms[root]:
+					writemsg_level("      atom: %s\n" % atom,
+						level=logging.DEBUG, noiselevel=-1)
+			writemsg_level("\n\n",
+				level=logging.DEBUG, noiselevel=-1)
+
+		# Go through all slot operator deps and check if one of these deps
+		# has a parent that is matched by one of the atoms from above.
+		forced_rebuilds = {}
+		for (root, slot_atom), deps in self._dynamic_config._slot_operator_deps.items():
+			if slot_atom not in atoms.get(root, []):
+				continue
+
+			for dep in deps:
+				if dep.parent.installed:
+					continue
+
+				# The child has forced a rebuild of the parent
+				forced_rebuilds.setdefault(root, {})
+				forced_rebuilds[root].setdefault(dep.child, set())
+				forced_rebuilds[root][dep.child].add(dep.parent)
+
+		if debug:
+			writemsg_level("slot operator dependencies:\n",
+				level=logging.DEBUG, noiselevel=-1)
+
+			for (root, slot_atom), deps in self._dynamic_config._slot_operator_deps.items():
+				writemsg_level("   (%s, %s)\n" % \
+					(root, slot_atom), level=logging.DEBUG, noiselevel=-1)
+				for dep in deps:
+					writemsg_level("      parent: %s\n" % dep.parent, level=logging.DEBUG, noiselevel=-1)
+					writemsg_level("        child: %s (%s)\n" % (dep.child, dep.priority), level=logging.DEBUG, noiselevel=-1)
+
+			writemsg_level("\n\n",
+				level=logging.DEBUG, noiselevel=-1)
+
+
+			writemsg_level("forced rebuilds:\n",
+				level=logging.DEBUG, noiselevel=-1)
+
+			for root in forced_rebuilds:
+				writemsg_level("   root: %s\n" % root,
+					level=logging.DEBUG, noiselevel=-1)
+				for child in forced_rebuilds[root]:
+					writemsg_level("      child: %s\n" % child,
+						level=logging.DEBUG, noiselevel=-1)
+					for parent in forced_rebuilds[root][child]:
+						writemsg_level("         parent: %s\n" % parent,
+							level=logging.DEBUG, noiselevel=-1)
+			writemsg_level("\n\n",
+				level=logging.DEBUG, noiselevel=-1)
+
+		self._forced_rebuilds = forced_rebuilds
+
+	def _show_abi_rebuild_info(self):
+
+		if not self._forced_rebuilds:
+			return
+
+		writemsg("\nThe following packages are causing rebuilds:\n\n", noiselevel=-1)
+
+		for root in self._forced_rebuilds:
+			for child in self._forced_rebuilds[root]:
+				writemsg("  %s causes rebuilds for:\n" % (child,), noiselevel=-1)
+				for parent in self._forced_rebuilds[root][child]:
+					writemsg("    %s\n" % (parent,), noiselevel=-1)
+
 	def _show_ignored_binaries(self):
 		"""
 		Show binaries that have been ignored because their USE didn't
@@ -7202,6 +7290,9 @@ class depgraph(object):
 		if not unresolved_conflicts:
 			self._show_missed_update()
 
+		self._compute_abi_rebuild_info()
+		self._show_abi_rebuild_info()
+
 		self._show_ignored_binaries()
 
 		self._display_autounmask()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-11-27  3:24 Mike Frysinger
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Frysinger @ 2013-11-27  3:24 UTC (permalink / raw
  To: gentoo-commits

commit:     719b1c87918426fa3ae8c389779dece18e12a9ea
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 27 03:23:45 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Nov 27 03:23:45 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=719b1c87

countdown: clean up & simplify a bit

---
 pym/_emerge/countdown.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/countdown.py b/pym/_emerge/countdown.py
index 5abdc8a..62e3c8d 100644
--- a/pym/_emerge/countdown.py
+++ b/pym/_emerge/countdown.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -8,15 +8,15 @@ import time
 
 from portage.output import colorize
 
-def countdown(secs=5, doing="Starting"):
+
+def countdown(secs=5, doing='Starting'):
 	if secs:
-		print(">>> Waiting",secs,"seconds before starting...")
-		print(">>> (Control-C to abort)...\n"+doing+" in: ", end=' ')
-		ticks=list(range(secs))
-		ticks.reverse()
-		for sec in ticks:
-			sys.stdout.write(colorize("UNMERGE_WARN", str(sec+1)+" "))
+		print(
+			'>>> Waiting %s seconds before starting...\n'
+			'>>> (Control-C to abort)...\n'
+			'%s in:' % (secs, doing), end='')
+		for sec in range(secs, 0, -1):
+			sys.stdout.write(colorize('UNMERGE_WARN', ' %i' % sec))
 			sys.stdout.flush()
 			time.sleep(1)
 		print()
-


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-11-28  3:06 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-11-28  3:06 UTC (permalink / raw
  To: gentoo-commits

commit:     e9cdbdef71988909cb32a63d4c2da2524641c142
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 28 03:04:32 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Thu Nov 28 03:04:32 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e9cdbdef

_emerge.depgraph.depgraph._compute_abi_rebuild_info(): Simplify some code.

---
 pym/_emerge/depgraph.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index da2e604..6634405 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -659,15 +659,13 @@ class depgraph(object):
 
 				# Make sure the child's slot/subslot has changed. If it hasn't,
 				# then another child has forced this rebuild.
-				installed_pkg, _ = self._select_pkg_from_installed(root, dep.child.slot_atom)
+				installed_pkg = self._select_pkg_from_installed(root, dep.child.slot_atom)[0]
 				if installed_pkg and installed_pkg.slot == dep.child.slot and \
 					installed_pkg.sub_slot == dep.child.sub_slot:
 					continue
 
 				# The child has forced a rebuild of the parent
-				forced_rebuilds.setdefault(root, {})
-				forced_rebuilds[root].setdefault(dep.child, set())
-				forced_rebuilds[root][dep.child].add(dep.parent)
+				forced_rebuilds.setdefault(root, {}).setdefault(dep.child, set()).add(dep.parent)
 
 		if debug:
 			writemsg_level("slot operator dependencies:\n",


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-11-28  9:20 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-11-28  9:20 UTC (permalink / raw
  To: gentoo-commits

commit:     25d15b99c1f3f0c84243cc3d80587009aeaa3673
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 28 09:19:20 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Thu Nov 28 09:19:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25d15b99

_emerge.depgraph.depgraph._show_abi_rebuild_info(): Write to stdout instead of stderr.

---
 pym/_emerge/depgraph.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6634405..b02d3473 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -704,13 +704,13 @@ class depgraph(object):
 		if not self._forced_rebuilds:
 			return
 
-		writemsg("\nThe following packages are causing rebuilds:\n\n", noiselevel=-1)
+		writemsg_stdout("\nThe following packages are causing rebuilds:\n\n", noiselevel=-1)
 
 		for root in self._forced_rebuilds:
 			for child in self._forced_rebuilds[root]:
-				writemsg("  %s causes rebuilds for:\n" % (child,), noiselevel=-1)
+				writemsg_stdout("  %s causes rebuilds for:\n" % (child,), noiselevel=-1)
 				for parent in self._forced_rebuilds[root][child]:
-					writemsg("    %s\n" % (parent,), noiselevel=-1)
+					writemsg_stdout("    %s\n" % (parent,), noiselevel=-1)
 
 	def _show_ignored_binaries(self):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-11-29 23:24 Mike Frysinger
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Frysinger @ 2013-11-29 23:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ac4d4449321e777f090ea415bba723ee4440ff8b
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Fri Nov 29 18:02:22 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 29 23:24:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ac4d4449

Use portage.const.TIMESTAMP_FORMAT where appropriate

---
 pym/_emerge/actions.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 86d67d2..9bb4774 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -39,7 +39,7 @@ from portage import shutil
 from portage import eapi_is_supported, _encodings, _unicode_decode
 from portage.cache.cache_errors import CacheError
 from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFAULT
-from portage.const import SUPPORTED_BINPKG_FORMATS
+from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.dep import Atom
@@ -2282,7 +2282,7 @@ def _sync_repo(emerge_config, repo):
 		if content:
 			try:
 				mytimestamp = time.mktime(time.strptime(content[0],
-					"%a, %d %b %Y %H:%M:%S +0000"))
+					TIMESTAMP_FORMAT))
 			except (OverflowError, ValueError):
 				pass
 		del content
@@ -2511,7 +2511,7 @@ def _sync_repo(emerge_config, repo):
 				if content:
 					try:
 						servertimestamp = time.mktime(time.strptime(
-							content[0], "%a, %d %b %Y %H:%M:%S +0000"))
+							content[0], TIMESTAMP_FORMAT))
 					except (OverflowError, ValueError):
 						pass
 				del mycommand, mypids, content


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-12-01 10:19 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2013-12-01 10:19 UTC (permalink / raw
  To: gentoo-commits

commit:     036b7211eb147422f7911c2c11a34a4046126135
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  1 09:58:50 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Dec  1 09:58:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=036b7211

Optimize out a common element for an early return.

---
 pym/_emerge/depgraph.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 622d288..343cc03 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2276,10 +2276,11 @@ class depgraph(object):
 		Don't ignore dependencies if pkg has a slot operator dependency on the child
 		and the child has changed slot/sub_slot.
 		"""
+		if not mypriority.satisfied:
+			return False
 		slot_operator_rebuild = False
 		if atom.slot_operator == '=' and \
 			(pkg.root, pkg.slot_atom) in self._dynamic_config._slot_operator_replace_installed and \
-			mypriority.satisfied and \
 			mypriority.satisfied is not child and \
 			mypriority.satisfied.installed and \
 			not child.installed and \
@@ -2288,7 +2289,6 @@ class depgraph(object):
 
 		return not atom.blocker and \
 			not recurse_satisfied and \
-			mypriority.satisfied and \
 			mypriority.satisfied.visible and \
 			dep.child is not None and \
 			not dep.child.installed and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-12-02  1:23 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2013-12-02  1:23 UTC (permalink / raw
  To: gentoo-commits

commit:     393277e856e17170f826dd5ddb8a4e475969cfc9
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  2 01:21:45 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Dec  2 01:22:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=393277e8

whitespace cleanup.

---
 pym/_emerge/depgraph.py | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 65b87d6..cd68db6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -511,7 +511,7 @@ class _dynamic_depgraph_config(object):
 class depgraph(object):
 
 	pkg_tree_map = RootConfig.pkg_tree_map
-	
+
 	def __init__(self, settings, trees, myopts, myparams, spinner,
 		frozen_config=None, backtrack_parameters=BacktrackParameter(), allow_backtracking=False):
 		if frozen_config is None:
@@ -927,7 +927,7 @@ class depgraph(object):
 
 		conflict = handler.get_conflict()
 		writemsg(conflict, noiselevel=-1)
-		
+
 		explanation = handler.get_explanation()
 		if explanation:
 			writemsg(explanation, noiselevel=-1)
@@ -2618,7 +2618,7 @@ class depgraph(object):
 	def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct):
 		"""
 		Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack.
-		Yields non-disjunctive deps. Raises InvalidDependString when 
+		Yields non-disjunctive deps. Raises InvalidDependString when
 		necessary.
 		"""
 		for x in dep_struct:
@@ -2742,7 +2742,7 @@ class depgraph(object):
 
 	def _select_files(self, myfiles):
 		"""Given a list of .tbz2s, .ebuilds sets, and deps, populate
-		self._dynamic_config._initial_arg_list and call self._resolve to create the 
+		self._dynamic_config._initial_arg_list and call self._resolve to create the
 		appropriate depgraph and return a favorite list."""
 		self._load_vdb()
 		debug = "--debug" in self._frozen_config.myopts
@@ -3070,7 +3070,7 @@ class depgraph(object):
 		# Order needs to be preserved since a feature of --nodeps
 		# is to allow the user to force a specific merge order.
 		self._dynamic_config._initial_arg_list = args[:]
-	
+
 		return self._resolve(myfavorites)
 
 	def _gen_reinstall_sets(self):
@@ -3100,8 +3100,8 @@ class depgraph(object):
 				root_config=self._frozen_config.roots[root])
 
 	def _resolve(self, myfavorites):
-		"""Given self._dynamic_config._initial_arg_list, pull in the root nodes, 
-		call self._creategraph to process theier deps and return 
+		"""Given self._dynamic_config._initial_arg_list, pull in the root nodes,
+		call self._creategraph to process theier deps and return
 		a favorite list."""
 		debug = "--debug" in self._frozen_config.myopts
 		onlydeps = "--onlydeps" in self._frozen_config.myopts
@@ -4817,7 +4817,7 @@ class depgraph(object):
 				# Ignore USE deps for the initial match since we want to
 				# ensure that updates aren't missed solely due to the user's
 				# USE configuration.
-				for pkg in self._iter_match_pkgs(root_config, pkg_type, atom.without_use, 
+				for pkg in self._iter_match_pkgs(root_config, pkg_type, atom.without_use,
 					onlydeps=onlydeps):
 					if pkg.cp != atom_cp and have_new_virt:
 						# pull in a new-style virtual instead
@@ -5444,7 +5444,7 @@ class depgraph(object):
 					return 0
 		return 1
 
-	def _pkg(self, cpv, type_name, root_config, installed=False, 
+	def _pkg(self, cpv, type_name, root_config, installed=False,
 		onlydeps=False, myrepo = None):
 		"""
 		Get a package instance from the cache, or create a new
@@ -5672,7 +5672,7 @@ class depgraph(object):
 			myroot = blocker.root
 			initial_db = self._frozen_config.trees[myroot]["vartree"].dbapi
 			final_db = self._dynamic_config.mydbapi[myroot]
-			
+
 			provider_virtual = False
 			if blocker.cp in virtuals and \
 				not self._have_new_virt(blocker.root, blocker.cp):
@@ -7818,7 +7818,7 @@ class depgraph(object):
 
 	def get_backtrack_infos(self):
 		return self._dynamic_config._backtrack_infos
-			
+
 
 class _dep_check_composite_db(dbapi):
 	"""
@@ -8027,14 +8027,14 @@ def _spinner_stop(spinner):
 
 	portage.writemsg_stdout("... done!\n")
 
-def backtrack_depgraph(settings, trees, myopts, myparams, 
+def backtrack_depgraph(settings, trees, myopts, myparams,
 	myaction, myfiles, spinner):
 	"""
 	Raises PackageSetNotFound if myfiles contains a missing package set.
 	"""
 	_spinner_start(spinner, myopts)
 	try:
-		return _backtrack_depgraph(settings, trees, myopts, myparams, 
+		return _backtrack_depgraph(settings, trees, myopts, myparams,
 			myaction, myfiles, spinner)
 	finally:
 		_spinner_stop(spinner)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2013-12-05 15:38 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2013-12-05 15:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c398a7e0a111081547ae1c4e5f723e0216310a57
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Dec  2 20:04:27 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec  5 15:05:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c398a7e0

Fix crash in _ignore_dependency

---
 pym/_emerge/depgraph.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index cd68db6..6600bc2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2283,6 +2283,7 @@ class depgraph(object):
 			(pkg.root, pkg.slot_atom) in self._dynamic_config._slot_operator_replace_installed and \
 			mypriority.satisfied is not child and \
 			mypriority.satisfied.installed and \
+			child and \
 			not child.installed and \
 			(child.slot != mypriority.satisfied.slot or child.sub_slot != mypriority.satisfied.sub_slot):
 			slot_operator_rebuild = True


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-01-26  7:31 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-01-26  7:31 UTC (permalink / raw
  To: gentoo-commits

commit:     1dca094d3fada99161e88d1cfc45c20c88483dbe
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jan 26 07:30:29 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun Jan 26 07:30:29 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1dca094d

Fix some DeprecationWarnings.

---
 pym/_emerge/MergeListItem.py | 14 +++-----------
 pym/_emerge/actions.py       |  6 ------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py
index 172dfcc..938f801 100644
--- a/pym/_emerge/MergeListItem.py
+++ b/pym/_emerge/MergeListItem.py
@@ -1,7 +1,8 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
+from portage.dep import _repo_separator
 from portage.output import colorize
 
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -59,16 +60,7 @@ class MergeListItem(CompositeTask):
 			(action_desc,
 			colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
 			colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)),
-			colorize(pkg_color, pkg.cpv))
-
-		portdb = pkg.root_config.trees["porttree"].dbapi
-		portdir_repo_name = portdb.getRepositoryName(portdb.porttree_root)
-		if portdir_repo_name:
-			pkg_repo_name = pkg.repo
-			if pkg_repo_name != portdir_repo_name:
-				if pkg_repo_name == pkg.UNKNOWN_REPO:
-					pkg_repo_name = "unknown repo"
-				msg += " from %s" % pkg_repo_name
+			colorize(pkg_color, pkg.cpv + _repo_separator + pkg.repo))
 
 		if pkg.root_config.settings["ROOT"] != "/":
 			msg += " %s %s" % (preposition, pkg.root)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index c401d39..95c5c14 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3544,12 +3544,6 @@ def repo_name_check(trees):
 		if porttree:
 			portdb = porttree.dbapi
 			missing_repo_names.update(portdb.getMissingRepoNames())
-			if portdb.porttree_root in missing_repo_names and \
-				not os.path.exists(os.path.join(
-				portdb.porttree_root, "profiles")):
-				# This is normal if $PORTDIR happens to be empty,
-				# so don't warn about it.
-				missing_repo_names.remove(portdb.porttree_root)
 
 	# Skip warnings about missing repo_name entries for
 	# /usr/local/portage (see bug #248603).


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-01-27  0:14 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-01-27  0:14 UTC (permalink / raw
  To: gentoo-commits

commit:     cf131a2d34b4e2333bdf1e8dc8cb28854abccbc2
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Sun Jan 19 19:30:41 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jan 27 00:08:38 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cf131a2d

Implement FEATURES="mirror" for emerge (bug 498498)

This was only implemented for the ebuild command before.
Acked by: Mike Frysinger <vapier <AT> gentoo.org>

---
 pym/_emerge/Scheduler.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d663e97..5873dbc 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -165,6 +165,8 @@ class Scheduler(PollScheduler):
 		self._build_opts.buildpkg_exclude = InternalPackageSet( \
 			initial_atoms=" ".join(myopts.get("--buildpkg-exclude", [])).split(), \
 			allow_wildcard=True, allow_repo=True)
+		if "mirror" in self.settings.features:
+			self._build_opts.fetch_all_uri = True
 
 		self._binpkg_opts = self._binpkg_opts_class()
 		for k in self._binpkg_opts.__slots__:
@@ -756,7 +758,8 @@ class Scheduler(PollScheduler):
 			prefetcher = EbuildFetcher(background=True,
 				config_pool=self._ConfigPool(pkg.root,
 				self._allocate_config, self._deallocate_config),
-				fetchonly=1, logfile=self._fetch_log,
+				fetchonly=1, fetchall=self._build_opts.fetch_all_uri,
+				logfile=self._fetch_log,
 				pkg=pkg, prefetch=True, scheduler=self._sched_iface)
 
 		elif pkg.type_name == "binary" and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-02-05 19:42 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-02-05 19:42 UTC (permalink / raw
  To: gentoo-commits

commit:     ae2103b5d8936b105edf2e5fba4c9b191f74415b
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Fri Jan 24 09:06:21 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Wed Feb  5 19:39:21 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ae2103b5

Replace _slot_collision_nodes with _package_tracker

---
 pym/_emerge/depgraph.py | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 484ac14..1bb086b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -378,9 +378,6 @@ class _dynamic_depgraph_config(object):
 		# This use used to check if we have accounted for blockers
 		# relevant to a package.
 		self._traversed_pkg_deps = set()
-		# Slot collision nodes are not allowed to block other packages since
-		# blocker validation is only able to account for one package per slot.
-		self._slot_collision_nodes = set()
 		self._parent_atoms = {}
 		self._slot_conflict_handler = None
 		self._circular_dependency_handler = None
@@ -1799,11 +1796,16 @@ class depgraph(object):
 		buildpkgonly = "--buildpkgonly" in self._frozen_config.myopts
 		nodeps = "--nodeps" in self._frozen_config.myopts
 		if dep.blocker:
+
+			# Slot collision nodes are not allowed to block other packages since
+			# blocker validation is only able to account for one package per slot.
+			is_slot_conflict_parent = any(dep.parent in conflict.pkgs[1:] for conflict in \
+				self._dynamic_config._package_tracker.slot_conflicts())
 			if not buildpkgonly and \
 				not nodeps and \
 				not dep.collapsed_priority.ignored and \
 				not dep.collapsed_priority.optional and \
-				dep.parent not in self._dynamic_config._slot_collision_nodes:
+				not is_slot_conflict_parent:
 				if dep.parent.onlydeps:
 					# It's safe to ignore blockers if the
 					# parent is an --onlydeps node.
@@ -2019,7 +2021,6 @@ class depgraph(object):
 								level=logging.DEBUG, noiselevel=-1)
 
 				else:
-					self._add_slot_conflict(pkg)
 					if debug:
 						writemsg_level(
 							"%s%s %s\n" % ("Slot Conflict:".ljust(15),
@@ -2138,9 +2139,6 @@ class depgraph(object):
 			self._dynamic_config._slot_operator_deps[slot_key] = slot_info
 		slot_info.append(dep)
 
-	def _add_slot_conflict(self, pkg):
-		self._dynamic_config._slot_collision_nodes.add(pkg)
-
 	def _add_pkg_deps(self, pkg, allow_unsatisfied=False):
 
 		myroot = pkg.root
@@ -6019,7 +6017,7 @@ class depgraph(object):
 
 		if "complete" not in self._dynamic_config.myparams and \
 			self._dynamic_config._allow_backtracking and \
-			self._dynamic_config._slot_collision_nodes and \
+			any(self._dynamic_config._package_tracker.slot_conflicts()) and \
 			not self._accept_blocker_conflicts():
 			self._dynamic_config.myparams["complete"] = True
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-02-05 19:42 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-02-05 19:42 UTC (permalink / raw
  To: gentoo-commits

commit:     c07bd5fd46d7b8adbdb4d8cf4d70bdc8fc66aea3
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Thu Jan 23 20:37:32 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Wed Feb  5 19:39:21 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c07bd5fd

Replace mydbapi with _package_tracker

---
 pym/_emerge/depgraph.py | 211 +++++++++++++++++++++++-------------------------
 1 file changed, 101 insertions(+), 110 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fd59dda..9d234c2 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -344,7 +344,6 @@ class _dynamic_depgraph_config(object):
 		self._allow_backtracking = allow_backtracking
 		# Maps nodes to the reasons they were selected for reinstallation.
 		self._reinstall_nodes = {}
-		self.mydbapi = {}
 		# Contains a filtered view of preferred packages that are selected
 		# from available repositories.
 		self._filtered_trees = {}
@@ -440,7 +439,6 @@ class _dynamic_depgraph_config(object):
 			# have after new packages have been installed.
 			fakedb = PackageTrackerDbapiWrapper(myroot, self._package_tracker)
 
-			self.mydbapi[myroot] = fakedb
 			def graph_tree():
 				pass
 			graph_tree.dbapi = fakedb
@@ -558,8 +556,6 @@ class depgraph(object):
 
 			if preload_installed_pkgs:
 				vardb = fake_vartree.dbapi
-				fakedb = self._dynamic_config._graph_trees[
-					myroot]["vartree"].dbapi
 
 				if not dynamic_deps:
 					for pkg in vardb:
@@ -724,25 +720,23 @@ class depgraph(object):
 
 		for pkg in list(self._dynamic_config.ignored_binaries):
 
-			selected_pkg = self._dynamic_config.mydbapi[pkg.root
-				].match_pkgs(pkg.slot_atom)
+			selected_pkg = list()
 
-			if not selected_pkg:
-				continue
+			for selected_pkg in self._dynamic_config._package_tracker.match(
+				pkg.root, pkg.slot_atom):
 
-			selected_pkg = selected_pkg[-1]
-			if selected_pkg > pkg:
-				self._dynamic_config.ignored_binaries.pop(pkg)
-				continue
+				if selected_pkg > pkg:
+					self._dynamic_config.ignored_binaries.pop(pkg)
+					break
 
-			if selected_pkg.installed and \
-				selected_pkg.cpv == pkg.cpv and \
-				selected_pkg.build_time == pkg.build_time:
-				# We don't care about ignored binaries when an
-				# identical installed instance is selected to
-				# fill the slot.
-				self._dynamic_config.ignored_binaries.pop(pkg)
-				continue
+				if selected_pkg.installed and \
+					selected_pkg.cpv == pkg.cpv and \
+					selected_pkg.build_time == pkg.build_time:
+					# We don't care about ignored binaries when an
+					# identical installed instance is selected to
+					# fill the slot.
+					self._dynamic_config.ignored_binaries.pop(pkg)
+					break
 
 		if not self._dynamic_config.ignored_binaries:
 			return
@@ -788,20 +782,25 @@ class depgraph(object):
 				# Exclude installed here since we only
 				# want to show available updates.
 				continue
-			chosen_pkg = self._dynamic_config.mydbapi[pkg.root
-				].match_pkgs(pkg.slot_atom)
-			if not chosen_pkg or chosen_pkg[-1] >= pkg:
-				continue
-			k = (pkg.root, pkg.slot_atom)
-			if k in missed_updates:
-				other_pkg, mask_type, parent_atoms = missed_updates[k]
-				if other_pkg > pkg:
-					continue
-			for mask_type, parent_atoms in mask_reasons.items():
-				if not parent_atoms:
-					continue
-				missed_updates[k] = (pkg, mask_type, parent_atoms)
-				break
+			missed_update = True
+			any_selected = False
+			for chosen_pkg in self._dynamic_config._package_tracker.match(
+				pkg.root, pkg.slot_atom):
+				any_selected = True
+				if chosen_pkg >= pkg:
+					missed_update = False
+					break
+			if any_selected and missed_update:
+				k = (pkg.root, pkg.slot_atom)
+				if k in missed_updates:
+					other_pkg, mask_type, parent_atoms = missed_updates[k]
+					if other_pkg > pkg:
+						continue
+				for mask_type, parent_atoms in mask_reasons.items():
+					if not parent_atoms:
+						continue
+					missed_updates[k] = (pkg, mask_type, parent_atoms)
+					break
 
 		return missed_updates
 
@@ -2040,16 +2039,13 @@ class depgraph(object):
 				# can show use flags and --tree portage.output.  This node is
 				# only being partially added to the graph.  It must not be
 				# allowed to interfere with the other nodes that have been
-				# added.  Do not overwrite data for existing nodes in
-				# self._dynamic_config.mydbapi since that data will be used for blocker
-				# validation.
+				# added.
 				# Even though the graph is now invalid, continue to process
 				# dependencies so that things like --fetchonly can still
 				# function despite collisions.
 				pass
 			elif not previously_added:
 				self._dynamic_config._package_tracker.add_pkg(pkg)
-				self._dynamic_config.mydbapi[pkg.root].cpv_inject(pkg)
 				self._dynamic_config._filtered_trees[pkg.root]["porttree"].dbapi._clear_cache()
 				self._dynamic_config._highest_pkg_cache.clear()
 				self._check_masks(pkg)
@@ -3639,35 +3635,37 @@ class depgraph(object):
 	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)
+
+		if not atom.cp.startswith("virtual/"):
 			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
+		any_match = False
+		for pkg in self._dynamic_config._package_tracker.match(root, atom):
+			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)
+				continue
+
+			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
+
+			any_match = True
+
+		if not any_match:
+			yield atom
 
 	def _virt_deps_visible(self, pkg, ignore_use=False):
 		"""
@@ -5524,10 +5522,14 @@ class depgraph(object):
 			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(
-				Package._gen_hash_key(cpv=cpv, type_name=type_name,
-				repo_name=myrepo, root_config=root_config,
-				installed=installed, onlydeps=False))
+			for candidate in self._dynamic_config._package_tracker.match(
+				root_config.root, cpv):
+				if candidate.type_name == type_name and \
+					candidate.repo_name == myrepo and \
+					candidate.root_config is root_config and \
+					candidate.installed == installed and \
+					not candidate.onlydeps:
+					pkg = candidate
 
 		if pkg is None:
 			tree_type = self.pkg_tree_map[type_name]
@@ -5587,7 +5589,8 @@ class depgraph(object):
 				vardb = self._frozen_config.trees[myroot]["vartree"].dbapi
 				pkgsettings = self._frozen_config.pkgsettings[myroot]
 				root_config = self._frozen_config.roots[myroot]
-				final_db = self._dynamic_config.mydbapi[myroot]
+				final_db = PackageTrackerDbapiWrapper(
+					myroot, self._dynamic_config._package_tracker)
 
 				blocker_cache = BlockerCache(myroot, vardb)
 				stale_cache = set(blocker_cache)
@@ -5604,7 +5607,7 @@ class depgraph(object):
 					# the merge process or by --depclean. Always warn about
 					# packages masked by license, since the user likely wants
 					# to adjust ACCEPT_LICENSE.
-					if pkg in final_db:
+					if pkg in self._dynamic_config._package_tracker:
 						if not self._pkg_visibility_check(pkg,
 							trust_graph=False) and \
 							(pkg_in_graph or 'LICENSE' in pkg.masks):
@@ -5686,9 +5689,10 @@ class depgraph(object):
 							del e
 							raise
 						if not success:
-							replacement_pkg = final_db.match_pkgs(pkg.slot_atom)
-							if replacement_pkg and \
-								replacement_pkg[0].operation == "merge":
+							replacement_pkgs = self._dynamic_config._package_tracker.match(
+								myroot, pkg.slot_atom)
+							if any(replacement_pkg[0].operation == "merge" for \
+								replacement_pkg in replacement_pkgs):
 								# This package is being replaced anyway, so
 								# ignore invalid dependencies so as not to
 								# annoy the user too much (otherwise they'd be
@@ -5733,7 +5737,6 @@ class depgraph(object):
 			virtuals = root_config.settings.getvirtuals()
 			myroot = blocker.root
 			initial_db = self._frozen_config.trees[myroot]["vartree"].dbapi
-			final_db = self._dynamic_config.mydbapi[myroot]
 
 			provider_virtual = False
 			if blocker.cp in virtuals and \
@@ -5761,7 +5764,7 @@ class depgraph(object):
 
 			blocked_final = set()
 			for atom in atoms:
-				for pkg in final_db.match_pkgs(atom):
+				for pkg in self._dynamic_config._package_tracker.match(myroot, atom):
 					if atom_set.findAtomForPackage(pkg, modified_use=self._pkg_use_enabled(pkg)):
 						blocked_final.add(pkg)
 
@@ -5943,19 +5946,15 @@ class depgraph(object):
 		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)
+				for pkg in self._dynamic_config._package_tracker.match(root, atom):
+					if pkg.operation == "merge" and \
+						not vardb.cpv_exists(pkg.cpv):
+						libc_pkgs.setdefault(pkg.root, set()).add(pkg)
 
 		if not libc_pkgs:
 			return
@@ -6156,8 +6155,8 @@ class depgraph(object):
 			initial_atoms=[PORTAGE_PACKAGE_ATOM])
 		running_portage = self._frozen_config.trees[running_root]["vartree"].dbapi.match_pkgs(
 			PORTAGE_PACKAGE_ATOM)
-		replacement_portage = self._dynamic_config.mydbapi[running_root].match_pkgs(
-			PORTAGE_PACKAGE_ATOM)
+		replacement_portage = list(self._dynamic_config._package_tracker.match(
+			running_root, Atom(PORTAGE_PACKAGE_ATOM)))
 
 		if running_portage:
 			running_portage = running_portage[0]
@@ -6194,18 +6193,15 @@ class depgraph(object):
 		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)
+
+				for pkg in self._dynamic_config._package_tracker.match(root, atom):
+					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
@@ -6214,13 +6210,11 @@ class depgraph(object):
 					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)
+
+					for pkg in self._dynamic_config._package_tracker.match(root, atom):
+						if pkg.operation == "merge" and \
+							not vardb.cpv_exists(pkg.cpv):
+							asap_nodes.append(pkg)
 
 				asap_nodes.extend(libc_pkgs)
 
@@ -6562,13 +6556,12 @@ class depgraph(object):
 						# For packages in the world set, go ahead an uninstall
 						# when necessary, as long as the atom will be satisfied
 						# in the final state.
-						graph_db = self._dynamic_config.mydbapi[task.root]
 						skip = False
 						try:
 							for atom in root_config.sets[
 								"selected"].iterAtomsForPackage(task):
 								satisfied = False
-								for pkg in graph_db.match_pkgs(atom):
+								for pkg in self._dynamic_config._package_tracker.match(task.root, atom):
 									if pkg == inst_pkg:
 										continue
 									satisfied = True
@@ -6650,12 +6643,11 @@ class depgraph(object):
 					# node unnecessary (due to occupying the same SLOT),
 					# and we want to avoid executing a separate uninstall
 					# task in that case.
-					slot_node = self._dynamic_config.mydbapi[uninst_task.root
-						].match_pkgs(uninst_task.slot_atom)
-					if slot_node and \
-						slot_node[0].operation == "merge":
-						mygraph.add(slot_node[0], uninst_task,
-							priority=BlockerDepPriority.instance)
+					for slot_node in self._dynamic_config._package_tracker.match(
+						uninst_task.root, uninst_task.slot_atom):
+						if slot_node.operation == "merge":
+							mygraph.add(slot_node, uninst_task,
+								priority=BlockerDepPriority.instance)
 
 					# Reset the state variables for leaf node selection and
 					# continue trying to select leaf nodes.
@@ -7624,7 +7616,6 @@ class depgraph(object):
 		else:
 			args = []
 
-		fakedb = self._dynamic_config.mydbapi
 		serialized_tasks = []
 		masked_tasks = []
 		for x in mergelist:
@@ -7682,7 +7673,7 @@ class depgraph(object):
 					self._dynamic_config._unsatisfied_deps_for_display.append(
 						((pkg.root, "="+pkg.cpv), {"myparent":None}))
 
-			fakedb[myroot].cpv_inject(pkg)
+			self._dynamic_config._package_tracker.add_pkg(pkg)
 			serialized_tasks.append(pkg)
 			self._spinner_update()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-02-05 19:42 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-02-05 19:42 UTC (permalink / raw
  To: gentoo-commits

commit:     15b89363ddc6633ba54e0d84d4daca1f6e2127c8
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Jan 27 22:10:32 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Wed Feb  5 19:39:21 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=15b89363

Package.__str__: show slot/sub-slot

---
 pym/_emerge/Package.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index c795568..a09f73c 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -468,7 +468,8 @@ class Package(Task):
 			cpv_color = "PKG_NOMERGE"
 
 		s = "(%s, %s" \
-			% (portage.output.colorize(cpv_color, self.cpv + _repo_separator + self.repo) , self.type_name)
+			% (portage.output.colorize(cpv_color, self.cpv + _slot_separator + \
+			self.slot + "/" + self.sub_slot + _repo_separator + self.repo) , self.type_name)
 
 		if self.type_name == "installed":
 			if self.root_config.settings['ROOT'] != "/":


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-02-17 20:35 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-02-17 20:35 UTC (permalink / raw
  To: gentoo-commits

commit:     fd34dec7a068af2785de8329fb31e614f00e7958
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Fri Feb 14 21:13:50 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Mon Feb 17 20:34:24 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fd34dec7

Remove bogus countdown during clean list printing (bug 501296)

Before this patch a fake unmerge countdown would be shown
after an @system package was printed. If the users aborts
at this point, it looked as if some packages were missing
from the clean list compared to the --pretend output.

---
 pym/_emerge/unmerge.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index b46b89c..f632a97 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -457,9 +457,6 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 			writemsg_level(colorize("WARN","!!! Unmerging it may " + \
 				"be damaging to your system.\n\n"),
 				level=logging.WARNING, noiselevel=-1)
-			if clean_delay and "--pretend" not in myopts and "--ask" not in myopts:
-				countdown(int(settings["EMERGE_WARNING_DELAY"]),
-					colorize("UNMERGE_WARN", "Press Ctrl-C to Stop"))
 		if not quiet:
 			writemsg_level("\n %s\n" % (bold(cp),), noiselevel=-1)
 		else:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-03-02  3:15 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-03-02  3:15 UTC (permalink / raw
  To: gentoo-commits

commit:     d1108443f074df3a898a304239dc78cab1616629
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  6 09:45:14 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Mar  2 03:11:02 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d1108443

As per bug #472104 add option --verbose-slot-rebuilds=y|n

---
 pym/_emerge/depgraph.py | 5 +++--
 pym/_emerge/main.py     | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 835bd6b..04d7aae 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7692,8 +7692,9 @@ class depgraph(object):
 		if not unresolved_conflicts:
 			self._show_missed_update()
 
-		self._compute_abi_rebuild_info()
-		self._show_abi_rebuild_info()
+		if self._frozen_config.myopts.get("--verbose-slot-rebuilds", 'y') != 'n':
+			self._compute_abi_rebuild_info()
+			self._show_abi_rebuild_info()
 
 		self._show_ignored_binaries()
 

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 6225fc9..1e21ddb 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -156,6 +156,7 @@ def insert_optional_args(args):
 		'--usepkg'               : y_or_n,
 		'--usepkgonly'           : y_or_n,
 		'--verbose'              : y_or_n,
+		'--verbose-slot-rebuilds': y_or_n,
 	}
 
 	short_arg_opts = {
@@ -640,6 +641,10 @@ def parse_opts(tmpcmdline, silent=False):
 			"help"     : "verbose output",
 			"choices"  : true_y_or_n
 		},
+		"--verbose-slot-rebuilds": {
+			"help"     : "verbose slot rebuild output",
+			"choices"  : true_y_or_n
+		},
 	}
 
 	parser = ArgumentParser(add_help=False)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-03-02  3:15 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-03-02  3:15 UTC (permalink / raw
  To: gentoo-commits

commit:     a830a9acaa265a9558f1fa9aeaa3f814631494b9
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  7 07:56:30 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Mar  2 03:11:02 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a830a9ac

Whitespace cleanup

---
 pym/_emerge/actions.py | 4 ++--
 pym/_emerge/main.py    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 19659fd..2a1354b 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3486,7 +3486,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
 	unmerge_actions = ("unmerge", "prune", "clean", "depclean")
 
 	for a in myfiles:
-		if a.startswith(SETPREFIX):		
+		if a.startswith(SETPREFIX):
 				s = a[len(SETPREFIX):]
 				if s not in sets:
 					display_missing_pkg_set(root_config, s)
@@ -3750,7 +3750,7 @@ def run_action(emerge_config):
 		if retval != os.EX_OK:
 			return retval
 
-		# Need to handle empty sets specially, otherwise emerge will react 
+		# Need to handle empty sets specially, otherwise emerge will react
 		# with the help message for empty argument lists
 		if oldargs and not newargs:
 			print("emerge: no targets left after set expansion")

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 1e21ddb..38bbd77 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -81,7 +81,7 @@ COWSAY_MOO = """
  -----------------------
         \   ^__^
          \  (oo)\_______
-            (__)\       )\/\ 
+            (__)\       )\/\
                 ||----w |
                 ||     ||
 
@@ -583,7 +583,7 @@ def parse_opts(tmpcmdline, silent=False):
 			             "packages that have been rebuilt",
 			"choices"  : true_y_or_n
 		},
-		
+
 		"--rebuilt-binaries-timestamp": {
 			"help"   : "use only binaries that are newer than this " + \
 			           "timestamp for --rebuilt-binaries",
@@ -893,7 +893,7 @@ def parse_opts(tmpcmdline, silent=False):
 					(myoptions.load_average,))
 
 		myoptions.load_average = load_average
-	
+
 	if myoptions.rebuilt_binaries_timestamp:
 		try:
 			rebuilt_binaries_timestamp = int(myoptions.rebuilt_binaries_timestamp)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-03-23 16:31 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2014-03-23 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     e03499b7466bc053bc31ced89e4a890f516be7a3
Author:     eroen@falcon.eroen.eu <eroen <AT> falcon <DOT> eroen <DOT> eu>
AuthorDate: Sun Mar 23 15:58:59 2014 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Sun Mar 23 16:27:13 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e03499b7

pym/_emerge/main.py: Fix --moo output

Fixes bug introduced by:
* commit a830a9acaa265a9558f1fa9aeaa3f814631494b9
| Summary:    Whitespace cleanup
| Author:     Brian Dolbec <dolsen <AT> gentoo.org>
| AuthorDate: Mon Jan 6 23:56:30 2014 -0800
| CommitDate: Sat Mar 1 19:11:02 2014 -0800

---
 pym/_emerge/main.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 38bbd77..cfe1332 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -81,7 +81,7 @@ COWSAY_MOO = """
  -----------------------
         \   ^__^
          \  (oo)\_______
-            (__)\       )\/\
+            (__)\       )\/\\
                 ||----w |
                 ||     ||
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-03-24 18:28 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-03-24 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     a2b43472c6686def6ff92251fdfa8487acd03051
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Mar 24 17:20:46 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Mon Mar 24 17:20:46 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2b43472

_compute_abi_rebuild_info: deal with non-Package parents

---
 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f27e855..abb70a7 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -643,7 +643,7 @@ class depgraph(object):
 			rebuild_atoms = atoms.get(root, set())
 
 			for dep in deps:
-				if dep.parent.installed or dep.child.installed or \
+				if getattr(dep.parent, "installed", False) or dep.child.installed or \
 					dep.parent.slot_atom not in rebuild_atoms:
 					continue
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-03-24 18:28 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-03-24 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d10a23b9c744a353772d0be89ba5f49a34b5220d
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Mar 24 17:11:33 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Mon Mar 24 17:11:33 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d10a23b9

Fix bug in _remove_pkg logic (bug 505422)

---
 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 04d7aae..f27e855 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2431,7 +2431,8 @@ class depgraph(object):
 		self._dynamic_config._blocked_world_pkgs.pop(pkg, None)
 
 		for child in children:
-			if not self._dynamic_config.digraph.parent_nodes(child):
+			if child in self._dynamic_config.digraph and \
+				not self._dynamic_config.digraph.parent_nodes(child):
 				self._remove_pkg(child)
 
 		# Clear caches.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-04-04 23:01 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-04-04 23:01 UTC (permalink / raw
  To: gentoo-commits

commit:     2bca0671b20207b391c58453892b8158b90b128f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 29 18:45:29 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Apr  4 22:55:41 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2bca0671

emerge: call setlocale() to enable system locale

This is necessary so that the size formatting function (and possibly
other locale-dependant functions in the future) respect the system
locale rather than using the 'C' locale.

---
 pym/_emerge/main.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index cfe1332..eddb16c 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -3,6 +3,7 @@
 
 from __future__ import print_function
 
+import locale
 import platform
 import sys
 
@@ -984,6 +985,9 @@ def emerge_main(args=None):
 
 	args = portage._decode_argv(args)
 
+	# Use system locale.
+	locale.setlocale(locale.LC_ALL, '')
+
 	# Disable color until we're sure that it should be enabled (after
 	# EMERGE_DEFAULT_OPTS has been parsed).
 	portage.output.havecolor = 0


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-04-04 23:01 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-04-04 23:01 UTC (permalink / raw
  To: gentoo-commits

commit:     3b40006e89d035398434bbc5dd61e727d385ed39
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 29 20:21:01 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Apr  4 22:55:18 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3b40006e

TaskSequence.py: Fix queue starting (bug 506186)

start_next_task() was making sure there was actually a task to start.

---
 pym/_emerge/TaskSequence.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/TaskSequence.py b/pym/_emerge/TaskSequence.py
index 1fecf63..b4bfefe 100644
--- a/pym/_emerge/TaskSequence.py
+++ b/pym/_emerge/TaskSequence.py
@@ -30,8 +30,9 @@ class TaskSequence(CompositeTask):
 		CompositeTask._cancel(self)
 
 	def _start_next_task(self):
-		self._start_task(self._task_queue.popleft(),
-			self._task_exit_handler)
+		if self._task_queue:
+			self._start_task(self._task_queue.popleft(),
+				self._task_exit_handler)
 
 	def _task_exit_handler(self, task):
 		if self._default_exit(task) != os.EX_OK:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-04-05 13:05 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2014-04-05 13:05 UTC (permalink / raw
  To: gentoo-commits

commit:     027bac6855b66b7db997a9cf6b4e33ff7ee85ba2
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  5 12:58:14 2014 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Sat Apr  5 13:04:20 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=027bac68

depgraph: Improve mismatch checking (bug 505944)

Make sure dep.atom and dep.atom.unevaluated_atom is set to something
before checking for mismatch between them.

This fixes a known bug where a typo like 'emerge -pvuDNworld' would
produce a traceback if the user had a resume list.

---
 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index abb70a7..737ed66 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2211,7 +2211,8 @@ class depgraph(object):
 				# Display the specific atom from SetArg or
 				# Package types.
 				uneval = ""
-				if dep.atom is not dep.atom.unevaluated_atom:
+				if dep.atom and dep.atom.unevaluated_atom and \
+						dep.atom is not dep.atom.unevaluated_atom:
 					uneval = " (%s)" % (dep.atom.unevaluated_atom,)
 				writemsg_level(
 					"%s%s%s required by %s\n" %


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-04-18 19:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-04-18 19:50 UTC (permalink / raw
  To: gentoo-commits

commit:     cb7d234d24bcada5e486ab1975d3592ac5af7218
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 18 19:50:15 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 18 19:50:15 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb7d234d

EbuildBuild: handle empty PORTAGE_BINPKG_FORMAT

Also, make TaskSequence._start_next_task() call exit hooks if the
queue happens to be empty.

X-Gentoo-Bug: 506186
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506186

---
 pym/_emerge/EbuildBuild.py  |  9 +++++++--
 pym/_emerge/TaskSequence.py | 26 +++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index e13b1cf..86a5631 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildExecuter import EbuildExecuter
@@ -321,7 +321,12 @@ class EbuildBuild(CompositeTask):
 						pkg=self.pkg, scheduler=self.scheduler,
 						settings=self.settings))
 
-		self._start_task(binpkg_tasks, self._buildpkg_exit)
+		if binpkg_tasks:
+			self._start_task(binpkg_tasks, self._buildpkg_exit)
+			return
+
+		self._final_exit(build)
+		self.wait()
 
 	def _buildpkg_exit(self, packager):
 		"""

diff --git a/pym/_emerge/TaskSequence.py b/pym/_emerge/TaskSequence.py
index b4bfefe..1f2ba94 100644
--- a/pym/_emerge/TaskSequence.py
+++ b/pym/_emerge/TaskSequence.py
@@ -1,10 +1,12 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import sys
+from collections import deque
+
 from portage import os
 from _emerge.CompositeTask import CompositeTask
 from _emerge.AsynchronousTask import AsynchronousTask
-from collections import deque
 
 class TaskSequence(CompositeTask):
 	"""
@@ -30,9 +32,15 @@ class TaskSequence(CompositeTask):
 		CompositeTask._cancel(self)
 
 	def _start_next_task(self):
-		if self._task_queue:
-			self._start_task(self._task_queue.popleft(),
-				self._task_exit_handler)
+		try:
+			task = self._task_queue.popleft()
+		except IndexError:
+			self._current_task = None
+			self.returncode = os.EX_OK
+			self.wait()
+			return
+
+		self._start_task(task, self._task_exit_handler)
 
 	def _task_exit_handler(self, task):
 		if self._default_exit(task) != os.EX_OK:
@@ -43,3 +51,11 @@ class TaskSequence(CompositeTask):
 			self._final_exit(task)
 			self.wait()
 
+	def __bool__(self):
+		return bool(self._task_queue)
+
+	if sys.hexversion < 0x3000000:
+		__nonzero__ = __bool__
+
+	def __len__(self):
+		return len(self._task_queue)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-04-19  5:44 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-04-19  5:44 UTC (permalink / raw
  To: gentoo-commits

commit:     54e439500e9c95582973c2350f293796b9455d44
Author:     Douglas Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Sun Apr  6 09:09:08 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Apr 19 05:34:33 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=54e43950

emerge/actions: Add python version to portage version line

Adds the currently running python version to the portage version line,
so that it's immediately obvious what version of python is being used to
run portage.

---
 pym/_emerge/actions.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 2a1354b..ff72d70 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2996,6 +2996,7 @@ def relative_profile_path(portdir, abs_profile):
 	return profilever
 
 def getportageversion(portdir, _unused, profile, chost, vardb):
+	pythonver = 'python %d.%d.%d-%s-%d' % sys.version_info[:]
 	profilever = None
 	repositories = vardb.settings.repositories
 	if profile:
@@ -3051,8 +3052,8 @@ def getportageversion(portdir, _unused, profile, chost, vardb):
 	gccver = getgccversion(chost)
 	unameout=platform.release()+" "+platform.machine()
 
-	return "Portage %s (%s, %s, %s, %s)" % \
-		(portage.VERSION, profilever, gccver, ",".join(libcver), unameout)
+	return "Portage %s (%s, %s, %s, %s, %s)" % \
+		(portage.VERSION, pythonver, profilever, gccver, ",".join(libcver), unameout)
 
 def git_sync_timestamps(portdb, portdir):
 	"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-05-18  8:02 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-05-18  8:02 UTC (permalink / raw
  To: gentoo-commits

commit:     3f110090e50207d4ae3f6031ce6b1beafc80de46
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun May 18 08:00:50 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun May 18 08:00:50 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f110090

Bug #510538: Include "::repository" in more messages.

---
 pym/_emerge/PackageMerge.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/PackageMerge.py b/pym/_emerge/PackageMerge.py
index ef298ca..fa2102f 100644
--- a/pym/_emerge/PackageMerge.py
+++ b/pym/_emerge/PackageMerge.py
@@ -1,7 +1,8 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.CompositeTask import CompositeTask
+from portage.dep import _repo_separator
 from portage.output import colorize
 class PackageMerge(CompositeTask):
 	__slots__ = ("merge",)
@@ -29,7 +30,7 @@ class PackageMerge(CompositeTask):
 		msg = "%s %s%s" % \
 			(action_desc,
 			counter_str,
-			colorize(pkg_color, pkg.cpv))
+			colorize(pkg_color, pkg.cpv + _repo_separator + pkg.repo))
 
 		if pkg.root_config.settings["ROOT"] != "/":
 			msg += " %s %s" % (preposition, pkg.root)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-06-08 11:06 Sebastian Luther
  0 siblings, 0 replies; 804+ messages in thread
From: Sebastian Luther @ 2014-06-08 11:06 UTC (permalink / raw
  To: gentoo-commits

commit:     057aba82c112c3933560d83d20fcfc971fc471da
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Sun Jun  8 11:01:54 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Sun Jun  8 11:01:54 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=057aba82

More debug output for the slot conflict handler

---
 pym/_emerge/depgraph.py | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 28d4026..4acb114 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -990,6 +990,11 @@ class depgraph(object):
 		if not conflicts:
 			return
 
+		if debug:
+			writemsg_level(
+				"\n!!! Slot conflict handler started.\n",
+				level=logging.DEBUG, noiselevel=-1)
+
 		# Get a set of all conflicting packages.
 		conflict_pkgs = set()
 		for conflict in conflicts:
@@ -1044,6 +1049,13 @@ class depgraph(object):
 				return "(%s)" % ",".join(str(pkg) for pkg in self)
 
 		for conflict in conflicts:
+			if debug:
+				writemsg_level("   conflict:\n", level=logging.DEBUG, noiselevel=-1)
+				writemsg_level("      root: %s\n" % conflict.root, level=logging.DEBUG, noiselevel=-1)
+				writemsg_level("      atom: %s\n" % conflict.atom, level=logging.DEBUG, noiselevel=-1)
+				for pkg in conflict:
+					writemsg_level("      pkg: %s\n" % pkg, level=logging.DEBUG, noiselevel=-1)
+
 			all_parent_atoms = set()
 			for pkg in conflict:
 				all_parent_atoms.update(
@@ -1051,9 +1063,16 @@ class depgraph(object):
 
 			for parent, atom in all_parent_atoms:
 				is_arg_parent = isinstance(parent, AtomArg)
+				is_non_conflict_parent = parent not in conflict_pkgs and \
+					parent not in indirect_conflict_pkgs
 
-				if parent not in conflict_pkgs and \
-					parent not in indirect_conflict_pkgs:
+				if debug:
+					writemsg_level("      parent: %s\n" % parent, level=logging.DEBUG, noiselevel=-1)
+					writemsg_level("      arg, non-conflict: %s, %s\n" % (is_arg_parent, is_non_conflict_parent),
+						level=logging.DEBUG, noiselevel=-1)
+					writemsg_level("         atom: %s\n" % atom, level=logging.DEBUG, noiselevel=-1)
+
+				if is_non_conflict_parent:
 					parent = non_conflict_node
 
 				atom_set = InternalPackageSet(
@@ -1065,6 +1084,11 @@ class depgraph(object):
 						modified_use=self._pkg_use_enabled(pkg)) and \
 						not (is_arg_parent and pkg.installed):
 						matched.append(pkg)
+
+				if debug:
+					for match in matched:
+						writemsg_level("         match: %s\n" % match, level=logging.DEBUG, noiselevel=-1)
+
 				if len(matched) == len(conflict):
 					# All packages match.
 					continue


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-06-14  2:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-06-14  2:58 UTC (permalink / raw
  To: gentoo-commits

commit:     1066e75109f078841b30d2d01ebd297d0b542559
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 14 02:58:26 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 02:58:26 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1066e751

depgraph: handle argument/set parents more

---
 pym/_emerge/depgraph.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4acb114..bede7c6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -643,7 +643,10 @@ class depgraph(object):
 			rebuild_atoms = atoms.get(root, set())
 
 			for dep in deps:
-				if getattr(dep.parent, "installed", False) or dep.child.installed or \
+				if not isinstance(dep.parent, Package):
+					continue
+
+				if dep.parent.installed or dep.child.installed or \
 					dep.parent.slot_atom not in rebuild_atoms:
 					continue
 
@@ -1360,6 +1363,10 @@ class depgraph(object):
 		found_update = False
 		for parent_atom, conflict_pkgs in conflict_atoms.items():
 			parent, atom = parent_atom
+
+			if not isinstance(parent, Package):
+				continue
+
 			if atom.slot_operator != "=" or not parent.built:
 				continue
 
@@ -1564,7 +1571,7 @@ class depgraph(object):
 			slot operator parents.
 			"""
 			for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []):
-				if atom.slot_operator == "=" and parent.built:
+				if atom.slot_operator == "=" and getattr(parent, "built", False):
 					continue
 
 				atom_set = InternalPackageSet(initial_atoms=(atom,),


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-06-14 20:58 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2014-06-14 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     ab02c3fd788da6cc36188cdbee62a2b22bbc2474
Author:     Alexander Berntsen <alexander <AT> plaimi <DOT> net>
AuthorDate: Mon Oct  7 10:39:50 2013 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 20:46:28 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab02c3fd

emerge: Don't split suggestion (bug 487074)

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 pym/_emerge/actions.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ff72d70..4ca2f1c 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -557,10 +557,9 @@ def action_depclean(settings, trees, ldpath_mtimes,
 	msg.append("\n")
 	msg.append("As a safety measure, depclean will not remove any packages\n")
 	msg.append("unless *all* required dependencies have been resolved.  As a\n")
-	msg.append("consequence, it is often necessary to run %s\n" % \
-		good("`emerge --update"))
-	msg.append(good("--newuse --deep @world`") + \
-		" prior to depclean.\n")
+	msg.append("consequence of this, it often becomes necessary to run \n")
+	msg.append("%s" % good("`emerge --update --newuse --deep @world`")
+			+ " prior to depclean.\n")
 
 	if action == "depclean" and "--quiet" not in myopts and not myfiles:
 		portage.writemsg_stdout("\n")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
  2014-08-03 15:24 [gentoo-commits] proj/portage:v2.2.11 " Brian Dolbec
@ 2014-08-03 15:22 ` Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-08-03 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     28d99141248063abd28a562cbc86eef897ad08af
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  3 14:22:37 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Aug  3 14:22:37 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=28d99141

pym/_emerge/Binpkg.py: Add missing line feed to output.

---
 pym/_emerge/Binpkg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index a740efd..c0f0951 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -344,7 +344,7 @@ class Binpkg(CompositeTask):
 	def _chpathtool_exit(self, chpathtool):
 		if self._final_exit(chpathtool) != os.EX_OK:
 			self._unlock_builddir()
-			self._writemsg_level("!!! Error Adjusting Prefix to %s" %
+			self._writemsg_level("!!! Error Adjusting Prefix to %s\n" %
 				(self.settings["EPREFIX"],),
 				noiselevel=-1, level=logging.ERROR)
 			self.wait()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-04  1:55 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-08-04  1:55 UTC (permalink / raw
  To: gentoo-commits

commit:     2830df3b297f7caa84306316112d5485ad45b5b7
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  4 01:49:18 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Aug  4 01:54:14 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2830df3b

pym/_emerge/depgrapgh.py: Fix bug 518968

Fixes commit: 1a00ddf5fb089724a127c8dc72d63f10ae72abbf
Author: Alexander Berntsen <bernalex <AT> gentoo.org> (Thu 08 May 2014 08:47:58 AM PDT)
Subject: emerge: Implement "--alert"

self.query was not assigned using the correct UserQuery instance.
self.uq was not used by anything anywhere.  This patch consolidates it to the one initialized instance in 1 line of code.
Original bug reproduced and fixed by: Mike Gilbert <floppym <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8177b74..acb1db1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -520,8 +520,7 @@ class depgraph(object):
 		self._event_loop = (portage._internal_caller and
 			global_event_loop() or EventLoop(main=False))
 
-		self.uq = UserQuery(myopts)
-		self.query = UserQuery.query
+		self.query = UserQuery(myopts).query
 
 	def _load_vdb(self):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-10  0:10 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-08-10  0:10 UTC (permalink / raw
  To: gentoo-commits

commit:     d40b4f1b0b21de67286a47aa10632e40996f6d06
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  6 21:39:14 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Aug  9 23:38:02 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d40b4f1b

emerge: fix invalid locale setting (bug 519074)

Don't die when the user has an invalid locale setting.
Resolves bug 519074.

---
 pym/_emerge/main.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 1a920f7..52aa9c5 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -999,7 +999,10 @@ def emerge_main(args=None):
 	args = portage._decode_argv(args)
 
 	# Use system locale.
-	locale.setlocale(locale.LC_ALL, '')
+	try:
+		locale.setlocale(locale.LC_ALL, '')
+	except locale.Error as e:
+		writemsg_level("setlocale: %s\n" % e, level=logging.WARN)
 
 	# Disable color until we're sure that it should be enabled (after
 	# EMERGE_DEFAULT_OPTS has been parsed).


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-11 20:26 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2014-08-11 20:26 UTC (permalink / raw
  To: gentoo-commits

commit:     910d073d04e01cbe24b300b9dc33697e9ca48b72
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 12 16:53:50 2014 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Mon Aug 11 20:22:19 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=910d073d

emerge: Prepend '=' to unmerge atoms (bug 512578)

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Reviewed-By:   Brian Dolbec       <dolsen <AT> gentoo.org>
Reviewed-By:   Michał Górny       <mgorny <AT> gentoo.org>

---
 pym/_emerge/unmerge.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 8f98563..30b1930 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -488,7 +488,8 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 		if quiet:
 			writemsg_level("\n", noiselevel=-1)
 
-	writemsg_level("\nAll selected packages: %s\n" % " ".join(all_selected), noiselevel=-1)
+	writemsg_level("\nAll selected packages: %s\n" %
+				" ".join('=%s' % x for x in all_selected), noiselevel=-1)
 
 	writemsg_level("\n>>> " + colorize("UNMERGE_WARN", "'Selected'") + \
 		" packages are slated for removal.\n")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-12 18:27 Michał Górny
  2014-08-19  7:01 ` Michał Górny
  0 siblings, 1 reply; 804+ messages in thread
From: Michał Górny @ 2014-08-12 18:27 UTC (permalink / raw
  To: gentoo-commits

commit:     269aa06166e36a56219c13258cc53f0fa6e18609
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 12 18:21:16 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 12 18:25:50 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=269aa061

--sync: Decode getaddrinfo() errors properly

Fixes UnicodeDecodeError in Python 2 with getaddrinfo() error messages
that contain non-ASCII characters, e.g. in pl_PL.UTF-8 locale.

Reviewed-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/actions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e482744..66e18a4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2345,7 +2345,8 @@ def _sync_repo(emerge_config, repo):
 				family, socket.SOCK_STREAM))
 		except socket.error as e:
 			writemsg_level(
-				"!!! getaddrinfo failed for '%s': %s\n" % (hostname, e),
+				"!!! getaddrinfo failed for '%s': %s\n" % (hostname,
+					_unicode_decode(e.strerror, encoding=_encodings['stdio'])),
 				noiselevel=-1, level=logging.ERROR)
 
 		if addrinfos:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     28d99141248063abd28a562cbc86eef897ad08af
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  3 14:22:37 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  3 14:22:37 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=28d99141

pym/_emerge/Binpkg.py: Add missing line feed to output.

---
 pym/_emerge/Binpkg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index a740efd..c0f0951 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -344,7 +344,7 @@ class Binpkg(CompositeTask):
 	def _chpathtool_exit(self, chpathtool):
 		if self._final_exit(chpathtool) != os.EX_OK:
 			self._unlock_builddir()
-			self._writemsg_level("!!! Error Adjusting Prefix to %s" %
+			self._writemsg_level("!!! Error Adjusting Prefix to %s\n" %
 				(self.settings["EPREFIX"],),
 				noiselevel=-1, level=logging.ERROR)
 			self.wait()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     2830df3b297f7caa84306316112d5485ad45b5b7
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  4 01:49:18 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug  4 01:54:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2830df3b

pym/_emerge/depgrapgh.py: Fix bug 518968

Fixes commit: 1a00ddf5fb089724a127c8dc72d63f10ae72abbf
Author: Alexander Berntsen <bernalex <AT> gentoo.org> (Thu 08 May 2014 08:47:58 AM PDT)
Subject: emerge: Implement "--alert"

self.query was not assigned using the correct UserQuery instance.
self.uq was not used by anything anywhere.  This patch consolidates it to the one initialized instance in 1 line of code.
Original bug reproduced and fixed by: Mike Gilbert <floppym <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8177b74..acb1db1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -520,8 +520,7 @@ class depgraph(object):
 		self._event_loop = (portage._internal_caller and
 			global_event_loop() or EventLoop(main=False))
 
-		self.uq = UserQuery(myopts)
-		self.query = UserQuery.query
+		self.query = UserQuery(myopts).query
 
 	def _load_vdb(self):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
  2014-08-12 18:27 Michał Górny
@ 2014-08-19  7:01 ` Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     269aa06166e36a56219c13258cc53f0fa6e18609
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 12 18:21:16 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 12 18:25:50 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=269aa061

--sync: Decode getaddrinfo() errors properly

Fixes UnicodeDecodeError in Python 2 with getaddrinfo() error messages
that contain non-ASCII characters, e.g. in pl_PL.UTF-8 locale.

Reviewed-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/actions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e482744..66e18a4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2345,7 +2345,8 @@ def _sync_repo(emerge_config, repo):
 				family, socket.SOCK_STREAM))
 		except socket.error as e:
 			writemsg_level(
-				"!!! getaddrinfo failed for '%s': %s\n" % (hostname, e),
+				"!!! getaddrinfo failed for '%s': %s\n" % (hostname,
+					_unicode_decode(e.strerror, encoding=_encodings['stdio'])),
 				noiselevel=-1, level=logging.ERROR)
 
 		if addrinfos:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     d40b4f1b0b21de67286a47aa10632e40996f6d06
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  6 21:39:14 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug  9 23:38:02 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d40b4f1b

emerge: fix invalid locale setting (bug 519074)

Don't die when the user has an invalid locale setting.
Resolves bug 519074.

---
 pym/_emerge/main.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 1a920f7..52aa9c5 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -999,7 +999,10 @@ def emerge_main(args=None):
 	args = portage._decode_argv(args)
 
 	# Use system locale.
-	locale.setlocale(locale.LC_ALL, '')
+	try:
+		locale.setlocale(locale.LC_ALL, '')
+	except locale.Error as e:
+		writemsg_level("setlocale: %s\n" % e, level=logging.WARN)
 
 	# Disable color until we're sure that it should be enabled (after
 	# EMERGE_DEFAULT_OPTS has been parsed).


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-08-19  7:01 Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2014-08-19  7:01 UTC (permalink / raw
  To: gentoo-commits

commit:     910d073d04e01cbe24b300b9dc33697e9ca48b72
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 12 16:53:50 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 11 20:22:19 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=910d073d

emerge: Prepend '=' to unmerge atoms (bug 512578)

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Reviewed-By:   Brian Dolbec       <dolsen <AT> gentoo.org>
Reviewed-By:   Michał Górny       <mgorny <AT> gentoo.org>

---
 pym/_emerge/unmerge.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 8f98563..30b1930 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -488,7 +488,8 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 		if quiet:
 			writemsg_level("\n", noiselevel=-1)
 
-	writemsg_level("\nAll selected packages: %s\n" % " ".join(all_selected), noiselevel=-1)
+	writemsg_level("\nAll selected packages: %s\n" %
+				" ".join('=%s' % x for x in all_selected), noiselevel=-1)
 
 	writemsg_level("\n>>> " + colorize("UNMERGE_WARN", "'Selected'") + \
 		" packages are slated for removal.\n")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-09-01 17:03 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-09-01 17:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d569a2d7275c65f991ea0e9648edf9458be240fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  1 17:01:31 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  1 17:01:31 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d569a2d7

_slot_operator_update_probe: fix bug #508762

This fixes the check_reverse_dependencies function (inside the depgraph
_slot_operator_update_probe method) to account for irrelevant parent
atoms from parents that need to be rebuilt or have been involved in
unsolved slot conflicts.

X-Gentoo-Bug: 508762
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=508762
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 845a43a..d6cd24d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1567,14 +1567,40 @@ class depgraph(object):
 		selective = "selective" in self._dynamic_config.myparams
 		want_downgrade = None
 
-		def check_reverse_dependencies(existing_pkg, candidate_pkg):
+		def check_reverse_dependencies(existing_pkg, candidate_pkg,
+			replacement_parent=None):
 			"""
 			Check if candidate_pkg satisfies all of existing_pkg's non-
 			slot operator parents.
 			"""
+			built_slot_operator_parents = set()
 			for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []):
-				if atom.slot_operator == "=" and getattr(parent, "built", False):
-					continue
+				if atom.slot_operator_built:
+					built_slot_operator_parents.add(parent)
+
+			for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []):
+				if isinstance(parent, Package):
+					if parent in built_slot_operator_parents:
+						# This parent may need to be rebuilt, so its
+						# dependencies aren't necessarily relevant.
+						continue
+
+					if replacement_parent is not None and \
+						(replacement_parent.slot_atom == parent.slot_atom
+						or replacement_parent.cpv == parent.cpv):
+						# This parent is irrelevant because we intend to
+						# replace it with replacement_parent.
+						continue
+
+					if any(pkg is not parent and
+						(pkg.slot_atom == parent.slot_atom or
+						pkg.cpv == parent.cpv) for pkg in
+						self._dynamic_config._package_tracker.match(
+						parent.root, Atom(parent.cp))):
+						# This parent may need to be eliminated due to a
+						# slot conflict,  so its dependencies aren't
+						# necessarily relevant.
+						continue
 
 				atom_set = InternalPackageSet(initial_atoms=(atom,),
 					allow_repo=True)
@@ -1693,7 +1719,8 @@ class depgraph(object):
 							continue
 
 					if not insignificant and \
-						check_reverse_dependencies(dep.child, pkg):
+						check_reverse_dependencies(dep.child, pkg,
+							replacement_parent=replacement_parent):
 
 						candidate_pkg_atoms.append((pkg, unevaluated_atom))
 						candidate_pkgs.append(pkg)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-09-13  5:55 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-09-13  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     e7eca8a5ec2ec4e7dd03b1b5afb05647e199a687
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 12 00:04:17 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 13 05:53:03 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e7eca8a5

_emerge: Fix hard-coded emerge-fetch.log locations Bug 520378

Use emergelog._emerge_log_dir instead of the hard-coded paths.

---
 pym/_emerge/Binpkg.py      | 6 +++---
 pym/_emerge/EbuildBuild.py | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index c0f0951..6978fb3 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -1,6 +1,7 @@
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import _emerge.emergelog
 from _emerge.EbuildPhase import EbuildPhase
 from _emerge.BinpkgFetcher import BinpkgFetcher
 from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
@@ -87,9 +88,8 @@ class Binpkg(CompositeTask):
 
 			waiting_msg = ("Fetching '%s' " + \
 				"in the background. " + \
-				"To view fetch progress, run `tail -f %s" + \
-				"/var/log/emerge-fetch.log` in another " + \
-				"terminal.") % (prefetcher.pkg_path, settings["EPREFIX"])
+				"To view fetch progress, run `tail -f %s` in another terminal.") \
+				% (prefetcher.pkg_path, _emerge.emergelog._emerge_log_dir)
 			msg_prefix = colorize("GOOD", " * ")
 			waiting_msg = "".join("%s%s\n" % (msg_prefix, line) \
 				for line in textwrap.wrap(waiting_msg, 65))

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 86a5631..7bd10aa 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -1,6 +1,7 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import _emerge.emergelog
 from _emerge.EbuildExecuter import EbuildExecuter
 from _emerge.EbuildPhase import EbuildPhase
 from _emerge.EbuildBinpkg import EbuildBinpkg
@@ -74,9 +75,8 @@ class EbuildBuild(CompositeTask):
 
 			waiting_msg = "Fetching files " + \
 				"in the background. " + \
-				"To view fetch progress, run `tail -f " + \
-				"/var/log/emerge-fetch.log` in another " + \
-				"terminal."
+				"To view fetch progress, run `tail -f %s` in another terminal." \
+				% (_emerge.emergelog._emerge_log_dir)
 			msg_prefix = colorize("GOOD", " * ")
 			from textwrap import wrap
 			waiting_msg = "".join("%s%s\n" % (msg_prefix, line) \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-09-15  5:00 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-09-15  5:00 UTC (permalink / raw
  To: gentoo-commits

commit:     4c2bb67dbcfa104e4f5f563507f9ac9d00667a6e
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 14 18:56:44 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Sep 14 18:56:44 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c2bb67d

_emerge: Add the missed emerge-fetch.log in previous commit

---
 pym/_emerge/Binpkg.py      | 3 ++-
 pym/_emerge/EbuildBuild.py | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 6978fb3..ded6dfd 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -89,7 +89,8 @@ class Binpkg(CompositeTask):
 			waiting_msg = ("Fetching '%s' " + \
 				"in the background. " + \
 				"To view fetch progress, run `tail -f %s` in another terminal.") \
-				% (prefetcher.pkg_path, _emerge.emergelog._emerge_log_dir)
+				% (prefetcher.pkg_path, os.path.join(
+					_emerge.emergelog._emerge_log_dir, "emerge-fetch.log"))
 			msg_prefix = colorize("GOOD", " * ")
 			waiting_msg = "".join("%s%s\n" % (msg_prefix, line) \
 				for line in textwrap.wrap(waiting_msg, 65))

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 7bd10aa..b5b1e87 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -76,7 +76,7 @@ class EbuildBuild(CompositeTask):
 			waiting_msg = "Fetching files " + \
 				"in the background. " + \
 				"To view fetch progress, run `tail -f %s` in another terminal." \
-				% (_emerge.emergelog._emerge_log_dir)
+				% (os.path.join(_emerge.emergelog._emerge_log_dir, "emerge-fetch.log"))
 			msg_prefix = colorize("GOOD", " * ")
 			from textwrap import wrap
 			waiting_msg = "".join("%s%s\n" % (msg_prefix, line) \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-09-15  5:00 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-09-15  5:00 UTC (permalink / raw
  To: gentoo-commits

commit:     dd2f7f91713bb3a5a14635c7930885fab99c5b17
Author:     Joakim Tjernlund <Joakim.Tjernlund <AT> transmode <DOT> se>
AuthorDate: Mon Jul 21 14:00:06 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Sep 15 03:58:54 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd2f7f91

Wrap fakeroot around MISC_SH_BINARY calls

When feature fakeroot is active all pre/post actions need
to be called with the fakeroot wrapper.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund <AT> transmode.se>

---
 pym/_emerge/MiscFunctionsProcess.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/MiscFunctionsProcess.py b/pym/_emerge/MiscFunctionsProcess.py
index bada79d..b7f5892 100644
--- a/pym/_emerge/MiscFunctionsProcess.py
+++ b/pym/_emerge/MiscFunctionsProcess.py
@@ -33,11 +33,15 @@ class MiscFunctionsProcess(AbstractEbuildProcess):
 		if self._dummy_pipe_fd is not None:
 			self.settings["PORTAGE_PIPE_FD"] = str(self._dummy_pipe_fd)
 
+		if "fakeroot" in self.settings.features:
+			kwargs["fakeroot"] = True
+
 		# Temporarily unset EBUILD_PHASE so that bashrc code doesn't
 		# think this is a real phase.
 		phase_backup = self.settings.pop("EBUILD_PHASE", None)
 		try:
-			return spawn(" ".join(args), self.settings, **kwargs)
+			return spawn(" ".join(args), self.settings,
+				**portage._native_kwargs(kwargs))
 		finally:
 			if phase_backup is not None:
 				self.settings["EBUILD_PHASE"] = phase_backup


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-09-24 16:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-09-24 16:20 UTC (permalink / raw
  To: gentoo-commits

commit:     d7f7112b410bfead272f3d07829efc8fa80c4023
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 24 02:28:22 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 24 15:48:17 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7f7112b

_want_update_pkg: fix bug #523532

This fixes depth increment to handle _UNREACHABLE_DEPTH. Note that there
are some remaining "depth > deep" and "depth + 1" expressions that are
protected by short-circuit evaluation (when deep is True).

Fixes: 336ab90212c8 ("depgraph._add_dep: fix bug #520950")
X-Gentoo-Bug: 523532
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=523532

---
 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f4e5a1b..f6f716d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4993,7 +4993,8 @@ class depgraph(object):
 				raise
 
 		depth = parent.depth or 0
-		depth += 1
+		if isinstance(depth, int):
+			depth += 1
 
 		if arg_atoms:
 			for arg, atom in arg_atoms:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-09-24 22:36 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2014-09-24 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     b2e192049456a172a1a24e0f9b2bc65b50c284f5
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 22 11:48:57 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Sep 24 22:35:45 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b2e19204

Offer to read news while calcing deps (bug 517310)

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 pym/_emerge/actions.py     | 17 +++++++++++++++--
 pym/_emerge/post_emerge.py |  5 ++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index fa04e10..9036810 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -4061,8 +4061,21 @@ def run_action(emerge_config):
 
 		# GLEP 42 says to display news *after* an emerge --pretend
 		if "--pretend" not in emerge_config.opts:
-			display_news_notification(
-				emerge_config.target_config, emerge_config.opts)
+			uq = UserQuery(emerge_config.opts)
+			if display_news_notification(emerge_config.target_config,
+								emerge_config.opts) \
+				and "--ask" in emerge_config.opts \
+				and uq.query("Would you like to read the news items while " \
+						"calculating dependencies?",
+						'--ask-enter-invalid' in emerge_config.opts) == "Yes":
+				try:
+					subprocess.call(['eselect', 'news', 'read'])
+				# If eselect is not installed, Python <3.3 will throw an
+				# OSError. >=3.3 will throw a FileNotFoundError, which is a
+				# subclass of OSError.
+				except OSError:
+					writemsg("Please install eselect to use this feature.\n",
+							noiselevel=-1)
 		retval = action_build(emerge_config.target_config.settings,
 			emerge_config.trees, emerge_config.target_config.mtimedb,
 			emerge_config.opts, emerge_config.action,

diff --git a/pym/_emerge/post_emerge.py b/pym/_emerge/post_emerge.py
index d5f1ba5..0cb533c 100644
--- a/pym/_emerge/post_emerge.py
+++ b/pym/_emerge/post_emerge.py
@@ -37,11 +37,14 @@ def clean_logs(settings):
 
 def display_news_notification(root_config, myopts):
 	if "news" not in root_config.settings.features:
-		return
+		return False
 	portdb = root_config.trees["porttree"].dbapi
 	vardb = root_config.trees["vartree"].dbapi
 	news_counts = count_unread_news(portdb, vardb)
+	if all(v == 0 for v in news_counts.values()):
+		return False
 	display_news_notifications(news_counts)
+	return True
 
 def show_depclean_suggestion():
 	out = portage.output.EOutput()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-11-24  8:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-11-24  8:13 UTC (permalink / raw
  To: gentoo-commits

commit:     5f0541c8739bd0342a94aa108e5101588eaefc16
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 21 03:57:59 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 08:02:54 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5f0541c8

_select_pkg_highest_available: selective cache invalidation (530010)

Implement selective invalidation of cache for the
depgraph._select_pkg_highest_available method, so that the entire cache
is not discarded whenever a package is added to the graph. On one of my
computers with this patch, 'emerge -puvDN @world' takes 15% less time,
and results in 58% fewer _select_pkg_highest_available_imp calls.

X-Gentoo-Bug: 530010
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=530010
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 pym/_emerge/Package.py  | 18 ++++++++++++++++--
 pym/_emerge/depgraph.py | 14 +++++++++++++-
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index a09f73c..8612e8b 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -35,8 +35,8 @@ class Package(Task):
 		"category", "counter", "cp", "cpv_split",
 		"inherited", "iuse", "mtime",
 		"pf", "root", "slot", "sub_slot", "slot_atom", "version") + \
-		("_invalid", "_masks", "_metadata", "_raw_metadata", "_use",
-		"_validated_atoms", "_visible")
+		("_invalid", "_masks", "_metadata", "_provided_cps",
+		"_raw_metadata", "_use", "_validated_atoms", "_visible")
 
 	metadata_keys = [
 		"BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "EAPI",
@@ -128,6 +128,20 @@ class Package(Task):
 		return self._metadata.properties
 
 	@property
+	def provided_cps(self):
+
+		if self._provided_cps is None:
+			provided_cps = [self.cp]
+			for atom in self._metadata["PROVIDE"].split():
+				try:
+					provided_cps.append(Atom(atom).cp)
+				except InvalidAtom:
+					pass
+			self._provided_cps = tuple(provided_cps)
+
+		return self._provided_cps
+
+	@property
 	def restrict(self):
 		return self._metadata.restrict
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 873c67d..a0169ff 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -399,6 +399,7 @@ class _dynamic_depgraph_config(object):
 		self._initially_unsatisfied_deps = []
 		self._ignored_deps = []
 		self._highest_pkg_cache = {}
+		self._highest_pkg_cache_cp_map = {}
 		self._flatten_atoms_cache = {}
 
 		# Binary packages that have been rejected because their USE
@@ -2539,8 +2540,8 @@ class depgraph(object):
 			if not previously_added:
 				self._dynamic_config._package_tracker.add_pkg(pkg)
 				self._dynamic_config._filtered_trees[pkg.root]["porttree"].dbapi._clear_cache()
-				self._dynamic_config._highest_pkg_cache.clear()
 				self._check_masks(pkg)
+				self._prune_highest_pkg_cache(pkg)
 
 			if not pkg.installed:
 				# Allow this package to satisfy old-style virtuals in case it
@@ -2685,6 +2686,7 @@ class depgraph(object):
 		# Clear caches.
 		self._dynamic_config._filtered_trees[pkg.root]["porttree"].dbapi._clear_cache()
 		self._dynamic_config._highest_pkg_cache.clear()
+		self._dynamic_config._highest_pkg_cache_cp_map.clear()
 
 
 	def _check_masks(self, pkg):
@@ -3981,6 +3983,7 @@ class depgraph(object):
 		# Invalidate the package selection cache, since
 		# arguments influence package selections.
 		self._dynamic_config._highest_pkg_cache.clear()
+		self._dynamic_config._highest_pkg_cache_cp_map.clear()
 		for trees in self._dynamic_config._filtered_trees.values():
 			trees["porttree"].dbapi._clear_cache()
 
@@ -5001,6 +5004,8 @@ class depgraph(object):
 			return ret
 		ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps, parent=parent)
 		self._dynamic_config._highest_pkg_cache[cache_key] = ret
+		self._dynamic_config._highest_pkg_cache_cp_map. \
+			setdefault(atom.cp, []).append(cache_key)
 		pkg, existing = ret
 		if pkg is not None:
 			if self._pkg_visibility_check(pkg) and \
@@ -5014,6 +5019,13 @@ class depgraph(object):
 				return True
 		return False
 
+	def _prune_highest_pkg_cache(self, pkg):
+		for cp in pkg.provided_cps:
+			for cache_key in self._dynamic_config. \
+				_highest_pkg_cache_cp_map.pop(cp, []):
+				self._dynamic_config._highest_pkg_cache.pop(
+					cache_key, None)
+
 	def _want_installed_pkg(self, pkg):
 		"""
 		Given an installed package returned from select_pkg, return


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-11-24  8:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-11-24  8:13 UTC (permalink / raw
  To: gentoo-commits

commit:     9ba4f2aa6a2755a73fb652b4557919047d649fd1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 18 06:50:46 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 08:00:27 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ba4f2aa

_slot_operator_update_probe: memoize use_reduce (529660)

Memoize the results of use_reduce calls inside
_slot_operator_update_probe, in order to improve performance. With
memoization, 'emerge -puvDN @world' on one of my computers takes
22.4% less time, and results in 13.5% fewer use_reduce calls.

X-Gentoo-Bug: 529660
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=529660
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 65 ++++++++++++++++++++++++++++++++++---------------
 1 file changed, 45 insertions(+), 20 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 505d8a8..873c67d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -399,6 +399,7 @@ class _dynamic_depgraph_config(object):
 		self._initially_unsatisfied_deps = []
 		self._ignored_deps = []
 		self._highest_pkg_cache = {}
+		self._flatten_atoms_cache = {}
 
 		# Binary packages that have been rejected because their USE
 		# didn't match the user's config. It maps packages to a set
@@ -1719,26 +1720,10 @@ class depgraph(object):
 
 			selected_atoms = None
 
-			atoms = set()
-			invalid_metadata = False
-			for dep_key in ("DEPEND", "HDEPEND", "RDEPEND", "PDEPEND"):
-				dep_string = replacement_parent._metadata[dep_key]
-				if not dep_string:
-					continue
-
-				try:
-					dep_string = portage.dep.use_reduce(dep_string,
-						uselist=self._pkg_use_enabled(replacement_parent),
-						is_valid_flag=replacement_parent.iuse.is_valid_flag,
-						flat=True, token_class=Atom,
-						eapi=replacement_parent.eapi)
-				except portage.exception.InvalidDependString:
-					invalid_metadata = True
-					break
-
-				atoms.update(token for token in dep_string if isinstance(token, Atom))
-
-			if invalid_metadata:
+			try:
+				atoms = self._flatten_atoms(replacement_parent,
+					self._pkg_use_enabled(replacement_parent))
+			except InvalidDependString:
 				continue
 
 			# List of list of child,atom pairs for each atom.
@@ -2005,6 +1990,46 @@ class depgraph(object):
 		return frozenset(x.unevaluated_atom for
 			x in selected_atoms)
 
+	def _flatten_atoms(self, pkg, use):
+		"""
+		Evaluate all dependency atoms of the given package, and return
+		them as a frozenset. For performance, results are cached.
+
+		@param pkg: a Package instance
+		@type pkg: Package
+		@param pkg: set of enabled USE flags
+		@type pkg: frozenset
+		@rtype: frozenset
+		@return: set of evaluated atoms
+		"""
+
+		cache_key = (pkg, use)
+
+		try:
+			return self._dynamic_config._flatten_atoms_cache[cache_key]
+		except KeyError:
+			pass
+
+		atoms = []
+
+		for dep_key in pkg._dep_keys:
+			dep_string = pkg._metadata[dep_key]
+			if not dep_string:
+				continue
+
+			dep_string = portage.dep.use_reduce(
+				dep_string, uselist=use,
+				is_valid_flag=pkg.iuse.is_valid_flag,
+				flat=True, token_class=Atom, eapi=pkg.eapi)
+
+			atoms.extend(token for token in dep_string
+				if isinstance(token, Atom))
+
+		atoms = frozenset(atoms)
+
+		self._dynamic_config._flatten_atoms_cache[cache_key] = atoms
+		return atoms
+
 	def _iter_similar_available(self, graph_pkg, atom, autounmask_level=None):
 		"""
 		Given a package that's in the graph, do a rough check to


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-11-29 17:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-11-29 17:55 UTC (permalink / raw
  To: gentoo-commits

commit:     161b85f3d4f5ba460ddb99d43c9475e160fa25f3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 29 16:01:38 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 17:49:58 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=161b85f3

_pkg_use_enabled: return frozenset (531112)

Since commit 9ba4f2aa6a2755a73fb652b4557919047d649fd1, _pkg_use_enabled
needs to consistently return a frozenset, so that the result is
hashable.

Fixes: 9ba4f2aa6a27 ("_slot_operator_update_probe: memoize use_reduce (529660)")
X-Gentoo-Bug: 531112
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=531112
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a0169ff..3455b6b 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5321,6 +5321,9 @@ class depgraph(object):
 		If target_use is given, the need changes are computed to make the package useable.
 		Example: target_use = { "foo": True, "bar": False }
 		The flags target_use must be in the pkg's IUSE.
+		@rtype: frozenset
+		@return: set of effectively enabled USE flags, including changes
+			made by autounmask
 		"""
 		if pkg.built:
 			return pkg.use.enabled
@@ -5387,6 +5390,10 @@ class depgraph(object):
 
 			return False
 
+		# Always return frozenset since the result needs to be
+		# hashable (see bug #531112).
+		new_use = frozenset(new_use)
+
 		if new_changes != old_changes:
 			#Don't do the change if it violates REQUIRED_USE.
 			required_use = pkg._metadata.get("REQUIRED_USE")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-11-29 18:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-11-29 18:06 UTC (permalink / raw
  To: gentoo-commits

commit:     b5b0d117433843da6a8d695140a68c7f13cf72ac
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 28 22:27:18 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 18:04:01 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b5b0d117

emerge: warn about @installed, don't deprecate (387059)

The @installed set may have some legitimate uses. Therefore, change
the deprecation warning to a warning about unsolved blockers. The
warning will now appear as follows:

 * The @installed set is not recommended when updating
 * packages because it will often introduce unsolved blocker
 * conflicts. Please refer to bug #387059 for details.

X-Gentoo-Bug: 387059
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=387059
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/actions.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index dec5b04..d9c45c1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3538,10 +3538,12 @@ def expand_set_arguments(myfiles, myaction, root_config):
 					display_missing_pkg_set(root_config, s)
 					return (None, 1)
 				if s == "installed":
-					msg = ("The @installed set is deprecated and will soon be "
-					"removed. Please refer to bug #387059 for details.")
+					msg = ("The @installed set is not recommended when "
+						"updating packages because it will often "
+						"introduce unsolved blocker conflicts. Please "
+						"refer to bug #387059 for details.")
 					out = portage.output.EOutput()
-					for line in textwrap.wrap(msg, 50):
+					for line in textwrap.wrap(msg, 57):
 						out.ewarn(line)
 				setconfig.active.append(s)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-11-29 18:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-11-29 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     226b398c0549d5815f81921ba35fe8ff9d02052d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 28 13:11:18 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 18:45:05 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=226b398c

emerge --info: show /bin/sh provider (527996)

Searching contents for the /bin/sh provider is somewhat slow.
Therefore, use the basename of the symlink target to locate the
package. If this fails, then only the basename of the symlink target
will be displayed. So, typical output is something like
"sh bash 4.2_p53". Since realpath is used to resolve symlinks
recursively, this approach is also able to handle multiple levels of
symlinks such as /bin/sh -> bb -> busybox. Note that we do not parse
the output of "/bin/sh --version" because many shells do not have
a --version option.

The relevant section of the emerge --info output will now look
something like this:

Timestamp of tree: Fri, 28 Nov 2014 00:45:01 +0000
sh bash 4.2_p53
ld GNU ld (Gentoo 2.23.2 p1.0) 2.23.2

X-Gentoo-Bug: 527996
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=527996
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/actions.py | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index d9c45c1..048e337 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1556,6 +1556,47 @@ def action_info(settings, trees, myopts, myfiles):
 		lastSync = "Unknown"
 	append("Timestamp of tree: %s" % (lastSync,))
 
+	# Searching contents for the /bin/sh provider is somewhat
+	# slow. Therefore, use the basename of the symlink target
+	# to locate the package. If this fails, then only the
+	# basename of the symlink target will be displayed. So,
+	# typical output is something like "sh bash 4.2_p53". Since
+	# realpath is used to resolve symlinks recursively, this
+	# approach is also able to handle multiple levels of symlinks
+	# such as /bin/sh -> bb -> busybox. Note that we do not parse
+	# the output of "/bin/sh --version" because many shells
+	# do not have a --version option.
+	basename = os.path.basename(os.path.realpath(os.path.join(
+		os.sep, portage.const.EPREFIX, "bin", "sh")))
+	try:
+		Atom("null/%s" % basename)
+	except InvalidAtom:
+		matches = None
+	else:
+		try:
+			# Try a match against the basename, which should work for
+			# busybox and most shells.
+			matches = (trees[trees._running_eroot]["vartree"].dbapi.
+				match(basename))
+		except portage.exception.AmbiguousPackageName:
+			# If the name is ambiguous, then restrict our match
+			# to the app-shells category.
+			matches = (trees[trees._running_eroot]["vartree"].dbapi.
+				match("app-shells/%s" % basename))
+
+	if matches:
+		pkg = matches[-1]
+		name = pkg.cp
+		version = pkg.version
+		# Omit app-shells category from the output.
+		if name.startswith("app-shells/"):
+			name = name[len("app-shells/"):]
+		sh_str = "%s %s" % (name, version)
+	else:
+		sh_str = basename
+
+	append("sh %s" % sh_str)
+
 	ld_names = []
 	if chost:
 		ld_names.append(chost + "-ld")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-11-30 19:49 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-11-30 19:49 UTC (permalink / raw
  To: gentoo-commits

commit:     269f2f610057266e25304e731631d95cf77322d3
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Nov 30 19:48:34 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun Nov 30 19:48:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=269f2f61

Fix TypeError when using `emerge -C` without package name.

---
 pym/_emerge/unmerge.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 03ce0a2..8923e20 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -94,9 +94,8 @@ def _unmerge_display(root_config, myopts, unmerge_action,
 		if not unmerge_files:
 			if unmerge_action in ["rage-clean", "unmerge"]:
 				print()
-				print(bold("emerge %s") +
-						" can only be used with specific package names" %
-						unmerge_action)
+				print(bold("emerge %s" % unmerge_action) +
+						" can only be used with specific package names")
 				print()
 				return 1, {}
 			else:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-07 23:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-12-07 23:14 UTC (permalink / raw
  To: gentoo-commits

commit:     646b671d4afb92e0bb81664568544e01e8456dc2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  7 07:58:19 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  7 23:10:48 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=646b671d

search: optimize desc search with _first_cp

---
 pym/_emerge/search.py | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 4b1833a..90dbcec 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -123,6 +123,23 @@ class search(object):
 			cpv=cpv, built=built, installed=installed,
 			metadata=metadata).visible
 
+	def _first_cp(self, cp):
+
+		for db in self._dbs:
+			if hasattr(db, "cp_list"):
+				matches = db.cp_list(cp)
+				if matches:
+					return matches[-1]
+			else:
+				matches = db.match(cp)
+
+			for cpv in matches:
+				if cpv.cp == cp:
+					return cpv
+
+		return None
+
+
 	def _xmatch(self, level, atom):
 		"""
 		This method does not expand old-style virtuals because it
@@ -230,13 +247,12 @@ class search(object):
 			if self.searchre.search(match_string):
 				yield ("pkg", package)
 			elif self.searchdesc: # DESCRIPTION searching
-				# Use match-all to avoid an expensive visibility check,
+				# Use _first_cp to avoid an expensive visibility check,
 				# since the visibility check can be avoided entirely
 				# when the DESCRIPTION does not match.
-				full_package = self._xmatch("match-all", package)
+				full_package = self._first_cp(package)
 				if not full_package:
 					continue
-				full_package = full_package[-1]
 				try:
 					full_desc = self._aux_get(
 						full_package, ["DESCRIPTION"])[0]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-07 23:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-12-07 23:14 UTC (permalink / raw
  To: gentoo-commits

commit:     4938b8a8a72e719b394a5c5b0c5030c160091d57
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  1 15:06:16 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec  7 23:10:47 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4938b8a8

Display emerge search results incrementally (412471)

This makes emerge --search / --searchdesc display individual search
results as soon as they become available. A search._iter_search method
is split out from the search.execute method, and the search.output
method operates on that. The spinner is now disabled, but the spinner
code remains, in case we later decide to enable it optionally.

X-Gentoo-Bug: 412471
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=412471

---
 pym/_emerge/search.py | 120 +++++++++++++++++++++++++++++---------------------
 1 file changed, 71 insertions(+), 49 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 4b0fd9f..e51d206 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -1,8 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from __future__ import print_function
-
 import re
 import portage
 from portage import os
@@ -30,10 +28,12 @@ class search(object):
 		The list of available and installed packages is created at object instantiation.
 		This makes successive searches faster."""
 		self.settings = root_config.settings
-		self.vartree = root_config.trees["vartree"]
-		self.spinner = spinner
 		self.verbose = verbose
 		self.searchdesc = searchdesc
+		self.searchkey = None
+		# Disable the spinner since search results are displayed
+		# incrementally.
+		self.spinner = None
 		self.root_config = root_config
 		self.setconfig = root_config.setconfig
 		self.matches = {"pkg" : []}
@@ -53,6 +53,7 @@ class search(object):
 
 		self._dbs.append(vardb)
 		self._portdb = portdb
+		self._vardb = vardb
 
 	def _spinner_update(self):
 		if self.spinner:
@@ -97,7 +98,7 @@ class search(object):
 		return {}
 
 	def _visible(self, db, cpv, metadata):
-		installed = db is self.vartree.dbapi
+		installed = db is self._vardb
 		built = installed or db is not self._portdb
 		pkg_type = "ebuild"
 		if installed:
@@ -171,8 +172,11 @@ class search(object):
 
 	def execute(self,searchkey):
 		"""Performs the search for the supplied search key"""
+		self.searchkey = searchkey
+
+	def _iter_search(self):
+
 		match_category = 0
-		self.searchkey=searchkey
 		self.packagematches = []
 		if self.searchdesc:
 			self.searchdesc=1
@@ -180,7 +184,7 @@ class search(object):
 		else:
 			self.searchdesc=0
 			self.matches = {"pkg":[], "set":[]}
-		print("Searching...   ", end=' ')
+		writemsg_stdout("Searching...\n\n", noiselevel=-1)
 
 		regexsearch = False
 		if self.searchkey.startswith('%'):
@@ -202,29 +206,28 @@ class search(object):
 			else:
 				match_string  = package.split("/")[-1]
 
-			masked=0
 			if self.searchre.search(match_string):
-				if not self._xmatch("match-visible", package):
-					masked=1
-				self.matches["pkg"].append([package,masked])
+				yield ("pkg", package)
 			elif self.searchdesc: # DESCRIPTION searching
-				full_package = self._xmatch("bestmatch-visible", package)
+				# Use match-all to avoid an expensive visibility check,
+				# since the visibility check can be avoided entirely
+				# when the DESCRIPTION does not match.
+				full_package = self._xmatch("match-all", package)
 				if not full_package:
-					#no match found; we don't want to query description
-					full_package = portage.best(
-						self._xmatch("match-all", package))
-					if not full_package:
-						continue
-					else:
-						masked=1
+					continue
+				full_package = full_package[-1]
 				try:
 					full_desc = self._aux_get(
 						full_package, ["DESCRIPTION"])[0]
 				except KeyError:
-					print("emerge: search: aux_get() failed, skipping")
+					portage.writemsg(
+						"emerge: search: aux_get() failed, skipping\n",
+						noiselevel=-1)
 					continue
-				if self.searchre.search(full_desc):
-					self.matches["desc"].append([full_package,masked])
+				if not self.searchre.search(full_desc):
+					continue
+
+				yield ("desc", package)
 
 		self.sdict = self.setconfig.getSets()
 		for setname in self.sdict:
@@ -235,51 +238,56 @@ class search(object):
 				match_string = setname.split("/")[-1]
 			
 			if self.searchre.search(match_string):
-				self.matches["set"].append([setname, False])
+				yield ("set", setname)
 			elif self.searchdesc:
 				if self.searchre.search(
 					self.sdict[setname].getMetadata("DESCRIPTION")):
-					self.matches["set"].append([setname, False])
-			
-		self.mlen=0
-		for mtype in self.matches:
-			self.matches[mtype].sort()
-			self.mlen += len(self.matches[mtype])
+					yield ("set", setname)
 
 	def addCP(self, cp):
 		if not self._xmatch("match-all", cp):
 			return
-		masked = 0
-		if not self._xmatch("bestmatch-visible", cp):
-			masked = 1
-		self.matches["pkg"].append([cp, masked])
+		self.matches["pkg"].append(cp)
 		self.mlen += 1
 
 	def output(self):
 		"""Outputs the results of the search."""
-		msg = []
+
+		class msg(object):
+			@staticmethod
+			def append(msg):
+				writemsg_stdout(msg, noiselevel=-1)
+
 		msg.append("\b\b  \n[ Results for search key : " + \
 			bold(self.searchkey) + " ]\n")
-		msg.append("[ Applications found : " + \
-			bold(str(self.mlen)) + " ]\n\n")
-		vardb = self.vartree.dbapi
+		vardb = self._vardb
 		metadata_keys = set(Package.metadata_keys)
 		metadata_keys.update(["DESCRIPTION", "HOMEPAGE", "LICENSE", "SRC_URI"])
 		metadata_keys = tuple(metadata_keys)
-		for mtype in self.matches:
-			for match,masked in self.matches[mtype]:
+
+		if self.searchkey is None:
+			# Handle results added via addCP
+			addCP_matches = []
+			for mytype, match in self.matches.items():
+				addCP_matches.append(mytype, match)
+			iterator = iter(addCP_matches)
+
+		else:
+			# Do a normal search
+			iterator = self._iter_search()
+
+		for mtype, match in iterator:
+				self.mlen += 1
+				masked = False
 				full_package = None
-				if mtype == "pkg":
+				if mtype in ("pkg", "desc"):
 					full_package = self._xmatch(
 						"bestmatch-visible", match)
 					if not full_package:
-						#no match found; we don't want to query description
-						masked=1
-						full_package = portage.best(
-							self._xmatch("match-all",match))
-				elif mtype == "desc":
-					full_package = match
-					match        = portage.cpv_getkey(match)
+						masked = True
+						full_package = self._xmatch("match-all", match)
+						if full_package:
+							full_package = full_package[-1]
 				elif mtype == "set":
 					msg.append(green("*") + "  " + bold(match) + "\n")
 					if self.verbose:
@@ -367,12 +375,26 @@ class search(object):
 							+ "   " + desc + "\n")
 						msg.append("      " + darkgreen("License:") + \
 							"       " + license + "\n\n")
-		writemsg_stdout(''.join(msg), noiselevel=-1)
+
+		msg.append("[ Applications found : " + \
+			bold(str(self.mlen)) + " ]\n\n")
+
+		# This method can be called multiple times, so
+		# reset the match count for the next call. Don't
+		# reset it at the beginning of this method, since
+		# that would lose modfications from the addCP
+		# method.
+		self.mlen = 0
+
 	#
 	# private interface
 	#
 	def getInstallationStatus(self,package):
-		installed_package = self.vartree.dep_bestmatch(package)
+		installed_package = self._vardb.match(package)
+		if installed_package:
+			installed_package = installed_package[-1]
+		else:
+			installed_package = ""
 		result = ""
 		version = self.getVersion(installed_package,search.VERSION_RELEASE)
 		if len(version) > 0:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-11  8:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-12-11  8:42 UTC (permalink / raw
  To: gentoo-commits

commit:     84bc910631cce15780947a761b468a0bd40a786b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 11 07:40:34 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 11 08:41:22 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84bc9106

search._xmatch: handle aux_get KeyError (525718)

Since commit 55c8c8bc7a781e3f71ce92922eea64ad4cafce3c, emerge --search
can raise an unhandled KeyError if a pkg_desc_index contains a stale
package. Handle it with the same error message used for other aux_get
failures.

Fixes: 55c8c8bc7a78 ("Add emerge --search-index option.")
X-Gentoo-Bug: 525718
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=525718

---
 pym/_emerge/search.py | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 90dbcec..e7f6f44 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -1,6 +1,8 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+from __future__ import unicode_literals
+
 import re
 import portage
 from portage import os
@@ -86,6 +88,11 @@ class search(object):
 				pass
 		raise KeyError(args[0])
 
+	def _aux_get_error(self, cpv):
+		portage.writemsg("emerge: search: "
+			"aux_get('%s') failed, skipping\n" % cpv,
+			noiselevel=-1)
+
 	def _findname(self, *args, **kwargs):
 		for db in self._dbs:
 			if db is not self._portdb:
@@ -166,8 +173,12 @@ class search(object):
 				else:
 					db_keys = list(db._aux_cache_keys)
 					for cpv in db.match(atom):
-						metadata = zip(db_keys,
-							db.aux_get(cpv, db_keys))
+						try:
+							metadata = zip(db_keys,
+								db.aux_get(cpv, db_keys))
+						except KeyError:
+							self._aux_get_error(cpv)
+							continue
 						if not self._visible(db, cpv, metadata):
 							continue
 						matches.add(cpv)
@@ -197,8 +208,12 @@ class search(object):
 					for cpv in reversed(matches):
 						if portage.cpv_getkey(cpv) != cp:
 							continue
-						metadata = zip(db_keys,
-							db.aux_get(cpv, db_keys))
+						try:
+							metadata = zip(db_keys,
+								db.aux_get(cpv, db_keys))
+						except KeyError:
+							self._aux_get_error(cpv)
+							continue
 						if not self._visible(db, cpv, metadata):
 							continue
 						if not result or cpv == portage.best([cpv, result]):
@@ -257,9 +272,7 @@ class search(object):
 					full_desc = self._aux_get(
 						full_package, ["DESCRIPTION"])[0]
 				except KeyError:
-					portage.writemsg(
-						"emerge: search: aux_get() failed, skipping\n",
-						noiselevel=-1)
+					self._aux_get_error(full_package)
 					continue
 				if not self.searchre.search(full_desc):
 					continue
@@ -337,7 +350,7 @@ class search(object):
 						metadata = dict(zip(metadata_keys,
 							self._aux_get(full_package, metadata_keys)))
 					except KeyError:
-						msg.append("emerge: search: aux_get() failed, skipping\n")
+						self._aux_get_error(full_package)
 						continue
 
 					desc = metadata["DESCRIPTION"]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-13  7:04 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-13  7:04 UTC (permalink / raw
  To: gentoo-commits

commit:     a34a05bd5dbbdb3e37682089c2cbb183db9bcb8a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Dec 13 07:03:57 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sat Dec 13 07:03:57 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a34a05bd

emerge --info: Modernize output of configuration of repositories.

- Always print detailed configuration of repositories.
- Always skip PORTAGE_REPOSITORIES variable.
- Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.

---
 pym/_emerge/actions.py | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 0ae2c16..28a69ee 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1713,13 +1713,9 @@ def action_info(settings, trees, myopts, myfiles):
 			((cp + ":").ljust(cp_max_len + 1), versions))
 
 	repos = portdb.settings.repositories
-	if "--verbose" in myopts:
-		append("Repositories:\n")
-		for repo in repos:
-			append(repo.info_string())
-	else:
-		append("Repositories: %s" % \
-			" ".join(repo.name for repo in repos))
+	append("Repositories:\n")
+	for repo in repos:
+		append(repo.info_string())
 
 	installed_sets = sorted(s for s in
 		root_config.sets['selected'].getNonAtoms() if s.startswith(SETPREFIX))
@@ -1732,8 +1728,8 @@ def action_info(settings, trees, myopts, myfiles):
 		myvars = list(settings)
 	else:
 		myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
-		          'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
-		          'PORTDIR_OVERLAY', 'PORTAGE_BUNZIP2_COMMAND',
+		          'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
+		          'PORTAGE_BUNZIP2_COMMAND',
 		          'PORTAGE_BZIP2_COMMAND',
 		          'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
 		          'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'FEATURES',
@@ -1745,11 +1741,18 @@ def action_info(settings, trees, myopts, myfiles):
 		'PORTAGE_BZIP2_COMMAND' : 'bzip2',
 	}
 
-	myvars = portage.util.unique_array(myvars)
+	skipped_vars = ['PORTAGE_REPOSITORIES']
+	# Deprecated variables
+	skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
+
+	myvars = set(myvars)
+	myvars.difference_update(skipped_vars)
+	myvars = sorted(myvars)
+
 	use_expand = settings.get('USE_EXPAND', '').split()
 	use_expand.sort()
 	unset_vars = []
-	myvars.sort()
+
 	for k in myvars:
 		v = settings.get(k)
 		if v is not None:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-13 14:51 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-13 14:51 UTC (permalink / raw
  To: gentoo-commits

commit:     39450d061e7de0756449466ba3d601b16ab6aae6
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Dec 13 14:48:41 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sat Dec 13 14:48:41 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=39450d06

emerge --info: Always print ::repository.

1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() function
has been deleted.

---
 pym/_emerge/actions.py | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 28a69ee..8050f61 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -42,7 +42,7 @@ from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFA
 from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
-from portage.dep import Atom
+from portage.dep import Atom, _repo_separator, _slot_separator
 from portage.eclass_cache import hashed_path
 from portage.exception import InvalidAtom, InvalidData, ParseError
 from portage.output import blue, colorize, create_color_func, darkgreen, \
@@ -1668,9 +1668,6 @@ def action_info(settings, trees, myopts, myfiles):
 
 	myvars = sorted(set(atoms))
 
-	main_repo = portdb.repositories.mainRepo()
-	if main_repo is not None:
-		main_repo = main_repo.name
 	cp_map = {}
 	cp_max_len = 0
 
@@ -1692,12 +1689,10 @@ def action_info(settings, trees, myopts, myfiles):
 				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 = ""
-				elif not repo:
-					repo_suffix = "::<unknown repository>"
+				if repo:
+					repo_suffix = _repo_separator + repo
 				else:
-					repo_suffix = "::" + repo
+					repo_suffix = _repo_separator + "<unknown repository>"
 
 				if matched_cp == orig_atom.cp:
 					provide_suffix = ""
@@ -1826,13 +1821,13 @@ def action_info(settings, trees, myopts, myfiles):
 
 			if pkg_type == "installed":
 				append("\n%s was built with the following:" % \
-					colorize("INFORM", str(pkg.cpv)))
+					colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo)))
 			elif pkg_type == "ebuild":
-				append("\n%s would be build with the following:" % \
-					colorize("INFORM", str(pkg.cpv)))
+				append("\n%s would be built with the following:" % \
+					colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo)))
 			elif pkg_type == "binary":
 				append("\n%s (non-installed binary) was built with the following:" % \
-					colorize("INFORM", str(pkg.cpv)))
+					colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo)))
 
 			append('%s' % pkg_use_display(pkg, myopts))
 			if pkg_type == "installed":
@@ -2015,10 +2010,10 @@ def action_uninstall(settings, trees, ldpath_mtimes,
 						atom = "=" + atom + "-" + \
 							portage.versions.cpv_getversion(cpv)
 					if ext_atom.slot:
-						atom += ":" + ext_atom.slot
+						atom += _slot_separator + ext_atom.slot
 						require_metadata = True
 					if ext_atom.repo:
-						atom += "::" + ext_atom.repo
+						atom += _repo_separator + ext_atom.repo
 						require_metadata = True
 
 					atom = Atom(atom, allow_repo=True)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-15  3:37 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2014-12-15  3:37 UTC (permalink / raw
  To: gentoo-commits

commit:     bee778e7fe62c238cb73eae46e762a4fa4afb579
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 14 22:50:43 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 14 22:50:43 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bee778e7

_compute_abi_rebuild_info: fix bug #532594

Since commit 3f0799054b4e5ef88feb59d20d262668ca79df33, there has been
a faulty variable assignment inside _compute_abi_rebuild_info which
assigns a bool value to the inst_pkg variable which is intended to
refer to a Package instance. Fix it to assign a correct value.

Fixes: 3f0799054b4e ("_compute_abi_rebuild_info: fix bug #521990")
X-Gentoo-Bug: 532594
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=532594

---
 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4a42ed5..fcc1a90 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -713,7 +713,7 @@ class depgraph(object):
 						if child is None:
 							continue
 
-						inst_child = dep.child.installed
+						inst_child = dep.child
 
 					else:
 						child = dep.child


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-15 16:28 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-15 16:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d7c0bd69cc7d4ac9b1b45f1b30e07019bd716bd6
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec 15 16:28:16 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Mon Dec 15 16:28:16 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7c0bd69

emerge --info: Check metadata/timestamp.chk in all repositories.

1 use of deprecated PORTDIR has been deleted.

---
 pym/_emerge/actions.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 8050f61..d393c78 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1452,6 +1452,7 @@ def action_info(settings, trees, myopts, myfiles):
 	vardb = trees[eroot]["vartree"].dbapi
 	portdb = trees[eroot]['porttree'].dbapi
 	bindb = trees[eroot]["bintree"].dbapi
+	repos = portdb.settings.repositories
 	for x in myfiles:
 		any_match = False
 		cp_exists = bool(vardb.match(x.cp))
@@ -1554,13 +1555,10 @@ def action_info(settings, trees, myopts, myfiles):
 			line += ",%10d free" % (vm_info["swap.free"] // 1024,)
 		append(line)
 
-	lastSync = portage.grabfile(os.path.join(
-		settings["PORTDIR"], "metadata", "timestamp.chk"))
-	if lastSync:
-		lastSync = lastSync[0]
-	else:
-		lastSync = "Unknown"
-	append("Timestamp of tree: %s" % (lastSync,))
+	for repo in repos:
+		last_sync = portage.grabfile(os.path.join(repo.location, "metadata", "timestamp.chk"))
+		if last_sync:
+			append("Timestamp of repository %s: %s" % (repo.name, last_sync[0]))
 
 	# Searching contents for the /bin/sh provider is somewhat
 	# slow. Therefore, use the basename of the symlink target
@@ -1707,7 +1705,6 @@ def action_info(settings, trees, myopts, myfiles):
 		append("%s %s" % \
 			((cp + ":").ljust(cp_max_len + 1), versions))
 
-	repos = portdb.settings.repositories
 	append("Repositories:\n")
 	for repo in repos:
 		append(repo.info_string())


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2014-12-21 23:11 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-12-21 23:11 UTC (permalink / raw
  To: gentoo-commits

commit:     6370873af5844fa7e76ddb603a3cad17cff99eae
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Dec 21 23:09:54 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun Dec 21 23:09:54 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6370873a

Fix "TabError: inconsistent use of tabs and spaces in indentation" with Python 3.

Regression was introduced in commit 17bc89c5db424c3f04af28a1da5bf90a943ac368.

---
 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 67e4b4e..28abea4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -9059,7 +9059,7 @@ def show_mask_docs():
 def show_blocker_docs_link():
 	writemsg("\nFor more information about " + bad("Blocked Packages") + ", please refer to the following\n", noiselevel=-1)
 	writemsg("section of the Gentoo Linux x86 Handbook (architecture is irrelevant):\n\n", noiselevel=-1)
-        writemsg("https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage#Blocked_packages\n\n", noiselevel=-1)
+	writemsg("https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage#Blocked_packages\n\n", noiselevel=-1)
 
 def get_masking_status(pkg, pkgsettings, root_config, myrepo=None, use=None):
 	return [mreason.message for \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-01-05 19:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-01-05 19:36 UTC (permalink / raw
  To: gentoo-commits

commit:     b3bba4dc8f4f93adeaeaf662870bb00a09bb1de7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 26 08:59:58 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan  5 19:31:48 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b3bba4dc

AbstractPollTask._read_buf: read regardless of event flags (531724)

PipeReaderPtyTestCase shows that data may be lost unless we attempt to
read data for every poll event, regardless of the event flags.

Therefore, always read, regardless of the event flags. This is safe to
do because all consumers of this API use non-blocking mode and properly
handle EAGAIN (signaled when this method returns None).

X-Gentoo-Bug: 531724
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=531724
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 pym/_emerge/AbstractPollTask.py | 52 +++++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 3f6dd6c..0d38bd4 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import array
@@ -78,33 +78,39 @@ class AbstractPollTask(AsynchronousTask):
 
 	def _read_buf(self, fd, event):
 		"""
-		| POLLIN | RETURN
-		| BIT    | VALUE
-		| ---------------------------------------------------
-		| 1      | Read self._bufsize into a string of bytes,
-		|        | handling EAGAIN and EIO. An empty string
-		|        | of bytes indicates EOF.
-		| ---------------------------------------------------
-		| 0      | None
+		Read self._bufsize into a string of bytes, handling EAGAIN and
+		EIO. This will only call os.read() once, so the caller should
+		call this method in a loop until either None or an empty string
+		of bytes is returned. An empty string of bytes indicates EOF.
+		None indicates EAGAIN.
+
+		NOTE: os.read() will be called regardless of the event flags,
+			since otherwise data may be lost (see bug #531724).
+
+		@param fd: file descriptor (non-blocking mode required)
+		@type fd: int
+		@param event: poll event flags
+		@type event: int
+		@rtype: bytes or None
+		@return: A string of bytes, or None
 		"""
 		# NOTE: array.fromfile() is no longer used here because it has
 		# bugs in all known versions of Python (including Python 2.7
 		# and Python 3.2).
 		buf = None
-		if event & self.scheduler.IO_IN:
-			try:
-				buf = os.read(fd, self._bufsize)
-			except OSError as e:
-				# EIO happens with pty on Linux after the
-				# slave end of the pty has been closed.
-				if e.errno == errno.EIO:
-					# EOF: return empty string of bytes
-					buf = b''
-				elif e.errno == errno.EAGAIN:
-					# EAGAIN: return None
-					buf = None
-				else:
-					raise
+		try:
+			buf = os.read(fd, self._bufsize)
+		except OSError as e:
+			# EIO happens with pty on Linux after the
+			# slave end of the pty has been closed.
+			if e.errno == errno.EIO:
+				# EOF: return empty string of bytes
+				buf = b''
+			elif e.errno == errno.EAGAIN:
+				# EAGAIN: return None
+				buf = None
+			else:
+				raise
 
 		return buf
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-01-05 19:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-01-05 19:55 UTC (permalink / raw
  To: gentoo-commits

commit:     417fc75190eb70836de9856f35c8141cacfd49fb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 29 01:27:57 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan  5 19:51:43 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=417fc751

emerge --autounmask-write: fix CONFIG_PROTECT for PORTAGE_CONFIGROOT (533884)

Since --autounmask-write was implemented in commit
c492b1b3ed631b6802ef1192f59d2ef93967fb0a, it did not properly use
PORTAGE_CONFIGROOT to construct its ConfigProtect instances. The result
was that CONFIG_PROTECT handling could misbehave when using
PORTAGE_CONFIGROOT.

Fixes: c492b1b3ed63 ("Implement --autounmask-write")
X-Gentoo-Bug: 533884
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=533884
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6266c79..41d6c60 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7893,7 +7893,8 @@ class depgraph(object):
 		if write_to_file:
 			for root in roots:
 				settings = self._frozen_config.roots[root].settings
-				protect_obj[root] = ConfigProtect(settings["EROOT"], \
+				protect_obj[root] = ConfigProtect(
+					settings["PORTAGE_CONFIGROOT"],
 					shlex_split(settings.get("CONFIG_PROTECT", "")),
 					shlex_split(settings.get("CONFIG_PROTECT_MASK", "")),
 					case_insensitive=("case-insensitive-fs"


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-01-18 18:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-01-18 18:49 UTC (permalink / raw
  To: gentoo-commits

commit:     0b85e54ce3de54d8b1dfaf2c3f3b23b5326d4c44
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 18 07:11:54 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 18 18:44:45 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b85e54c

More >= atoms for autounmask USE changes (536392)

When checking for packages that will be matched by an autounmask USE
change, account for package visibility (masking), so that we can
generate more >= atoms (as opposed to = atoms that only match very
specific versions). Don't do this for keyword or mask changes, since
that may cause undesired versions to be unmasked!

X-Gentoo-Bug: 536392
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=536392
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/depgraph.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 1431779..3e9bfdd 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7741,7 +7741,7 @@ class depgraph(object):
 		pretend = "--pretend" in self._frozen_config.myopts
 		enter_invalid = '--ask-enter-invalid' in self._frozen_config.myopts
 
-		def check_if_latest(pkg):
+		def check_if_latest(pkg, check_visibility=False):
 			is_latest = True
 			is_latest_in_slot = True
 			dbs = self._dynamic_config._filtered_trees[pkg.root]["dbs"]
@@ -7749,6 +7749,9 @@ class depgraph(object):
 
 			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)):
+					if (check_visibility and
+						not self._pkg_visibility_check(other_pkg)):
+						continue
 					if other_pkg.cp != pkg.cp:
 						# old-style PROVIDE virtual means there are no
 						# normal matches for this pkg_type
@@ -7848,7 +7851,13 @@ class depgraph(object):
 				root = pkg.root
 				roots.add(root)
 				use_changes_msg.setdefault(root, [])
-				is_latest, is_latest_in_slot = check_if_latest(pkg)
+				# NOTE: For USE changes, call check_if_latest with
+				# check_visibility=True, since we want to generate
+				# a >= atom if possible. Don't do this for keyword
+				# or mask changes, since that may cause undesired
+				# versions to be unmasked! See bug #536392.
+				is_latest, is_latest_in_slot = check_if_latest(
+					pkg, check_visibility=True)
 				changes = needed_use_config_change[1]
 				adjustments = []
 				for flag, state in changes.items():


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-02-01 15:35 Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2015-02-01 15:35 UTC (permalink / raw
  To: gentoo-commits

commit:     7a3319b5c9d75a33c3ea3b5138acaf4deeda6e62
Author:     Daniel Robbins <drobbins <AT> funtoo <DOT> org>
AuthorDate: Fri Sep 23 12:49:58 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Feb  1 15:35:24 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a3319b5

No longer have emerge refer to itself as 'the other white meat'

---
 pym/_emerge/help.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 8e241a8..dd3a347 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -6,7 +6,7 @@ from __future__ import print_function
 from portage.output import bold, turquoise, green
 
 def help():
-	print(bold("emerge:")+" the other white meat (command-line interface to the Portage system)")
+	print(bold("emerge:")+" command-line interface to the Portage system")
 	print(bold("Usage:"))
 	print("   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] [ "+turquoise("ebuild")+" | "+turquoise("tbz2")+" | "+turquoise("file")+" | "+turquoise("@set")+" | "+turquoise("atom")+" ] [ ... ]")
 	print("   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("@system")+" | "+turquoise("@world")+" >")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-02-13 18:43 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2015-02-13 18:43 UTC (permalink / raw
  To: gentoo-commits

commit:     7fab3aadb4cdca35ce0d81525af1256c745308ff
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 13 18:38:36 2015 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Fri Feb 13 18:43:36 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7fab3aad

Add another check for broken /dev/s (bug 538980)

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Suggested-by:  Zac Medico         <zmedico <AT> gentoo.org>
ACKed-by:      Zac Medico         <zmedico <AT> gentoo.org>

---
 pym/_emerge/main.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index f1a9e18..84094ae 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1114,6 +1114,15 @@ def emerge_main(args=None):
 				 level=logging.ERROR, noiselevel=-1)
 		return 1
 
+	# Verify that BASH process substitution works as another cheap early
+	# filter. Process substitution uses '/dev/fd'.
+	if portage.process.spawn_bash("[[ $(< <(echo foo) ) == foo ]]") != 0:
+		writemsg_level("Failed to validate a sane '/dev'.\n"
+				 "bash process substitution doesn't work; this may be an "
+				 "indication of a broken '/dev/fd'.\n",
+				 level=logging.ERROR, noiselevel=-1)
+		return 1
+
 	# Portage needs to ensure a sane umask for the files it creates.
 	os.umask(0o22)
 	emerge_config = load_emerge_config(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-02-13 18:43 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2015-02-13 18:43 UTC (permalink / raw
  To: gentoo-commits

commit:     eccdfdfea08de3581b4d6864f560384b97088e50
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 13 17:40:23 2015 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Fri Feb 13 18:43:36 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eccdfdfe

Add early check for broken /dev/s (bug 538980)

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Suggested-by:  Zac Medico         <zmedico <AT> gentoo.org>
ACKed-by:      Zac Medico         <zmedico <AT> gentoo.org>

---
 pym/_emerge/main.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 5d5e936..f1a9e18 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1100,6 +1100,20 @@ def emerge_main(args=None):
 		# loading to allow new repos with non-existent directories
 		portage._sync_mode = True
 
+	# Verify that /dev/null exists and is a device file as a cheap early
+	# filter for obviously broken /dev/s.
+	try:
+		if os.stat(os.devnull).st_rdev == 0:
+			writemsg_level("Failed to validate a sane '/dev'.\n"
+				  "'/dev/null' is not a device file.\n",
+				  level=logging.ERROR, noiselevel=-1)
+			return 1
+	except OSError:
+		writemsg_level("Failed to validate a sane '/dev'.\n"
+				 "'/dev/null' does not exist.\n",
+				 level=logging.ERROR, noiselevel=-1)
+		return 1
+
 	# Portage needs to ensure a sane umask for the files it creates.
 	os.umask(0o22)
 	emerge_config = load_emerge_config(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-02-14 19:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-02-14 19:14 UTC (permalink / raw
  To: gentoo-commits

commit:     036e3c0568734195a472a38b533ec3091b43fba6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 14 19:10:59 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 14 19:10:59 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=036e3c05

Fix random SonameOrChoicesTestCase failure

In commit 11467fc640995e3dc8897c82bbc7130d5bf27d05, the
atom_not_selected variable was initialized outside of a loop, when it
should have been re-initialized for each iteration of the loop. This
caused atom_not_selected to have an incorrect value in some cases,
triggering random failures of SonameOrChoicesTestCase, as observed here:

	https://travis-ci.org/gentoo/portage/jobs/50673911#L1114

Fixes: 11467fc64099 ("depgraph: soname dependency resolution (bug 282639)")

---
 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 63c89a4..e8a3110 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1860,9 +1860,9 @@ class depgraph(object):
 			replacement_candidates = []
 			# Set of all packages all atoms can agree on.
 			all_candidate_pkgs = None
-			atom_not_selected = False
 
 			for atom in atoms:
+				atom_not_selected = False
 
 				if not atom.package:
 					unevaluated_atom = None


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-02-25  8:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-02-25  8:34 UTC (permalink / raw
  To: gentoo-commits

commit:     0b453300f4da44a8a32e05f6d75da18847806739
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 25 06:31:22 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 25 08:33:22 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0b453300

actions.py: fix missing localization import (bug 541302)

Since commit 206efe5f6341bce99a5e9994a0458c304513b2c3, FEATURES=buildpkg
triggers a NameError due to a missing localization import. Fix the
NameError, and also allow read-only PKGDIR if the --usepkgonly option
is enabled.

Fixes: 206efe5f6341 ("emerge: check for writable PKGDIR (490732)")
X-Gentoo-Bug: 541302
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=541302
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

---
 pym/_emerge/actions.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index fa4fe19..b667537 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -63,6 +63,7 @@ from portage.util._async.SchedulerInterface import SchedulerInterface
 from portage.util._eventloop.global_event_loop import global_event_loop
 from portage._global_updates import _global_updates
 from portage.sync.old_tree_timestamp import old_tree_timestamp_warn
+from portage.localization import _
 from portage.metadata import action_metadata
 
 from _emerge.clear_caches import clear_caches
@@ -433,7 +434,8 @@ def action_build(settings, trees, mtimedb,
 			_opts_no_self_update.intersection(myopts)
 
 		need_write_bindb = not any(x in myopts for x in
-			("--fetchonly", "--fetch-all-uri", "--pretend")) and \
+			("--fetchonly", "--fetch-all-uri",
+			"--pretend", "--usepkgonly")) and \
 			(any("buildpkg" in trees[eroot]["root_config"].
 				settings.features for eroot in trees) or
 			any("buildsyspkg" in trees[eroot]["root_config"].


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-02-26 18:25 Mike Frysinger
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Frysinger @ 2015-02-26 18:25 UTC (permalink / raw
  To: gentoo-commits

commit:     687d7193812e3ebbf2e32f984564381e915f21f9
Author:     Bertrand SIMONNET <bsimonnet <AT> chromium <DOT> org>
AuthorDate: Fri Sep 26 22:38:16 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Feb 26 06:33:03 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=687d7193

Do not interrupt on SIGCONT

SIGCONT signals should not interrupt any system calls (locking or wait pid for
example).

URL: http://crbug.com/417800
X-Gentoo-Bug-URL: https://bugs.gentoo.org/500436

---
 pym/_emerge/Scheduler.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d6db311..6e3bf1a 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -1017,6 +1017,7 @@ class Scheduler(PollScheduler):
 			earlier_sigterm_handler = signal.signal(signal.SIGTERM, sighandler)
 			earlier_sigcont_handler = \
 				signal.signal(signal.SIGCONT, self._sigcont_handler)
+			signal.siginterrupt(signal.SIGCONT, False)
 
 			try:
 				rval = self._merge()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-03-03 21:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-03-03 21:28 UTC (permalink / raw
  To: gentoo-commits

commit:     27eecce94b4e897f13d9f4bae129db37368895c9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  1 03:17:54 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  3 21:27:18 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=27eecce9

depgraph: fix 'operation' AttributeError (bug 541754)

Since commit 4f5e4f697e2593df164fc9864893768f7d2375fc, this faulty code
has gone unreported because it's only triggered by invalid dependencies
in /var/db/pkg.

Fixes: 4f5e4f697e25 ("Use Package instance attributes to clean up and simplify depgraph.validate_blockers().")
X-Gentoo-Bug: 541754
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=541754
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e8a3110..37292a6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6595,7 +6595,7 @@ class depgraph(object):
 						if not success:
 							replacement_pkgs = self._dynamic_config._package_tracker.match(
 								myroot, pkg.slot_atom)
-							if any(replacement_pkg[0].operation == "merge" for \
+							if any(replacement_pkg.operation == "merge" for
 								replacement_pkg in replacement_pkgs):
 								# This package is being replaced anyway, so
 								# ignore invalid dependencies so as not to


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-03-03 21:28 git@oystercatcher mirror+tproxy
  0 siblings, 0 replies; 804+ messages in thread
From: git@oystercatcher mirror+tproxy @ 2015-03-03 21:28 UTC (permalink / raw
  To: gentoo-commits

commit:     27eecce94b4e897f13d9f4bae129db37368895c9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  1 03:17:54 2015 +0000
Commit:     git@oystercatcher mirror+tproxy <git <AT> oystercatcher <DOT> gentoo <DOT> org>
CommitDate: Tue Mar  3 21:27:18 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=27eecce9

depgraph: fix 'operation' AttributeError (bug 541754)

Since commit 4f5e4f697e2593df164fc9864893768f7d2375fc, this faulty code
has gone unreported because it's only triggered by invalid dependencies
in /var/db/pkg.

Fixes: 4f5e4f697e25 ("Use Package instance attributes to clean up and simplify depgraph.validate_blockers().")
X-Gentoo-Bug: 541754
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=541754
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index e8a3110..37292a6 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6595,7 +6595,7 @@ class depgraph(object):
 						if not success:
 							replacement_pkgs = self._dynamic_config._package_tracker.match(
 								myroot, pkg.slot_atom)
-							if any(replacement_pkg[0].operation == "merge" for \
+							if any(replacement_pkg.operation == "merge" for
 								replacement_pkg in replacement_pkgs):
 								# This package is being replaced anyway, so
 								# ignore invalid dependencies so as not to


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-04-28 23:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-04-28 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     37453ccdfc2dad1bb21d79a596655b614264fee9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 25 22:44:25 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 23:49:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=37453ccd

search: fix addCP so only the specified results are displayed (bug 547736)

Since commit 4938b8a8a72e719b394a5c5b0c5030c160091d57, the search.addCP
method has not worked as intended.

Fixes: 4938b8a8a72e ("Display emerge search results incrementally (412471)")
X-Gentoo-Bug: 547736
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=547736
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/search.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 5a8143c..41c182d 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -36,6 +36,7 @@ class search(object):
 		self.verbose = verbose
 		self.searchdesc = searchdesc
 		self.searchkey = None
+		self._results_specified = False
 		# Disable the spinner since search results are displayed
 		# incrementally.
 		self.spinner = None
@@ -295,6 +296,12 @@ class search(object):
 					yield ("set", setname)
 
 	def addCP(self, cp):
+		"""
+		Add a specific cp to the search results. This modifies the
+		behavior of the output method, so that it only displays specific
+		packages added via this method.
+		"""
+		self._results_specified = True
 		if not self._xmatch("match-all", cp):
 			return
 		self.matches["pkg"].append(cp)
@@ -315,11 +322,12 @@ class search(object):
 		metadata_keys.update(["DESCRIPTION", "HOMEPAGE", "LICENSE", "SRC_URI"])
 		metadata_keys = tuple(metadata_keys)
 
-		if self.searchkey is None:
+		if self._results_specified:
 			# Handle results added via addCP
 			addCP_matches = []
-			for mytype, match in self.matches.items():
-				addCP_matches.append(mytype, match)
+			for mytype, matches in self.matches.items():
+				for match in matches:
+					addCP_matches.append((mytype, match))
 			iterator = iter(addCP_matches)
 
 		else:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-05-13  1:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-05-13  1:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ddf341ef86c0939026818a231f79086f0ae2ecfe
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 13 01:14:38 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 13 01:21:57 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ddf341ef

Allow read-only PKGDIR if no ebuilds will be built (bug 549072)

X-Gentoo-Bug: 549072
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=549072
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/actions.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index b667537..92d1f2e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -444,9 +444,12 @@ def action_build(settings, trees, mtimedb,
 		if need_write_bindb or need_write_vardb:
 
 			eroots = set()
+			ebuild_eroots = set()
 			for x in mydepgraph.altlist():
 				if isinstance(x, Package) and x.operation == "merge":
 					eroots.add(x.root)
+					if x.type_name == "ebuild":
+						ebuild_eroots.add(x.root)
 
 			for eroot in eroots:
 				if need_write_vardb and \
@@ -457,7 +460,7 @@ def action_build(settings, trees, mtimedb,
 						level=logging.ERROR, noiselevel=-1)
 					return 1
 
-				if need_write_bindb and \
+				if need_write_bindb and eroot in ebuild_eroots and \
 					("buildpkg" in trees[eroot]["root_config"].
 					settings.features or
 					"buildsyspkg" in trees[eroot]["root_config"].


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-06-17  6:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-06-17  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     f5cdbf6af191c857b2c13455cb4d2d7b844c05f4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 17 05:21:05 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 17 06:54:36 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f5cdbf6a

Redirect /dev/fd bash test to /dev/null (bug 552340)

The /dev/fd test from commit 7fab3aadb4cdca35ce0d81525af1256c745308ff
shows a bash error message unecessarily.

Fixes: 7fab3aadb4cd ("Add another check for broken /dev/s (bug 538980)")
X-Gentoo-Bug: 552340
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=552340
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/main.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index a5dafa3..b69aa24 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1126,12 +1126,19 @@ def emerge_main(args=None):
 
 	# Verify that BASH process substitution works as another cheap early
 	# filter. Process substitution uses '/dev/fd'.
-	if portage.process.spawn_bash("[[ $(< <(echo foo) ) == foo ]]") != 0:
-		writemsg_level("Failed to validate a sane '/dev'.\n"
-				 "bash process substitution doesn't work; this may be an "
-				 "indication of a broken '/dev/fd'.\n",
-				 level=logging.ERROR, noiselevel=-1)
-		return 1
+	with open(os.devnull, 'r+b') as dev_null:
+		fd_pipes = {
+			0: dev_null.fileno(),
+			1: dev_null.fileno(),
+			2: dev_null.fileno(),
+		}
+		if portage.process.spawn_bash("[[ $(< <(echo foo) ) == foo ]]",
+			fd_pipes=fd_pipes) != 0:
+			writemsg_level("Failed to validate a sane '/dev'.\n"
+				"bash process substitution doesn't work; this may be an "
+				"indication of a broken '/dev/fd'.\n",
+				level=logging.ERROR, noiselevel=-1)
+			return 1
 
 	# Portage needs to ensure a sane umask for the files it creates.
 	os.umask(0o22)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-07-07 18:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-07-07 18:38 UTC (permalink / raw
  To: gentoo-commits

commit:     551837f0de95cf8e3e741e76094b31cfc0d68bd5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  7 07:20:55 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul  7 18:36:17 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=551837f0

AbstractEbuildProcess: use mkdtemp to avoid cgroup interference (bug 554108)

This fixes parallel builds of the same package, so they don't try
to kill eachothers processes.

Fixes: b01a1b90d8c5 ("Add FEATURES=cgroup to isolate phase processes.")
X-Gentoo-Bug: 554108
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=554108
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/AbstractEbuildProcess.py | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 31127f4..68d96e4 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -1,10 +1,12 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import errno
 import io
 import platform
 import stat
 import subprocess
+import tempfile
 import textwrap
 from _emerge.SpawnProcess import SpawnProcess
 from _emerge.EbuildBuildDir import EbuildBuildDir
@@ -14,7 +16,7 @@ from portage.elog import messages as elog_messages
 from portage.localization import _
 from portage.package.ebuild._ipc.ExitCommand import ExitCommand
 from portage.package.ebuild._ipc.QueryCommand import QueryCommand
-from portage import os
+from portage import shutil, os
 from portage.util._pty import _create_pty_or_pipe
 from portage.util import apply_secpass_permissions
 
@@ -69,9 +71,7 @@ class AbstractEbuildProcess(SpawnProcess):
 				and self.phase not in self._phases_without_cgroup):
 			cgroup_root = '/sys/fs/cgroup'
 			cgroup_portage = os.path.join(cgroup_root, 'portage')
-			cgroup_path = os.path.join(cgroup_portage,
-					'%s:%s' % (self.settings["CATEGORY"],
-						self.settings["PF"]))
+
 			try:
 				# cgroup tmpfs
 				if not os.path.ismount(cgroup_root):
@@ -90,9 +90,9 @@ class AbstractEbuildProcess(SpawnProcess):
 						'-o', 'rw,nosuid,nodev,noexec,none,name=portage',
 						'tmpfs', cgroup_portage])
 
-				# the ebuild cgroup
-				if not os.path.isdir(cgroup_path):
-					os.mkdir(cgroup_path)
+				cgroup_path = tempfile.mkdtemp(dir=cgroup_portage,
+					prefix='%s:%s.' % (self.settings["CATEGORY"],
+					self.settings["PF"]))
 			except (subprocess.CalledProcessError, OSError):
 				pass
 			else:
@@ -313,6 +313,13 @@ class AbstractEbuildProcess(SpawnProcess):
 	def _set_returncode(self, wait_retval):
 		SpawnProcess._set_returncode(self, wait_retval)
 
+		if self.cgroup is not None:
+			try:
+				shutil.rmtree(self.cgroup)
+			except EnvironmentError as e:
+				if e.errno != errno.ENOENT:
+					raise
+
 		if self._exit_timeout_id is not None:
 			self.scheduler.source_remove(self._exit_timeout_id)
 			self._exit_timeout_id = None


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-07-14 18:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-07-14 18:06 UTC (permalink / raw
  To: gentoo-commits

commit:     2afd8f2c533e6e000b5619282a4cd4c71405eb62
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 12 04:57:19 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 14 18:06:40 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2afd8f2c

BlockerDB.discardBlocker: convert str to Atom for DbapiProvidesIndex (bug 554578)

Since commit 11467fc640995e3dc8897c82bbc7130d5bf27d05, only Atom
instances are allowed to be passed into match_pkgs calls.

Fixes: 11467fc64099 ("depgraph: soname dependency resolution (bug 282639)")
X-Gentoo-Bug: 554578
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=554578
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/BlockerDB.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py
index 8bb8f5f..44a70a0 100644
--- a/pym/_emerge/BlockerDB.py
+++ b/pym/_emerge/BlockerDB.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import sys
@@ -7,6 +7,7 @@ import portage
 from portage import os
 from portage import digraph
 from portage._sets.base import InternalPackageSet
+from portage.dep import Atom
 
 from _emerge.BlockerCache import BlockerCache
 from _emerge.Package import Package
@@ -117,7 +118,7 @@ class BlockerDB(object):
 	def discardBlocker(self, 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,)):
+		for cpv_match in self._fake_vartree.dbapi.match_pkgs(Atom("=%s" % (pkg.cpv,))):
 			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):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-07-15 19:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-07-15 19:28 UTC (permalink / raw
  To: gentoo-commits

commit:     cc8724b80ec7da713baed3d3a88c0bb99fc368b7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 15 06:58:54 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul 15 19:27:52 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cc8724b8

depgraph._want_update_pkg: handle _UNREACHABLE_DEPTH (bug 554928)

Since commit 336ab90212c80ce9548362bf4fbdafd388c3515c, package depth
can refer to _UNREACHABLE_DEPTH which is not an integer. Add
_too_deep and _increment_depth methods to handle depth operations.

Fixes: 336ab90212c8 ("depgraph._add_dep: fix bug #52095")
X-Gentoo-Bug: 554928
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=554928
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ba897d0..1683280 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2799,7 +2799,7 @@ class depgraph(object):
 
 		dep.want_update = (not self._dynamic_config._complete_mode and
 			(arg_atoms or update) and
-			not (deep is not True and depth > deep))
+			not self._too_deep(depth))
 
 		dep.child = pkg
 		if not pkg.onlydeps and dep.atom and (
@@ -2807,7 +2807,8 @@ class depgraph(object):
 			dep.atom.slot_operator == "="):
 			self._add_slot_operator_dep(dep)
 
-		recurse = deep is True or depth + 1 <= deep
+		recurse = (deep is True or
+			not self._too_deep(self._depth_increment(depth, n=1)))
 		dep_stack = self._dynamic_config._dep_stack
 		if "recurse" not in self._dynamic_config.myparams:
 			return 1
@@ -5348,12 +5349,37 @@ class depgraph(object):
 					depth = 0
 					break
 
-		deep = self._dynamic_config.myparams.get("deep", 0)
 		update = "--update" in self._frozen_config.myopts
 
 		return (not self._dynamic_config._complete_mode and
 			(arg_atoms or update) and
-			not (deep is not True and depth > deep))
+			not self._too_deep(depth))
+
+	def _too_deep(self, depth):
+		"""
+		Check if a package depth is deeper than the max allowed depth.
+
+		@param depth: the depth of a particular package
+		@type depth: int or _UNREACHABLE_DEPTH
+		@rtype: bool
+		@return: True if the package is deeper than the max allowed depth
+		"""
+		deep = self._dynamic_config.myparams.get("deep", 0)
+		return depth is self._UNREACHABLE_DEPTH or (
+			isinstance(deep, int) and isinstance(depth, int) and depth > deep)
+
+	def _depth_increment(self, depth, n=1):
+		"""
+		Return depth + n if depth is an int, otherwise return depth.
+
+		@param depth: the depth of a particular package
+		@type depth: int or _UNREACHABLE_DEPTH
+		@param n: number to add (default is 1)
+		@type n: int
+		@rtype: int or _UNREACHABLE_DEPTH
+		@return: depth + 1 or _UNREACHABLE_DEPTH
+		"""
+		return depth + n if isinstance(depth, int) else depth
 
 	def _equiv_ebuild_visible(self, pkg, autounmask_level=None):
 		try:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-08-02  0:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-08-02  0:42 UTC (permalink / raw
  To: gentoo-commits

commit:     7490b273027feef4ebf6a45c1c69df02195fd09a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  1 21:27:05 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug  2 00:35:43 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7490b273

depgraph._select_files: use _iter_match_pkgs for tbz2 arguments (bug 556464)

This code has been broken since commit
34055adae6bd90fc64f18421e2cec5f8da6f7c33.

Fixes: 34055adae6bd ("binpkg-multi-instance 1 of 7")
X-Gentoo-Bug: 556464
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=556464
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 1683280..a957108 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -31,6 +31,7 @@ from portage.eapi import eapi_has_strong_blocks, eapi_has_required_use, \
 	_get_eapi_attrs
 from portage.exception import (InvalidAtom, InvalidData, InvalidDependString,
 	PackageNotFound, PortageException)
+from portage.localization import _
 from portage.output import colorize, create_color_func, \
 	darkgreen, green
 bad = create_color_func("BAD")
@@ -3632,14 +3633,18 @@ class depgraph(object):
 					writemsg(colorize("BAD", "\n*** Package is missing CATEGORY metadata: %s.\n\n" % x), noiselevel=-1)
 					self._dynamic_config._skip_restart = True
 					return 0, myfavorites
-				elif os.path.realpath(x) != \
-					os.path.realpath(bindb.bintree.getname(mykey)):
-					writemsg(colorize("BAD", "\n*** You need to adjust PKGDIR to emerge this package.\n\n"), noiselevel=-1)
+
+				x = os.path.realpath(x)
+				for pkg in self._iter_match_pkgs(root_config, "binary", Atom('=%s' % mykey)):
+					if x == os.path.realpath(bindb.bintree.getname(pkg.cpv)):
+						break
+				else:
+					writemsg("\n%s\n\n" % colorize("BAD",
+						"*** " + _("You need to adjust PKGDIR to emerge "
+						"this package: %s") % x), noiselevel=-1)
 					self._dynamic_config._skip_restart = True
 					return 0, myfavorites
 
-				pkg = self._pkg(mykey, "binary", root_config,
-					onlydeps=onlydeps)
 				args.append(PackageArg(arg=x, package=pkg,
 					root_config=root_config))
 			elif ext==".ebuild":


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-08-06  6:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-08-06  6:31 UTC (permalink / raw
  To: gentoo-commits

commit:     b7149002bf23889f280c502afe6ceda0b1345ca3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  6 05:08:39 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug  6 06:28:22 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b7149002

similar_name_search: used indexed repos where appropriate (bug 556764)

This reduces the time of 'emerge --info foo' by roughly 24% on my
laptop.

X-Gentoo-Bug: 556764
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=556764
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/actions.py  | 7 +++++--
 pym/_emerge/depgraph.py | 6 +++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 92d1f2e..01aef51 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -42,6 +42,8 @@ from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFA
 from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
+from portage.dbapi.IndexedPortdb import IndexedPortdb
+from portage.dbapi.IndexedVardb import IndexedVardb
 from portage.dep import Atom, _repo_separator, _slot_separator
 from portage.eclass_cache import hashed_path
 from portage.exception import InvalidAtom, InvalidData, ParseError
@@ -1513,9 +1515,10 @@ def action_info(settings, trees, myopts, myfiles):
 				writemsg("\nemerge: searching for similar names..."
 					, noiselevel=-1)
 
-				dbs = [vardb]
+				search_index = myopts.get("--search-index", "y") != "n"
+				dbs = [IndexedVardb(vardb) if search_index else vardb]
 				#if "--usepkgonly" not in myopts:
-				dbs.append(portdb)
+				dbs.append(IndexedPortdb(portdb) if search_index else portdb)
 				if "--usepkg" in myopts:
 					dbs.append(bindb)
 

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a957108..57040ab 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -21,6 +21,7 @@ from portage.const import PORTAGE_PACKAGE_ATOM, USER_CONFIG_PATH, VCS_DIRS
 from portage.dbapi import dbapi
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi.DummyTree import DummyTree
+from portage.dbapi.IndexedPortdb import IndexedPortdb
 from portage.dbapi._similar_name_search import similar_name_search
 from portage.dep import Atom, best_match_to_list, extract_affecting_use, \
 	check_required_use, human_readable_required_use, match_from_list, \
@@ -5100,10 +5101,13 @@ class depgraph(object):
 				writemsg("\nemerge: searching for similar names..."
 					, noiselevel=-1)
 
+				search_index = self._frozen_config.myopts.get("--search-index", "y") != "n"
+				# fakedbapi is indexed
 				dbs = [vardb]
 				if "--usepkgonly" not in self._frozen_config.myopts:
-					dbs.append(portdb)
+					dbs.append(IndexedPortdb(portdb) if search_index else portdb)
 				if "--usepkg" in self._frozen_config.myopts:
+					# bindbapi is indexed
 					dbs.append(bindb)
 
 				matches = similar_name_search(dbs, atom)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-09-03 18:03 Mike Frysinger
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Frysinger @ 2015-09-03 18:03 UTC (permalink / raw
  To: gentoo-commits

commit:     19b17fa0ecd633e2e0d759bc03a74c88c261b44b
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  3 18:00:09 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Sep  3 18:00:09 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=19b17fa0

Scheduler: clean up PORTAGE_TMPDIR warning message

The current textwrap logic produces bad output when expanding the user's
PORTAGE_TMPDIR variable.  It's customary to not wrap literal values like
this, especially when it's a user setting, so drop the use of textwrap.

Before:
 * The directory specified in your PORTAGE_TMPDIR variable, '/var/tmp/som
 * e/really/long/path/that/looks/bad/when/you/break/it/up/but/do/it/anywa
 * ys', does not exist. Please create this directory or correct your
 * PORTAGE_TMPDIR setting.

After:
 * The directory specified in your PORTAGE_TMPDIR variable does not exist:
 * /var/tmp/some/really/long/path/that/looks/bad/when/you/break/it/up/but/do/it/anyways
 * Please create this directory or correct your PORTAGE_TMPDIR setting.

 pym/_emerge/Scheduler.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 13abc92..8eeef06 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -963,11 +963,11 @@ class Scheduler(PollScheduler):
 			# for ensuring sane $PWD (bug #239560) and storing elog messages.
 			tmpdir = root_config.settings.get("PORTAGE_TMPDIR", "")
 			if not tmpdir or not os.path.isdir(tmpdir):
-				msg = "The directory specified in your " + \
-					"PORTAGE_TMPDIR variable, '%s', " % tmpdir + \
-				"does not exist. Please create this " + \
-				"directory or correct your PORTAGE_TMPDIR setting."
-				msg = textwrap.wrap(msg, 70)
+				msg = (
+					'The directory specified in your PORTAGE_TMPDIR variable does not exist:',
+					tmpdir,
+					'Please create this directory or correct your PORTAGE_TMPDIR setting.',
+				)
 				out = portage.output.EOutput()
 				for l in msg:
 					out.eerror(l)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-10-08  0:01 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2015-10-08  0:01 UTC (permalink / raw
  To: gentoo-commits

commit:     bf62f8954f087b4f2e1158eb7c62b7a03d5dd9a1
Author:     James Broadhead <jbroadhead <AT> twitter <DOT> com>
AuthorDate: Wed Oct  7 23:58:46 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Oct  7 23:58:46 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bf62f895

_emerge/Scheduler.py: Add FAILURE enum

 pym/_emerge/Scheduler.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 968af6c..20a4e85 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -65,6 +65,10 @@ from _emerge.SequentialTaskQueue import SequentialTaskQueue
 if sys.hexversion >= 0x3000000:
 	basestring = str
 
+# enums
+FAILURE = 1
+
+
 class Scheduler(PollScheduler):
 
 	# max time between loadavg checks (milliseconds)
@@ -641,7 +645,7 @@ class Scheduler(PollScheduler):
 				writemsg_level(
 					"!!! Unable to generate manifest for '%s'.\n" \
 					% x.cpv, level=logging.ERROR, noiselevel=-1)
-				return 1
+				return FAILURE
 
 		return os.EX_OK
 
@@ -673,7 +677,7 @@ class Scheduler(PollScheduler):
 				out = portage.output.EOutput()
 				for line in textwrap.wrap(msg, 70):
 					out.eerror(line)
-				return 1
+				return FAILURE
 
 		return os.EX_OK
 
@@ -719,7 +723,7 @@ class Scheduler(PollScheduler):
 				failures |= 1
 
 		if failures:
-			return 1
+			return FAILURE
 		return os.EX_OK
 
 	def _add_prefetchers(self):
@@ -934,7 +938,7 @@ class Scheduler(PollScheduler):
 				build_dir.unlock()
 
 		if failures:
-			return 1
+			return FAILURE
 		return os.EX_OK
 
 	def merge(self):
@@ -949,7 +953,7 @@ class Scheduler(PollScheduler):
 		try:
 			self._background = self._background_mode()
 		except self._unknown_internal_error:
-			return 1
+			return FAILURE
 
 		rval = self._handle_self_update()
 		if rval != os.EX_OK:
@@ -971,7 +975,7 @@ class Scheduler(PollScheduler):
 				out = portage.output.EOutput()
 				for l in msg:
 					out.eerror(l)
-				return 1
+				return FAILURE
 
 			if self._background:
 				root_config.settings.unlock()
@@ -1180,7 +1184,7 @@ class Scheduler(PollScheduler):
 			printer.eerror("")
 
 		if self._failed_pkgs_all:
-			return 1
+			return FAILURE
 		return os.EX_OK
 
 	def _elog_listener(self, mysettings, key, logentries, fulltext):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-10-08  0:01 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2015-10-08  0:01 UTC (permalink / raw
  To: gentoo-commits

commit:     0ab40c8e314a63425859a3fcbf70bb849bfb01cf
Author:     James Broadhead <jbroadhead <AT> twitter <DOT> com>
AuthorDate: Wed Oct  7 23:57:50 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Oct  7 23:57:50 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0ab40c8e

_emerge/Scheduler.py: Indent and whitespace cleanup

 pym/_emerge/Scheduler.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 8eeef06..968af6c 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -284,11 +284,11 @@ class Scheduler(PollScheduler):
 				self._parallel_fetch = True
 
 		if self._parallel_fetch:
-				# clear out existing fetch log if it exists
-				try:
-					open(self._fetch_log, 'w').close()
-				except EnvironmentError:
-					pass
+			# clear out existing fetch log if it exists
+			try:
+				open(self._fetch_log, 'w').close()
+			except EnvironmentError:
+				pass
 
 		self._running_portage = None
 		portage_match = self._running_root.trees["vartree"].dbapi.match(
@@ -353,7 +353,7 @@ class Scheduler(PollScheduler):
 		Use this to free memory at the beginning of _calc_resume_list().
 		After _calc_resume_list(), the _init_graph() method
 		must to be called in order to re-generate the structures that
-		this method destroys. 
+		this method destroys.
 		"""
 		self._blocker_db = None
 		self._set_graph_config(None)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-10-13 16:14 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-10-13 16:14 UTC (permalink / raw
  To: gentoo-commits

commit:     ef7c3e4748bd497cc70bcb76e8b0cd217f3d0d4f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 13 16:08:43 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 13 16:12:19 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ef7c3e47

SpawnProcess._set_returncode: handle missing cgroup IOError (bug 562964)

Handle EnvironmentError, which includes the IOError that is raised
when the cgroup has been removed by cgroup-release-agent.

Fixes: e6be71af3f67 ("AbstractEbuildProcess: remove cgroup with release_agent (bug 561264)")
X-Gentoo-bug: 562964
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=562964

 pym/_emerge/SpawnProcess.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 15d3dc5..5ab2e67 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -185,8 +185,8 @@ class SpawnProcess(SubProcess):
 				try:
 					with open(os.path.join(cgroup, 'cgroup.procs'), 'r') as f:
 						return [int(p) for p in f.read().split()]
-				except OSError:
-					# cgroup removed already?
+				except EnvironmentError:
+					# removed by cgroup-release-agent
 					return []
 
 			def kill_all(pids, sig):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-11-13 21:53 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-13 21:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ccb1377a18ce8addb21000b0009e360c2641aa8c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Nov 13 21:50:22 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Fri Nov 13 21:50:22 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ccb1377a

_emerge.main.emerge_main(): Make locale variables from configuration files affect locale of emerge process.

 pym/_emerge/main.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index e75bb0a..5a8b93c 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1072,7 +1072,7 @@ def emerge_main(args=None):
 
 	# Use system locale.
 	try:
-		locale.setlocale(locale.LC_ALL, '')
+		locale.setlocale(locale.LC_ALL, "")
 	except locale.Error as e:
 		writemsg_level("setlocale: %s\n" % e, level=logging.WARN)
 
@@ -1144,6 +1144,19 @@ def emerge_main(args=None):
 	os.umask(0o22)
 	emerge_config = load_emerge_config(
 		action=myaction, args=myfiles, opts=myopts)
+
+	# Make locale variables from configuration files (make.defaults, make.conf) affect locale of emerge process.
+	for locale_var_name in ("LANGUAGE", "LC_ALL", "LC_ADDRESS", "LC_COLLATE", "LC_CTYPE",
+		"LC_IDENTIFICATION", "LC_MEASUREMENT", "LC_MESSAGES", "LC_MONETARY",
+		"LC_NAME", "LC_NUMERIC", "LC_PAPER", "LC_TELEPHONE", "LC_TIME", "LANG"):
+		locale_var_value = emerge_config.running_config.settings.get(locale_var_name)
+		if locale_var_value is not None:
+			os.environ.setdefault(locale_var_name, locale_var_value)
+	try:
+		locale.setlocale(locale.LC_ALL, "")
+	except locale.Error as e:
+		writemsg_level("setlocale: %s\n" % e, level=logging.WARN)
+
 	rval = profile_check(emerge_config.trees, emerge_config.action)
 	if rval != os.EX_OK:
 		return rval


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-11-23 16:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-11-23 16:28 UTC (permalink / raw
  To: gentoo-commits

commit:     fc78181d856ef0ecf6fa21262cc87fe71426d8e3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 19:12:20 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 16:27:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fc78181d

SpawnProcess: make _cancel kill all processes in cgroup (bug 566414)

Since the _cancel method is used to kill subprocesses after die is
called, this fixes die calls in subshells to kill all processes in
the cgroup. For example, see the test ebuild attached to bug 465008,
which would hang for 60 seconds after die was called as follows:

    sleep 60 | ( false || die )

X-Gentoo-Bug: 566414
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566414
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/SpawnProcess.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 5ab2e67..b4b4b5b 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -179,7 +179,13 @@ class SpawnProcess(SubProcess):
 
 	def _set_returncode(self, wait_retval):
 		SubProcess._set_returncode(self, wait_retval)
+		self._cgroup_cleanup()
 
+	def _cancel(self):
+		SubProcess._cancel(self)
+		self._cgroup_cleanup()
+
+	def _cgroup_cleanup(self):
 		if self.cgroup:
 			def get_pids(cgroup):
 				try:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-11-23 16:31 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-11-23 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     007236f06506744fdb67910af5d7fb69783dbfe1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 19:41:07 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 16:28:55 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=007236f0

SpawnProcess: re-check cgroup.procs until empty (bug 566420)

For subshell die support (bug 465008), re-check cgroup.procs until it's
empty, in case any of the listed processes fork before we've had a chance
to kill them.

X-Gentoo-Bug: 566420
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566420
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/SpawnProcess.py | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index b4b4b5b..e046640 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -16,6 +16,8 @@ from _emerge.SubProcess import SubProcess
 import portage
 from portage import os
 from portage.const import BASH_BINARY
+from portage.localization import _
+from portage.output import EOutput
 from portage.util import writemsg_level
 from portage.util._async.PipeLogger import PipeLogger
 
@@ -35,6 +37,10 @@ class SpawnProcess(SubProcess):
 	__slots__ = ("args",) + \
 		_spawn_kwarg_names + ("_pipe_logger", "_selinux_type",)
 
+	# Max number of attempts to kill the processes listed in cgroup.procs,
+	# given that processes may fork before they can be killed.
+	_CGROUP_CLEANUP_RETRY_MAX = 8
+
 	def _start(self):
 
 		if self.fd_pipes is None:
@@ -209,10 +215,24 @@ class SpawnProcess(SubProcess):
 						elif e.errno != errno.ESRCH:
 							raise
 
-			# step 1: kill all orphans
-			pids = get_pids(self.cgroup)
+			# step 1: kill all orphans (loop in case of new forks)
+			remaining = self._CGROUP_CLEANUP_RETRY_MAX
+			while remaining:
+				remaining -= 1
+				pids = get_pids(self.cgroup)
+				if pids:
+					kill_all(pids, signal.SIGKILL)
+				else:
+					break
+
 			if pids:
-				kill_all(pids, signal.SIGKILL)
+				msg = []
+				msg.append(
+					_("Failed to kill pid(s) in '%(cgroup)s': %(pids)s") % dict(
+					cgroup=os.path.join(self.cgroup, 'cgroup.procs'),
+					pids=' '.join(str(pid) for pid in pids)))
+
+				self._elog('eerror', msg)
 
 			# step 2: remove the cgroup
 			try:
@@ -221,3 +241,8 @@ class SpawnProcess(SubProcess):
 				# it may be removed already, or busy
 				# we can't do anything good about it
 				pass
+
+	def _elog(self, elog_funcname, lines):
+		elog_func = getattr(EOutput(), elog_funcname)
+		for line in lines:
+			elog_func(line)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-11-25 12:43 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-25 12:43 UTC (permalink / raw
  To: gentoo-commits

commit:     53a0b6369d7dc7aaaece82ee1d4a7cb9bcd37658
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Nov 25 12:40:26 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Wed Nov 25 12:40:26 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=53a0b636

_emerge.actions.getgccversion(): Work with chost=None and with no explicit chost.

chost="" was already sometimes passed to this function.

 pym/_emerge/actions.py | 51 +++++++++++++++++++++++++-------------------------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e03e8d4..54e99c1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import division, print_function, unicode_literals
@@ -2393,7 +2393,7 @@ def load_emerge_config(emerge_config=None, **kargs):
 
 	return emerge_config
 
-def getgccversion(chost):
+def getgccversion(chost=None):
 	"""
 	rtype: C{str}
 	return:  the current in-use gcc version
@@ -2408,30 +2408,31 @@ def getgccversion(chost):
 	"!!! other terminals also.\n"
 	)
 
-	try:
-		proc = subprocess.Popen(["gcc-config", "-c"],
-			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-	except OSError:
-		myoutput = None
-		mystatus = 1
-	else:
-		myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
-		mystatus = proc.wait()
-	if mystatus == os.EX_OK and myoutput.startswith(chost + "-"):
-		return myoutput.replace(chost + "-", gcc_ver_prefix, 1)
+	if chost:
+		try:
+			proc = subprocess.Popen(["gcc-config", "-c"],
+				stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+		except OSError:
+			myoutput = None
+			mystatus = 1
+		else:
+			myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+			mystatus = proc.wait()
+		if mystatus == os.EX_OK and myoutput.startswith(chost + "-"):
+			return myoutput.replace(chost + "-", gcc_ver_prefix, 1)
 
-	try:
-		proc = subprocess.Popen(
-			[chost + "-" + gcc_ver_command[0]] + gcc_ver_command[1:],
-			stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-	except OSError:
-		myoutput = None
-		mystatus = 1
-	else:
-		myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
-		mystatus = proc.wait()
-	if mystatus == os.EX_OK:
-		return gcc_ver_prefix + myoutput
+		try:
+			proc = subprocess.Popen(
+				[chost + "-" + gcc_ver_command[0]] + gcc_ver_command[1:],
+				stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+		except OSError:
+			myoutput = None
+			mystatus = 1
+		else:
+			myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
+			mystatus = proc.wait()
+		if mystatus == os.EX_OK:
+			return gcc_ver_prefix + myoutput
 
 	try:
 		proc = subprocess.Popen(gcc_ver_command,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-12-08 22:37 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 804+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-08 22:37 UTC (permalink / raw
  To: gentoo-commits

commit:     80362239e1b128c710eef0ced6a190c6b8533d1e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec  8 22:35:45 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec  8 22:35:45 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=80362239

_emerge.depgraph.depgraph._select_files(): Update message.

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index f659b0a..fa83ae8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3667,7 +3667,7 @@ class depgraph(object):
 				if ebuild_path:
 					if ebuild_path != os.path.join(os.path.realpath(tree_root),
 						cp, os.path.basename(ebuild_path)):
-						writemsg(colorize("BAD", "\n*** You need to adjust PORTDIR or PORTDIR_OVERLAY to emerge this package.\n\n"), noiselevel=-1)
+						writemsg(colorize("BAD", "\n*** You need to adjust repos.conf to emerge this package.\n\n"), noiselevel=-1)
 						self._dynamic_config._skip_restart = True
 						return 0, myfavorites
 					if mykey not in portdb.xmatch(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-12-09 16:51 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-12-09 16:51 UTC (permalink / raw
  To: gentoo-commits

commit:     1d9df5eec15e883b38879bebdac7294cb51756ad
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  9 06:28:59 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec  9 16:46:53 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d9df5ee

depgraph._too_deep: fix logic when deep is True (bug 566024)

Since commit cc8724b80ec7da713baed3d3a88c0bb99fc368b7, the _too_deep
method erroneously returned True when deep was True. When deep is True
and depth is an int, the method is intended to return False, therefore
fix it to do so. This fixes the dep.want_update assignment from commit
cc8724b80ec7 to behave correctly, which solves bug 566024 because it
corrects behavior of the _slot_operator_trigger_reinstalls method.

Fixes: cc8724b80ec7 ("depgraph._want_update_pkg: handle _UNREACHABLE_DEPTH (bug 554928)")
X-Gentoo-Bug: 566024
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=566024
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/depgraph.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fa83ae8..2169b00 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5407,8 +5407,14 @@ class depgraph(object):
 		@return: True if the package is deeper than the max allowed depth
 		"""
 		deep = self._dynamic_config.myparams.get("deep", 0)
-		return depth is self._UNREACHABLE_DEPTH or (
-			isinstance(deep, int) and isinstance(depth, int) and depth > deep)
+		if depth is self._UNREACHABLE_DEPTH:
+			return True
+		elif deep is True:
+			return False
+		else:
+			# All non-integer cases are handled above,
+			# so both values must be int type.
+			return depth > deep
 
 	def _depth_increment(self, depth, n=1):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-12-13 23:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-12-13 23:39 UTC (permalink / raw
  To: gentoo-commits

commit:     7cbd04cd62c8f13ed41e07ff8bc9b7e5d5ac700b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 13 06:44:52 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 23:37:47 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7cbd04cd

_dep_check_composite_db._visible: verify that highest_visible matches (bug 567686)

If the highest visible match for a package slot does not match the
required atom, then do not mask other packages in the same slot.
Bug 567686 was triggered when the highest visible match for the
package slot did not match the subslot specified by the required atom.

X-Gentoo-Bug: 567686
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=567686
Reported-by: Dennis Schridde <devurandom <AT> gmx.net>
Tested-by: Dennis Schridde <devurandom <AT> gmx.net>

 pym/_emerge/depgraph.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2169b00..fd2c771 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -9064,7 +9064,9 @@ class _dep_check_composite_db(dbapi):
 			# Note: highest_visible is not necessarily the real highest
 			# visible, especially when --update is not enabled, so use
 			# < operator instead of !=.
-			if highest_visible is not None and pkg < highest_visible:
+			if (highest_visible is not None and pkg < highest_visible
+				and atom_set.findAtomForPackage(highest_visible,
+				modified_use=self._depgraph._pkg_use_enabled(highest_visible))):
 				return False
 		elif in_graph != pkg:
 			# Mask choices for packages that would trigger a slot


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2015-12-16 17:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2015-12-16 17:09 UTC (permalink / raw
  To: gentoo-commits

commit:     cb4ae2e2c9de062dc2085c7a7ce69f72cd2fb06f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 15 20:42:22 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 16 17:07:16 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cb4ae2e2

depgraph._resolve: consider unresolved @system atoms fatal (bug 568354)

Since @system atoms are presumably chosen by someone who knows what
they are doing (usually a gentoo developer), it makes sense to consider
resolution failures for these atoms as fatal errors.

X-Gentoo-Bug: 568354
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=568354
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fd2c771..d971749 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4015,7 +4015,7 @@ class depgraph(object):
 							continue
 
 						if not (isinstance(arg, SetArg) and \
-							arg.name in ("selected", "system", "world")):
+							arg.name in ("selected", "world")):
 							self._dynamic_config._unsatisfied_deps_for_display.append(
 								((myroot, atom), {"myparent" : arg}))
 							return 0, myfavorites


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-01-22 16:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-01-22 16:04 UTC (permalink / raw
  To: gentoo-commits

commit:     1cf4d1e8381a44d9628feb7e3892b4ef70390ce8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 16:03:38 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 16:03:47 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1cf4d1e8

BinpkgFetcher: suppress PORTAGE_SSH_OPTS KeyError message (bug 572494)

Use the "get" method to avoid triggering a KeyError message.

Fixes: 39d81c514c33 ("[...]config.__getitem__(): Partially drop backward compatibility for nonexistent keys.")
X-Gentoo-Bug: 572494
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=572494

 pym/_emerge/BinpkgFetcher.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 91d24e0..c8fd644 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -84,10 +84,9 @@ class BinpkgFetcher(SpawnProcess):
 		}
 
 		for k in ("PORTAGE_SSH_OPTS",):
-			try:
-				fcmd_vars[k] = settings[k]
-			except KeyError:
-				pass
+			v = settings.get(k)
+			if v is not None:
+				fcmd_vars[k] = v
 
 		fetch_env = dict(settings.items())
 		fetch_args = [portage.util.varexpand(x, mydict=fcmd_vars) \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-01-28 11:54 Alexander Berntsen
  2016-01-29 11:17 ` Alexander Berntsen
  0 siblings, 1 reply; 804+ messages in thread
From: Alexander Berntsen @ 2016-01-28 11:54 UTC (permalink / raw
  To: gentoo-commits

commit:     9c9165fb9420a285e8e2c62cb9ba8eb91120cb66
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 08:51:25 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 11:50:58 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c9165fb

Clarify no binary packages error (bug 573070)

Make emerge specify that it did not find any *binary packages* when
--usepkg is active, as opposed to that it did not find any *ebuilds*, as
this was confusing behaviour.

X-Gentoo-Bug: 573070
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573070

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Brian Dolbec       <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d971749..05d1da5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5125,7 +5125,10 @@ class depgraph(object):
 					cp_exists = True
 					break
 
-			writemsg("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+			writemsg("\nemerge: there are no %s to satisfy " %
+                ("binary packages" if
+                 self._frozen_config.myopts.get("--usepkgonly", "y") == True
+                 else "ebuilds") + green(xinfo) + ".\n", noiselevel=-1)
 			if isinstance(myparent, AtomArg) and \
 				not cp_exists and \
 				self._frozen_config.myopts.get(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
  2016-01-28 11:54 Alexander Berntsen
@ 2016-01-29 11:17 ` Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2016-01-29 11:17 UTC (permalink / raw
  To: gentoo-commits

commit:     9c9165fb9420a285e8e2c62cb9ba8eb91120cb66
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 08:51:25 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 11:50:58 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c9165fb

Clarify no binary packages error (bug 573070)

Make emerge specify that it did not find any *binary packages* when
--usepkg is active, as opposed to that it did not find any *ebuilds*, as
this was confusing behaviour.

X-Gentoo-Bug: 573070
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573070

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Brian Dolbec       <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d971749..05d1da5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5125,7 +5125,10 @@ class depgraph(object):
 					cp_exists = True
 					break
 
-			writemsg("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+			writemsg("\nemerge: there are no %s to satisfy " %
+                ("binary packages" if
+                 self._frozen_config.myopts.get("--usepkgonly", "y") == True
+                 else "ebuilds") + green(xinfo) + ".\n", noiselevel=-1)
 			if isinstance(myparent, AtomArg) and \
 				not cp_exists and \
 				self._frozen_config.myopts.get(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-01-29 23:04 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2016-01-29 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     8c9b1d6a7c115344cdc5bd8e7d122ab721aeb53a
Author:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 08:51:25 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 23:03:17 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8c9b1d6a

Clarify no binary packages error (bug 573070)

Make emerge specify that it did not find any *binary packages* when
--usepkg is active, as opposed to that it did not find any *ebuilds*, as
this was confusing behaviour.

X-Gentoo-Bug: 573070
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573070

Signed-off-by: Alexander Berntsen <bernalex <AT> gentoo.org>
Acked-by:      Brian Dolbec       <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d971749..05d1da5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5125,7 +5125,10 @@ class depgraph(object):
 					cp_exists = True
 					break
 
-			writemsg("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+			writemsg("\nemerge: there are no %s to satisfy " %
+                ("binary packages" if
+                 self._frozen_config.myopts.get("--usepkgonly", "y") == True
+                 else "ebuilds") + green(xinfo) + ".\n", noiselevel=-1)
 			if isinstance(myparent, AtomArg) and \
 				not cp_exists and \
 				self._frozen_config.myopts.get(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-02-02  1:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-02-02  1:33 UTC (permalink / raw
  To: gentoo-commits

commit:     1929e2bdab686004697c3d0fd999a563db43349c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  1 17:36:46 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  2 01:32:12 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1929e2bd

UserQuery: handle unicode (bug 573386)

Handle UnicodeDecodeError from the input function in python3, and from
comparisons with unicode literals in python2.

X-Gentoo-Bug:     573386
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=573386
Acked-by:         Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/UserQuery.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/UserQuery.py b/pym/_emerge/UserQuery.py
index c866a0d..8096d1b 100644
--- a/pym/_emerge/UserQuery.py
+++ b/pym/_emerge/UserQuery.py
@@ -1,11 +1,12 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
 
 import signal
 import sys
 
+from portage import _unicode_decode
 from portage.output import bold, create_color_func
 
 
@@ -47,17 +48,23 @@ class UserQuery(object):
 		elif colours is None:
 			colours=[bold]
 		colours=(colours*len(responses))[:len(responses)]
+		responses = [_unicode_decode(x) for x in responses]
 		if "--alert" in self.myopts:
 			prompt = '\a' + prompt
 		print(bold(prompt), end=' ')
 		try:
 			while True:
 				if sys.hexversion >= 0x3000000:
-					response=input("["+"/".join([colours[i](responses[i])
-								  for i in range(len(responses))])+"] ")
+					try:
+						response = input("[%s] " %
+							"/".join([colours[i](responses[i])
+							for i in range(len(responses))]))
+					except UnicodeDecodeError:
+						response = _unicode_decode(response.object).rstrip('\n')
 				else:
 					response=raw_input("["+"/".join([colours[i](responses[i])
 									  for i in range(len(responses))])+"] ")
+					response = _unicode_decode(response)
 				if response or not enter_invalid:
 					for key in responses:
 						# An empty response will match the


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-02-02  1:40 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-02-02  1:40 UTC (permalink / raw
  To: gentoo-commits

commit:     f292c3519082ad0932ad3a83a19e547c53b80824
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  2 01:40:02 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb  2 01:40:08 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f292c351

UserQuery: fix UnicodeDecodeError exception handler

I messed up while making a last moment fix to the previous commit.

Fixes: 1929e2bdab68 ("UserQuery: handle unicode (bug 573386)")

 pym/_emerge/UserQuery.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/UserQuery.py b/pym/_emerge/UserQuery.py
index 8096d1b..e20bbc6 100644
--- a/pym/_emerge/UserQuery.py
+++ b/pym/_emerge/UserQuery.py
@@ -59,8 +59,8 @@ class UserQuery(object):
 						response = input("[%s] " %
 							"/".join([colours[i](responses[i])
 							for i in range(len(responses))]))
-					except UnicodeDecodeError:
-						response = _unicode_decode(response.object).rstrip('\n')
+					except UnicodeDecodeError as e:
+						response = _unicode_decode(e.object).rstrip('\n')
 				else:
 					response=raw_input("["+"/".join([colours[i](responses[i])
 									  for i in range(len(responses))])+"] ")


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-03-29  8:39 Alexander Berntsen
  0 siblings, 0 replies; 804+ messages in thread
From: Alexander Berntsen @ 2016-03-29  8:39 UTC (permalink / raw
  To: gentoo-commits

commit:     12c91bce20eeb7d6746b148b1056084a18bd8c53
Author:     Sergei Trofimovich <siarheit <AT> google <DOT> com>
AuthorDate: Sat Mar 19 21:29:22 2016 +0000
Commit:     Alexander Berntsen <bernalex <AT> gentoo <DOT> org>
CommitDate: Tue Mar 29 08:31:08 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=12c91bce

cleanup: fix spaces to tabs in depgraph.py

Signed-off-by: Sergei Trofimovich <siarheit <AT> google.com>

 pym/_emerge/depgraph.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b58fbda..cfaafa3 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5126,9 +5126,9 @@ class depgraph(object):
 					break
 
 			writemsg("\nemerge: there are no %s to satisfy " %
-                ("binary packages" if
-                 self._frozen_config.myopts.get("--usepkgonly", "y") == True
-                 else "ebuilds") + green(xinfo) + ".\n", noiselevel=-1)
+				("binary packages" if
+				self._frozen_config.myopts.get("--usepkgonly", "y") == True
+				else "ebuilds") + green(xinfo) + ".\n", noiselevel=-1)
 			if isinstance(myparent, AtomArg) and \
 				not cp_exists and \
 				self._frozen_config.myopts.get(
@@ -6937,7 +6937,7 @@ class depgraph(object):
 		for root in implicit_libc_roots:
 			vardb = self._frozen_config.trees[root]["vartree"].dbapi
 			for atom in self._expand_virt_from_graph(root,
- 				portage.const.LIBC_PACKAGE_ATOM):
+				portage.const.LIBC_PACKAGE_ATOM):
 				if atom.blocker:
 					continue
 				for pkg in self._dynamic_config._package_tracker.match(root, atom):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-05-18 16:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-05-18 16:33 UTC (permalink / raw
  To: gentoo-commits

commit:     c5c5cabc4e25922710a911833cae69ad0ee2ef7a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 26 22:52:44 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 18 16:31:38 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5c5cabc

EbuildBuild: call _record_binpkg_info earlier (bug 578204)

Schedule _record_binpkg_info as a member of a TaskSequence, in
order to guarantee that it executes immediately after
EbuildBinpkg (and before the tasks that follow). This approach
is similar to that used to fix bug 562264.

X-Gentoo-bug: 578204
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=578204
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/EbuildBuild.py | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 95c14e4..001f55f 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -6,6 +6,7 @@ from __future__ import unicode_literals
 import io
 
 import _emerge.emergelog
+from _emerge.AsynchronousTask import AsynchronousTask
 from _emerge.EbuildExecuter import EbuildExecuter
 from _emerge.EbuildPhase import EbuildPhase
 from _emerge.EbuildBinpkg import EbuildBinpkg
@@ -325,8 +326,12 @@ class EbuildBuild(CompositeTask):
 						pkg=self.pkg, scheduler=self.scheduler,
 						settings=self.settings)
 					binpkg_tasks.add(task)
-					task.addExitListener(
-						self._record_binpkg_info)
+					# Guarantee that _record_binpkg_info is called
+					# immediately after EbuildBinpkg. Note that
+					# task.addExitListener does not provide the
+					# necessary guarantee (see bug 578204).
+					binpkg_tasks.add(self._RecordBinpkgInfo(
+						ebuild_binpkg=task, ebuild_build=self))
 
 		if binpkg_tasks:
 			self._start_task(binpkg_tasks, self._buildpkg_exit)
@@ -335,6 +340,19 @@ class EbuildBuild(CompositeTask):
 		self._final_exit(build)
 		self.wait()
 
+	class _RecordBinpkgInfo(AsynchronousTask):
+		"""
+		This class wraps the EbuildBuild _record_binpkg_info method
+		with an AsynchronousTask interface, so that it can be
+		scheduled as a member of a TaskSequence.
+		"""
+
+		__slots__ = ('ebuild_binpkg', 'ebuild_build',)
+
+		def _start(self):
+			self.ebuild_build._record_binpkg_info(self.ebuild_binpkg)
+			AsynchronousTask._start(self)
+
 	def _buildpkg_exit(self, packager):
 		"""
 		Released build dir lock when there is a failure or


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-08-22 16:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-08-22 16:09 UTC (permalink / raw
  To: gentoo-commits

commit:     d54a795615ccb769a25a0f8d6cc15ba930ec428f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 20 13:06:38 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 22 15:31:23 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d54a7956

Scheduler._terminate_tasks: purge _running_tasks (bug 425554)

Fix the _terminate_tasks method to purge unstarted tasks from
self._running_tasks, so that they don't keep the main loop
running indefinitely.

X-Gentoo-bug: 425554
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=425554
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/Scheduler.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 97b826a..71fe75f 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -328,7 +328,20 @@ class Scheduler(PollScheduler):
 	def _terminate_tasks(self):
 		self._status_display.quiet = True
 		for task in list(self._running_tasks.values()):
-			task.cancel()
+			if task.isAlive():
+				# This task should keep the main loop running until
+				# it has had an opportunity to clean up after itself.
+				# Rely on its exit hook to remove it from
+				# self._running_tasks when it has finished cleaning up.
+				task.cancel()
+			else:
+				# This task has been waiting to be started in one of
+				# self._task_queues which are all cleared below. It
+				# will never be started, so purged it from
+				# self._running_tasks so that it won't keep the main
+				# loop running.
+				del self._running_tasks[id(task)]
+
 		for q in self._task_queues.values():
 			q.clear()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-12-05  5:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-12-05  5:10 UTC (permalink / raw
  To: gentoo-commits

commit:     ab07ac68fa1e04ed64e2e0f6c753ff169a32d517
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  5 02:38:49 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 04:55:32 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab07ac68

depgraph: select highest version involved in slot conflict (bug 554070)

Fix depgraph's package selection logic to choose the highest version
involved in a slot conflict, for correct operation of conflict_downgrade
logic in the dep_zapdeps function which was introduced in commit
a9064d08ef4c92a5d0d1bfb3dc8a01b7850812b0. This will prevent incorrect
re-ordering of || deps in dep_zapdeps, as reported in bug 554070.

X-Gentoo-Bug: 554070
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=554070
Fixes a9064d08ef4c ("Solve more slot-operator conflicts (531656)")
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 9161914..ee6cf68 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6071,8 +6071,15 @@ class depgraph(object):
 					# will always end with a break statement below
 					# this point.
 					if find_existing_node:
-						e_pkg = next(self._dynamic_config._package_tracker.match(
-							root, pkg.slot_atom, installed=False), None)
+						# Use reversed iteration in order to get
+						# descending order here, so that the highest
+						# version involved in a slot conflict is
+						# selected. This is needed for correct operation
+						# of conflict_downgrade logic in the dep_zapdeps
+						# function (see bug 554070).
+						e_pkg = next(reversed(list(
+							self._dynamic_config._package_tracker.match(
+							root, pkg.slot_atom, installed=False))), None)
 
 						if not e_pkg:
 							break


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-12-05  5:14 Brian Dolbec
  0 siblings, 0 replies; 804+ messages in thread
From: Brian Dolbec @ 2016-12-05  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     40e3bbe96c522eb02870550b0f976efdbdd0c033
Author:     hackers.terabit <terabit.funtoo <AT> Yandex <DOT> com>
AuthorDate: Thu Oct 27 03:29:16 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Dec  5 05:13:14 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=40e3bbe9

_emerge/depgraph.py: Autounmask-write fails when there isn't a file in package.*/ bug 598116

Instead of outputting "!!! No file to write for ..." error message,
Use a sane default filename.
Add zz- prefix to ensure it remains the last file in sorted order.

X-Gentoo-bug: 598116
X-Gentoo-bug-url: https://bugs.gentoo.org/598116

 pym/_emerge/depgraph.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ee6cf68..cb12b05 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -8247,6 +8247,12 @@ class depgraph(object):
 									child.endswith("~"):
 									continue
 								stack.append(os.path.join(p, child))
+			# If the directory is empty add a file with name
+			# pattern file_name.default
+			if last_file_path is None:
+				last_file_path = os.path.join(file_path, file_path, "zz-autounmask")
+				with open(last_file_path, "a+") as default:
+					default.write("# " + file_name)
 
 			return last_file_path
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2016-12-29  9:13 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2016-12-29  9:13 UTC (permalink / raw
  To: gentoo-commits

commit:     7dc23bc66b410b5a2f9640dc93ca65f5b2678670
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 28 23:57:43 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 08:44:29 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7dc23bc6

depgraph: clarify "update has been skipped" message (bug 602854)

When an update has been skipped, clearly display both the selected and
skipped packages.

X-Gentoo-bug: 602854
X-Gentoo-bug-url: https://bugs.gentoo.org/602854
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index cb12b05..e298337 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1044,7 +1044,14 @@ class depgraph(object):
 			writemsg(str(pkg.slot_atom), noiselevel=-1)
 			if pkg.root_config.settings["ROOT"] != "/":
 				writemsg(" for %s" % (pkg.root,), noiselevel=-1)
-			writemsg("\n", noiselevel=-1)
+			writemsg("\n\n", noiselevel=-1)
+
+			selected_pkg = next(self._dynamic_config._package_tracker.match(
+				pkg.root, pkg.slot_atom), None)
+
+			writemsg("  selected: %s\n" % (selected_pkg,), noiselevel=-1)
+			writemsg("  skipped: %s (see unsatisfied dependency below)\n"
+				% (pkg,), noiselevel=-1)
 
 			for parent, root, atom in parent_atoms:
 				self._show_unsatisfied_dep(root, atom, myparent=parent)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-01-18 23:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-01-18 23:05 UTC (permalink / raw
  To: gentoo-commits

commit:     759e993a20c03366bc5de082e17ecfca2d6d9790
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 18 22:41:34 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jan 18 22:51:56 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=759e993a

depgraph: fix 'SonameAtom' object is not subscriptable (bug 606464)

Fixes: 11467fc64099 ("depgraph: soname dependency resolution (bug 282639)")
X-Gentoo-Bug: 606464
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=606464

 pym/_emerge/depgraph.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7a1427d..ce0fde1 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1449,10 +1449,7 @@ class depgraph(object):
 						continue
 
 					for parent, atom in self._dynamic_config._parent_atoms.get(other, []):
-						atom_set = InternalPackageSet(
-							initial_atoms=(atom,), allow_repo=True)
-						if not atom_set.findAtomForPackage(pkg,
-							modified_use=self._pkg_use_enabled(pkg)):
+						if not atom.match(pkg.with_use(self._pkg_use_enabled(pkg))):
 							self._dynamic_config._conflict_missed_update[pkg].setdefault(
 								"slot conflict", set())
 							self._dynamic_config._conflict_missed_update[pkg]["slot conflict"].add(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-01-26  4:19 Mike Gilbert
  0 siblings, 0 replies; 804+ messages in thread
From: Mike Gilbert @ 2017-01-26  4:19 UTC (permalink / raw
  To: gentoo-commits

commit:     65d2cc0514c0c91bb47ed78142446a8eb7d75a26
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 26 03:13:34 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Jan 26 04:18:23 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=65d2cc05

emerge: fix error handling for clean_logs

CleanLogs.clean() now returns a tuple (returncode, messages).

Fixes: f143e58dd3fd ("emaint: exit with non-zero status code when module fails (bug 567478)")
X-Gentoo-Bug: 607236
X-Gentoo-Bug-URL: https://bugs.gentoo.org/607236

 pym/_emerge/post_emerge.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/post_emerge.py b/pym/_emerge/post_emerge.py
index 0cb533c..7e6063c 100644
--- a/pym/_emerge/post_emerge.py
+++ b/pym/_emerge/post_emerge.py
@@ -29,10 +29,10 @@ def clean_logs(settings):
 		return
 
 	cleanlogs = CleanLogs()
-	errors = cleanlogs.clean(settings=settings)
-	if errors:
+	returncode, msgs = cleanlogs.clean(settings=settings)
+	if not returncode:
 		out = portage.output.EOutput()
-		for msg in errors:
+		for msg in msgs:
 			out.eerror(msg)
 
 def display_news_notification(root_config, myopts):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-02-21  1:33 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-02-21  1:33 UTC (permalink / raw
  To: gentoo-commits

commit:     75f0936b8866b143643abcd6c302cd72fc71eef3
Author:     Alexandru Elisei <alexandru.elisei <AT> gmail <DOT> com>
AuthorDate: Mon Feb 20 17:53:56 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 21 00:01:38 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=75f0936b

emerge: sync given repos even if auto-sync is false (bug 610328)

The auto-sync attribute is more useful for emerge --sync with zero repo
arguments. When specific repo arguments are given to emerge --sync, it
makes sense to sync those repos regardless of the auto-sync attribute.

X-Gentoo-Bug: 610328
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=610328

 pym/_emerge/actions.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 71e362e3c..cc0269d5d 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1999,9 +1999,13 @@ def action_sync(emerge_config, trees=DeprecationWarning,
 			action=action, args=[], trees=trees, opts=opts)
 
 	syncer = SyncRepos(emerge_config)
-
 	return_messages = "--quiet" not in emerge_config.opts
-	success, msgs = syncer.auto_sync(options={'return-messages': return_messages})
+	options = {'return-messages' : return_messages}
+	if emerge_config.args:
+		options['repo'] = emerge_config.args
+		success, msgs = syncer.repo(options=options)
+	else:
+		success, msgs = syncer.auto_sync(options=options)
 	if return_messages:
 		print_results(msgs)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-03-16 23:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-03-16 23:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e5d638cf855656afab141da8d7b4d7f66cad3450
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 16 20:48:48 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 16 23:21:04 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5d638cf

depgraph: fix missed atom_not_selected initialization (bug 612846)

Fix the _slot_operator_update_probe method to ensure that the
atom_not_selected variable is always properly initialized. This
problem prevented the method from identifying slot operator rebuild
candidates, leading to dependency conflicts and/or missed updates.
For example, this may have triggered the missed llvm update reported
in bug 611742, since these dependencies from the mesa-17.0.1 ebuild
are capable of triggering the problem, when atom_not_selected is not
properly set to True for the second atom:

	|| (
		sys-devel/llvm:4[${MULTILIB_USEDEP}]
		>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
	)

X-Gentoo-bug: 612846
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612846
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ad94fb70f..f4145d05f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1895,7 +1895,9 @@ class depgraph(object):
 			all_candidate_pkgs = None
 
 			for atom in atoms:
-				atom_not_selected = False
+				# The _select_atoms_probe method is expensive, so initialization
+				# of this variable is only performed on demand.
+				atom_not_selected = None
 
 				if not atom.package:
 					unevaluated_atom = None
@@ -1977,8 +1979,8 @@ class depgraph(object):
 						if selected_atoms is None:
 							selected_atoms = self._select_atoms_probe(
 								dep.child.root, replacement_parent)
-						if unevaluated_atom not in selected_atoms:
-							atom_not_selected = True
+						atom_not_selected = unevaluated_atom not in selected_atoms
+						if atom_not_selected:
 							break
 
 					if not insignificant and \
@@ -1989,6 +1991,15 @@ class depgraph(object):
 							(pkg, unevaluated_atom or atom))
 						candidate_pkgs.append(pkg)
 
+				# When unevaluated_atom is None, it means that atom is
+				# an soname atom which is unconditionally selected, and
+				# _select_atoms_probe is not applicable.
+				if atom_not_selected is None and unevaluated_atom is not None:
+					if selected_atoms is None:
+						selected_atoms = self._select_atoms_probe(
+							dep.child.root, replacement_parent)
+					atom_not_selected = unevaluated_atom not in selected_atoms
+
 				if atom_not_selected:
 					continue
 				replacement_candidates.append(candidate_pkg_atoms)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-03-23 21:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-03-23 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     6797ad3a8a43695b8664a8e8f984a2185aedca06
Author:     Daniel M. Weeks <dan <AT> danweeks <DOT> net>
AuthorDate: Thu Mar 23 20:29:16 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 23 21:42:50 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6797ad3a

Display network-sandbox* FEATURES before setup phase

 pym/_emerge/EbuildPhase.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index fc185fcfd..6191ee2b3 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -45,10 +45,10 @@ class EbuildPhase(CompositeTask):
 	# FEATURES displayed prior to setup phase
 	_features_display = (
 		"ccache", "compressdebug", "distcc", "distcc-pump", "fakeroot",
-		"installsources", "keeptemp", "keepwork", "nostrip",
-		"preserve-libs", "sandbox", "selinux", "sesandbox",
-		"splitdebug", "suidctl", "test", "userpriv",
-		"usersandbox"
+		"installsources", "keeptemp", "keepwork", "network-sandbox",
+		"network-sandbox-proxy", "nostrip", "preserve-libs", "sandbox",
+		"selinux", "sesandbox", "splitdebug", "suidctl", "test",
+		"userpriv", "usersandbox"
 	)
 
 	# Locked phases


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-03-27 21:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-03-27 21:41 UTC (permalink / raw
  To: gentoo-commits

commit:     eaf22a6d88ad8e0b7a3a1e21f3234c6b7037018a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 27 06:44:02 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 27 21:40:38 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=eaf22a6d

SpawnProcess: fix event loop recursion in _pipe_logger_exit (bug 613990)

Fix SpawnProcess._pipe_logger_exit to wait for process exit status
asynchronously, in order to avoid event loop recursion. This is
required for asyncio compatibility, and also protects emerge from
exceeding the maximum recursion depth limit like in bug 402335.

X-Gentoo-bug: 613990
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=613990
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/SpawnProcess.py |  3 +--
 pym/_emerge/SubProcess.py   | 23 ++++++++++++++++++++++-
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index e046640ea..7326254ca 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -170,8 +170,7 @@ class SpawnProcess(SubProcess):
 
 	def _pipe_logger_exit(self, pipe_logger):
 		self._pipe_logger = None
-		self._unregister()
-		self.wait()
+		self._async_waitpid()
 
 	def _waitpid_loop(self):
 		SubProcess._waitpid_loop(self)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 13d938297..b81cfd5f6 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -12,7 +12,7 @@ import errno
 class SubProcess(AbstractPollTask):
 
 	__slots__ = ("pid",) + \
-		("_dummy_pipe_fd", "_files", "_reg_id")
+		("_dummy_pipe_fd", "_files", "_reg_id", "_waitpid_id")
 
 	# This is how much time we allow for waitpid to succeed after
 	# we've sent a kill signal to our subprocess.
@@ -101,6 +101,23 @@ class SubProcess(AbstractPollTask):
 
 		return self.returncode
 
+	def _async_waitpid(self):
+		"""
+		Wait for exit status of self.pid asynchronously, and then
+		set the returncode and notify exit listeners. This is
+		prefered over _waitpid_loop, since the synchronous nature
+		of _waitpid_loop can cause event loop recursion.
+		"""
+		if self._waitpid_id is None:
+			self._waitpid_id = self.scheduler.child_watch_add(
+				self.pid, self._async_waitpid_cb)
+
+	def _async_waitpid_cb(self, pid, condition, user_data=None):
+		if pid != self.pid:
+			raise AssertionError("expected pid %s, got %s" % (self.pid, pid))
+		self._set_returncode((pid, condition))
+		self.wait()
+
 	def _waitpid_loop(self):
 		source_id = self.scheduler.child_watch_add(
 			self.pid, self._waitpid_cb)
@@ -129,6 +146,10 @@ class SubProcess(AbstractPollTask):
 			self.scheduler.source_remove(self._reg_id)
 			self._reg_id = None
 
+		if self._waitpid_id is not None:
+			self.scheduler.source_remove(self._waitpid_id)
+			self._waitpid_id = None
+
 		if self._files is not None:
 			for f in self._files.values():
 				if isinstance(f, int):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-03-31 20:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-03-31 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     09ee3124256c2bb0785e246533b62d310d54082e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 22 16:29:49 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 31 20:21:53 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=09ee3124

pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)

Fix pkg_use_display to test if the prefixed flag is in use.force or
use.mask, rather than the unprefixed flag.

X-Gentoo-bug: 490562
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/UseFlagDisplay.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/UseFlagDisplay.py b/pym/_emerge/UseFlagDisplay.py
index f46047454..12820e9d1 100644
--- a/pym/_emerge/UseFlagDisplay.py
+++ b/pym/_emerge/UseFlagDisplay.py
@@ -3,6 +3,7 @@
 
 from __future__ import unicode_literals
 
+import collections
 from itertools import chain
 import sys
 
@@ -60,6 +61,10 @@ class UseFlagDisplay(object):
 	sort_separated = cmp_sort_key(_cmp_separated)
 	del _cmp_separated
 
+
+_flag_info = collections.namedtuple('_flag_info', ('flag', 'display'))
+
+
 def pkg_use_display(pkg, opts, modified_use=None):
 	settings = pkg.root_config.settings
 	use_expand = pkg.use.expand
@@ -81,27 +86,29 @@ def pkg_use_display(pkg, opts, modified_use=None):
 			if f.startswith(flag_prefix):
 				use_expand_flags.add(f)
 				use_enabled.setdefault(
-					varname.upper(), []).append(f[len(flag_prefix):])
+					varname.upper(), []).append(
+						_flag_info(f, f[len(flag_prefix):]))
 
 		for f in pkg.iuse.all:
 			if f.startswith(flag_prefix):
 				use_expand_flags.add(f)
 				if f not in use:
 					use_disabled.setdefault(
-						varname.upper(), []).append(f[len(flag_prefix):])
+						varname.upper(), []).append(
+							_flag_info(f, f[len(flag_prefix):]))
 
 	var_order = set(use_enabled)
 	var_order.update(use_disabled)
 	var_order = sorted(var_order)
 	var_order.insert(0, 'USE')
 	use.difference_update(use_expand_flags)
-	use_enabled['USE'] = list(use)
+	use_enabled['USE'] = list(_flag_info(f, f) for f in use)
 	use_disabled['USE'] = []
 
 	for f in pkg.iuse.all:
 		if f not in use and \
 			f not in use_expand_flags:
-			use_disabled['USE'].append(f)
+			use_disabled['USE'].append(_flag_info(f, f))
 
 	flag_displays = []
 	for varname in var_order:
@@ -109,9 +116,9 @@ def pkg_use_display(pkg, opts, modified_use=None):
 			continue
 		flags = []
 		for f in use_enabled.get(varname, []):
-			flags.append(UseFlagDisplay(f, True, f in forced_flags))
+			flags.append(UseFlagDisplay(f.display, True, f.flag in forced_flags))
 		for f in use_disabled.get(varname, []):
-			flags.append(UseFlagDisplay(f, False, f in forced_flags))
+			flags.append(UseFlagDisplay(f.display, False, f.flag in forced_flags))
 		if alphabetical_use:
 			flags.sort(key=UseFlagDisplay.sort_combined)
 		else:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-04-04  3:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-04-04  3:20 UTC (permalink / raw
  To: gentoo-commits

commit:     f05d0864653e082bd60db67b52132c4ba6515339
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  3 01:50:45 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr  4 03:19:19 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f05d0864

EbuildBuild: eliminate call to digestgen (bug 614116)

Eliminate the call to digestgen in EbuildBuild._fetchonly_exit,
and make Scheduler._generate_digests call it earlier when
--fetchonly is enabled. This avoids event loop recursion which
is not compatible with asyncio (digestgen makes many calls that
can trigger event loop recursion).

X-Gentoo-bug: 614116
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614116
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/EbuildBuild.py | 5 -----
 pym/_emerge/Scheduler.py   | 3 ---
 2 files changed, 8 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 001f55fff..11eb1c93e 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -21,7 +21,6 @@ from _emerge.TaskSequence import TaskSequence
 import portage
 from portage import _encodings, _unicode_decode, _unicode_encode, os
 from portage.package.ebuild.digestcheck import digestcheck
-from portage.package.ebuild.digestgen import digestgen
 from portage.package.ebuild.doebuild import _check_temp_dir
 from portage.package.ebuild._spawn_nofetch import spawn_nofetch
 
@@ -168,10 +167,6 @@ class EbuildBuild(CompositeTask):
 		if self.returncode != os.EX_OK:
 			portdb = self.pkg.root_config.trees[self._tree].dbapi
 			spawn_nofetch(portdb, self._ebuild_path, settings=self.settings)
-		elif 'digest' in self.settings.features:
-			if not digestgen(mysettings=self.settings,
-				myportdb=self.pkg.root_config.trees[self._tree].dbapi):
-				self.returncode = 1
 		self.wait()
 
 	def _pre_clean_exit(self, pre_clean_phase):

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 58ff97139..079fac7b9 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -616,9 +616,6 @@ class Scheduler(PollScheduler):
 		tasks are started.
 		"""
 
-		if '--fetchonly' in self.myopts:
-			return os.EX_OK
-
 		digest = '--digest' in self.myopts
 		if not digest:
 			for pkgsettings in self.pkgsettings.values():


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-04-12 16:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-04-12 16:46 UTC (permalink / raw
  To: gentoo-commits

commit:     e9cd44dbd0366267b8b6beb011d91a9f99fed3cd
Author:     Peter Foley <pefoley2 <AT> pefoley <DOT> com>
AuthorDate: Wed Apr 12 06:48:48 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 12 16:43:52 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9cd44db

Prevent crash if os.nice() fails

If settings["PORTAGE_NICENESS"] is undefined, portage crashes with a
KeyError when trying to print the error.

Signed-off-by: Peter Foley <pefoley2 <AT> pefoley.com>
X-Gentoo-bug: 615328
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615328

 pym/_emerge/actions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 818fab90a..1bc20c3ed 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2553,7 +2553,7 @@ def nice(settings):
 	except (OSError, ValueError) as e:
 		out = portage.output.EOutput()
 		out.eerror("Failed to change nice value to '%s'" % \
-			settings["PORTAGE_NICENESS"])
+			settings.get("PORTAGE_NICENESS", "0"))
 		out.eerror("%s\n" % str(e))
 
 def ionice(settings):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-04-20 19:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-04-20 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     b9767a27b8af541a05de6a376493b6556649f24b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 19 02:37:38 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 20 19:39:00 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b9767a27

depgraph: fix _validate_blockers to revert state from previous calls

Since the _solve_non_slot_operator_slot_conflicts method can
remove packages from the graph, it's possible that some of the
state changes made by previous _validate_blockers calls are
no longer valid. Therefore, revert state when appropriate.

Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 8a614c495..3232816d5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -6901,6 +6901,12 @@ class depgraph(object):
 			self._dynamic_config._blocker_uninstalls = digraph()
 			self._dynamic_config.digraph.difference_update(previous_uninstall_tasks)
 
+		# Revert state from previous calls.
+		self._dynamic_config._blocker_parents.update(
+			self._dynamic_config._irrelevant_blockers)
+		self._dynamic_config._irrelevant_blockers.clear()
+		self._dynamic_config._unsolvable_blockers.clear()
+
 		for blocker in self._dynamic_config._blocker_parents.leaf_nodes():
 			self._spinner_update()
 			root_config = self._frozen_config.roots[blocker.root]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-04-20 19:39 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-04-20 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     2366c903bab8f44463106e878f4e0c1ba81f42f8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 19 04:17:50 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 20 19:39:00 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2366c903

depgraph._in_blocker_conflict: call _validate_blockers if needed (bug 615982)

Sometimes _complete_graph calls _slot_operator_update_probe, which
sometimes calls _in_blocker_conflict. This case occurs infrequently,
so call _validate_blockers only if needed.

Fixes: a83bb83909c5 ("depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)")
X-Gentoo-bug: 615982
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615982
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3232816d5..e1119af3c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2176,9 +2176,9 @@ class depgraph(object):
 		only works after the _validate_blockers method has been called.
 		"""
 
-		if self._dynamic_config._blocked_pkgs is None:
-			raise AssertionError(
-				'_in_blocker_conflict called before _validate_blockers')
+		if (self._dynamic_config._blocked_pkgs is None
+			and not self._validate_blockers()):
+			raise self._unknown_internal_error()
 
 		if pkg in self._dynamic_config._blocked_pkgs:
 			return True
@@ -6728,7 +6728,14 @@ class depgraph(object):
 		packages within the graph.  If necessary, create hard deps to ensure
 		correct merge order such that mutually blocking packages are never
 		installed simultaneously. Also add runtime blockers from all installed
-		packages if any of them haven't been added already (bug 128809)."""
+		packages if any of them haven't been added already (bug 128809).
+
+		Normally, this method is called only after the graph is complete, and
+		after _solve_non_slot_operator_slot_conflicts has had an opportunity
+		to solve slot conflicts (possibly removing some blockers). It can also
+		be called earlier, in order to get a preview of the blocker data, but
+		then it needs to be called again after the graph is complete.
+		"""
 
 		# The _in_blocker_conflict method needs to assert that this method
 		# has been called before it, by checking that it is not None.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-05-30  7:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-05-30  7:22 UTC (permalink / raw
  To: gentoo-commits

commit:     0f9bc8659094fe6a100a64e51cc9d51e95c5d659
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 28 10:03:34 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 30 07:21:05 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0f9bc865

depgraph: account for binpkg-multi-instance in unused warning (bug 619620)

With FEATURES=binpkg-multi-instance, it is normal to have some
unused binary packages, so don't warn if the selected package
is the latest version and the most recent build.

X-Gentoo-bug: 619620
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=619620
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 726835dd4..2dc432431 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -876,6 +876,15 @@ class depgraph(object):
 					self._dynamic_config.ignored_binaries.pop(pkg)
 					break
 
+				# NOTE: The Package.__ge__ implementation accounts for
+				# differences in build_time, so the warning about "ignored"
+				# packages will be triggered if both packages are the same
+				# version and selected_pkg is not the most recent build.
+				if (selected_pkg.type_name == "binary" and
+					selected_pkg >= pkg):
+					self._dynamic_config.ignored_binaries.pop(pkg)
+					break
+
 				if selected_pkg.installed and \
 					selected_pkg.cpv == pkg.cpv and \
 					selected_pkg.build_time == pkg.build_time:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-07-09 17:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-07-09 17:20 UTC (permalink / raw
  To: gentoo-commits

commit:     66df1d045a64f8ad6453d9668cdb66980c128b69
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  8 19:44:40 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul  9 17:18:03 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=66df1d04

fuzzy search: weigh category similarity independently (bug 623648)

Weigh the similarity of category and package names independently,
in order to avoid matching lots of irrelevant packages in the same
category when the package name is much shorter than the category
name.

X-Gentoo-bug: 623648
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=623648
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/search.py | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 20a0c026e..dc91ad315 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -264,15 +264,33 @@ class search(object):
 			if self.fuzzy:
 				fuzzy = True
 				cutoff = float(self.search_similarity) / 100
-				seq_match = difflib.SequenceMatcher()
-				seq_match.set_seq2(self.searchkey.lower())
+				if match_category:
+					# Weigh the similarity of category and package
+					# names independently, in order to avoid matching
+					# lots of irrelevant packages in the same category
+					# when the package name is much shorter than the
+					# category name.
+					part_split = portage.catsplit
+				else:
+					part_split = lambda match_string: (match_string,)
 
-				def fuzzy_search(match_string):
+				part_matchers = []
+				for part in part_split(self.searchkey):
+					seq_match = difflib.SequenceMatcher()
+					seq_match.set_seq2(part.lower())
+					part_matchers.append(seq_match)
+
+				def fuzzy_search_part(seq_match, match_string):
 					seq_match.set_seq1(match_string.lower())
 					return (seq_match.real_quick_ratio() >= cutoff and
 						seq_match.quick_ratio() >= cutoff and
 						seq_match.ratio() >= cutoff)
 
+				def fuzzy_search(match_string):
+					return all(fuzzy_search_part(seq_match, part)
+						for seq_match, part in zip(
+						part_matchers, part_split(match_string)))
+
 		for package in self._cp_all():
 			self._spinner_update()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-09-25  2:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-09-25  2:04 UTC (permalink / raw
  To: gentoo-commits

commit:     5b286b267cb5cc69cac1c99ec8704ff0e0463e11
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 24 18:52:22 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 25 02:03:08 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5b286b26

depgraph: make _minimize_children deterministic (bug 631894)

In order for the eliminate_pkg loop to produce deterministic results,
the order of the pkgs list must not be random. Prefer to eliminate
installed packages first, in case rebuilds are needed, and also sort
in ascending order so that older versions are eliminated first.

X-Gentoo-bug: 631894
X-Gentoo-bug-url: https://bugs.gentoo.org/631894
Reviewed-by: Manuel Rüger <mrueg <AT> gentoo.org>

 pym/_emerge/depgraph.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index b4fc5f297..785c036b8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3584,6 +3584,15 @@ class depgraph(object):
 						if atom_set.findAtomForPackage(pkg2, modified_use=self._pkg_use_enabled(pkg2)):
 							atom_pkg_graph.add(pkg2, atom)
 
+			# In order for the following eliminate_pkg loop to produce
+			# deterministic results, the order of the pkgs list must
+			# not be random (bug 631894). Prefer to eliminate installed
+			# packages first, in case rebuilds are needed, and also sort
+			# in ascending order so that older versions are eliminated
+			# first.
+			pkgs = (sorted(pkg for pkg in pkgs if pkg.installed) +
+				sorted(pkg for pkg in pkgs if not pkg.installed))
+
 			for pkg in pkgs:
 				eliminate_pkg = True
 				for atom in atom_pkg_graph.parent_nodes(pkg):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-09-25  2:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-09-25  2:57 UTC (permalink / raw
  To: gentoo-commits

commit:     164038260338d48b12432e166aa34dbd028a167d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 25 02:25:20 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 25 02:55:15 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=16403826

search: only pass Atom instance to dbapi match methods

This fixes errors like the following:

  File "_emerge/depgraph.py", line 3972, in _select_files
    self._frozen_config.spinner, self._frozen_config.myopts)
  File "_emerge/depgraph.py", line 9474, in ambiguous_package_name
    s.output()
  File "_emerge/search.py", line 469, in output
    self.getInstallationStatus(mycat+'/'+mypkg))
  File "_emerge/search.py", line 494, in getInstallationStatus
    installed_package = self._vardb.match(package)
  File "_emerge/FakeVartree.py", line 111, in _match_wrapper
    matches = self._match(cpv, use_cache=use_cache)
  File "_emerge/resolver/DbapiProvidesIndex.py", line 39, in match
    if atom.soname:
AttributeError: 'str' object has no attribute 'soname'

 pym/_emerge/search.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index dc91ad315..36897fb15 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -162,7 +162,10 @@ class search(object):
 		multiple package databases. If necessary, old-style virtuals
 		can be performed on atoms prior to calling this method.
 		"""
-		cp = portage.dep_getkey(atom)
+		if not isinstance(atom, portage.dep.Atom):
+			atom = portage.dep.Atom(atom)
+
+		cp = atom.cp
 		if level == "match-all":
 			matches = set()
 			for db in self._dbs:
@@ -489,6 +492,9 @@ class search(object):
 	# private interface
 	#
 	def getInstallationStatus(self,package):
+		if not isinstance(package, portage.dep.Atom):
+			package = portage.dep.Atom(package)
+
 		installed_package = self._vardb.match(package)
 		if installed_package:
 			try:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-09-29 17:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-09-29 17:24 UTC (permalink / raw
  To: gentoo-commits

commit:     d82bf7c0a2cfa9590849aa7fd3ea1257a7f45006
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 29 08:07:34 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 29 17:22:32 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d82bf7c0

_solve_..slot_conflicts: handle forced reinstall (bug 632202)

Fix the slot conflict solver to use the _want_installed_pkg
method to identify installed packages that are intended to
be reinstalled for some reason (such as @preserved-rebuild).

X-Gentoo-bug: 632202
X-Gentoo-bug-url: https://bugs.gentoo.org/632202
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3b81c5c76..b0149c4dc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1337,7 +1337,8 @@ class depgraph(object):
 					self._dynamic_config._parent_atoms.get(pkg, []))
 
 			for parent, atom in all_parent_atoms:
-				is_arg_parent = isinstance(parent, AtomArg)
+				is_arg_parent = (inst_pkg is not None and
+					not self._want_installed_pkg(inst_pkg))
 				is_non_conflict_parent = parent not in conflict_pkgs and \
 					parent not in indirect_conflict_pkgs
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-10-04  1:34 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-10-04  1:34 UTC (permalink / raw
  To: gentoo-commits

commit:     b4b0e6b0aaa1feb405823277b82ebb2e4820e0b8
Author:     Matija Skala <mskala <AT> gmx <DOT> com>
AuthorDate: Wed Sep 27 22:40:25 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct  4 01:30:12 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b4b0e6b0

BinpkgExtractorAsync: remove trailer when decompressing binary packages

xz and zstd don't support trailing data
and fail upon encountering xpak trailer

Bug: 630132
Closes: https://github.com/gentoo/portage/pull/210

 pym/_emerge/BinpkgExtractorAsync.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py
index e85f4ecac..173845974 100644
--- a/pym/_emerge/BinpkgExtractorAsync.py
+++ b/pym/_emerge/BinpkgExtractorAsync.py
@@ -74,20 +74,22 @@ class BinpkgExtractorAsync(SpawnProcess):
 				self._async_wait()
 				return
 
-		# Add -q to decomp_cmd opts, in order to avoid "trailing garbage
-		# after EOF ignored" warning messages due to xpak trailer.
+		pkg_xpak = portage.xpak.tbz2(self.pkg_path)
+		pkg_xpak.scan()
+
 		# SIGPIPE handling (128 + SIGPIPE) should be compatible with
 		# assert_sigpipe_ok() that's used by the ebuild unpack() helper.
 		self.args = [self._shell_binary, "-c",
-			("%s -cq -- %s | tar -xp %s -C %s -f - ; " + \
+			("head -c-%d -- %s | %s | tar -xp %s -C %s -f - ; " + \
 			"p=(${PIPESTATUS[@]}) ; " + \
 			"if [[ ${p[0]} != 0 && ${p[0]} != %d ]] ; then " % (128 + signal.SIGPIPE) + \
 			"echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
 			"if [ ${p[1]} != 0 ] ; then " + \
 			"echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \
 			"exit 0 ;") % \
-			(decomp_cmd,
+			(pkg_xpak.xpaksize,
 			portage._shell_quote(self.pkg_path),
+			decomp_cmd,
 			tar_options,
 			portage._shell_quote(self.image_dir))]
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-10-04  7:09 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-10-04  7:09 UTC (permalink / raw
  To: gentoo-commits

commit:     26c0a0e31b5150f7ef23b2156b87863e47dd5996
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  4 06:07:05 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct  4 07:07:32 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=26c0a0e3

BinpkgExtractorAsync: fix PIPESTATUS error handling

Fixes: b4b0e6b0aaa1 ("remove trailer when decompressing binary packages")

 pym/_emerge/BinpkgExtractorAsync.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py
index 173845974..07ba2a1b7 100644
--- a/pym/_emerge/BinpkgExtractorAsync.py
+++ b/pym/_emerge/BinpkgExtractorAsync.py
@@ -80,17 +80,21 @@ class BinpkgExtractorAsync(SpawnProcess):
 		# SIGPIPE handling (128 + SIGPIPE) should be compatible with
 		# assert_sigpipe_ok() that's used by the ebuild unpack() helper.
 		self.args = [self._shell_binary, "-c",
-			("head -c-%d -- %s | %s | tar -xp %s -C %s -f - ; " + \
-			"p=(${PIPESTATUS[@]}) ; " + \
-			"if [[ ${p[0]} != 0 && ${p[0]} != %d ]] ; then " % (128 + signal.SIGPIPE) + \
-			"echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
-			"if [ ${p[1]} != 0 ] ; then " + \
-			"echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \
+			("cmd0=(head -c-%d -- %s) cmd1=(%s) cmd2=(tar -xp %s -C %s -f -); " + \
+			'"${cmd0[@]}" | "${cmd1[@]}" | "${cmd2[@]}"; ' + \
+			"p=(${PIPESTATUS[@]}) ; for i in {0..2}; do " + \
+			"if [[ ${p[$i]} != 0 && ${p[$i]} != %d ]] ; then " + \
+			"echo command $(eval \"echo \\\"'\\${cmd$i[*]}'\\\"\") " + \
+			"failed with status ${p[$i]} ; exit ${p[$i]} ; fi ; done; " + \
+			"if [ ${p[$i]} != 0 ] ; then " + \
+			"echo command $(eval \"echo \\\"'\\${cmd$i[*]}'\\\"\") " + \
+			"failed with status ${p[$i]} ; exit ${p[$i]} ; fi ; " + \
 			"exit 0 ;") % \
 			(pkg_xpak.xpaksize,
 			portage._shell_quote(self.pkg_path),
 			decomp_cmd,
 			tar_options,
-			portage._shell_quote(self.image_dir))]
+			portage._shell_quote(self.image_dir),
+			128 + signal.SIGPIPE)]
 
 		SpawnProcess._start(self)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2017-12-10  8:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2017-12-10  8:42 UTC (permalink / raw
  To: gentoo-commits

commit:     4a0421e1768dccafd4f9edb77f61cc186afb18d3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 10 00:29:27 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 10 00:41:21 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a0421e1

BinpkgExtractorAsync: use posix compatible head arguments (bug 640450)

Fixes: b4b0e6b0aaa1 ("BinpkgExtractorAsync: remove trailer when decompressing binary packages")
Bug: https://bugs.gentoo.org/640450

 pym/_emerge/BinpkgExtractorAsync.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py
index 07ba2a1b7..4468efde6 100644
--- a/pym/_emerge/BinpkgExtractorAsync.py
+++ b/pym/_emerge/BinpkgExtractorAsync.py
@@ -80,7 +80,7 @@ class BinpkgExtractorAsync(SpawnProcess):
 		# SIGPIPE handling (128 + SIGPIPE) should be compatible with
 		# assert_sigpipe_ok() that's used by the ebuild unpack() helper.
 		self.args = [self._shell_binary, "-c",
-			("cmd0=(head -c-%d -- %s) cmd1=(%s) cmd2=(tar -xp %s -C %s -f -); " + \
+			("cmd0=(head -c %d -- %s) cmd1=(%s) cmd2=(tar -xp %s -C %s -f -); " + \
 			'"${cmd0[@]}" | "${cmd1[@]}" | "${cmd2[@]}"; ' + \
 			"p=(${PIPESTATUS[@]}) ; for i in {0..2}; do " + \
 			"if [[ ${p[$i]} != 0 && ${p[$i]} != %d ]] ; then " + \
@@ -90,7 +90,7 @@ class BinpkgExtractorAsync(SpawnProcess):
 			"echo command $(eval \"echo \\\"'\\${cmd$i[*]}'\\\"\") " + \
 			"failed with status ${p[$i]} ; exit ${p[$i]} ; fi ; " + \
 			"exit 0 ;") % \
-			(pkg_xpak.xpaksize,
+			(pkg_xpak.filestat.st_size - pkg_xpak.xpaksize,
 			portage._shell_quote(self.pkg_path),
 			decomp_cmd,
 			tar_options,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-01-05 20:36 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-01-05 20:36 UTC (permalink / raw
  To: gentoo-commits

commit:     e3a953fe5bfc287c7f2bae85ad4a196baf7d64e4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  5 20:33:13 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan  5 20:34:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e3a953fe

load_emerge_config: fix 'env' keyword argument to override os.environ

 pym/_emerge/actions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 3c6c265f7..ed3db756e 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2423,10 +2423,11 @@ def load_emerge_config(emerge_config=None, **kargs):
 	if emerge_config is None:
 		emerge_config = _emerge_config(**kargs)
 
+	env = kargs.get('env', os.environ)
 	kwargs = {}
 	for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT"),
 			("eprefix", "EPREFIX")):
-		v = os.environ.get(envvar, None)
+		v = env.get(envvar)
 		if v and v.strip():
 			kwargs[k] = v
 	emerge_config.trees = portage.create_trees(trees=emerge_config.trees,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-01-07 11:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-01-07 11:56 UTC (permalink / raw
  To: gentoo-commits

commit:     a004edaf42e8ae13d0db51d915746317b4133630
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  7 11:48:44 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan  7 11:53:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a004edaf

load_emerge_config: add 'env' keyword argument

 pym/_emerge/actions.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ed3db756e..97df9f716 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2418,13 +2418,13 @@ class _emerge_config(SlotObject):
 	def __len__(self):
 		return 3
 
-def load_emerge_config(emerge_config=None, **kargs):
+def load_emerge_config(emerge_config=None, env=None, **kargs):
 
 	if emerge_config is None:
 		emerge_config = _emerge_config(**kargs)
 
-	env = kargs.get('env', os.environ)
-	kwargs = {}
+	env = os.environ if env is None else env
+	kwargs = {'env': env}
 	for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT"),
 			("eprefix", "EPREFIX")):
 		v = env.get(envvar)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-01-26 14:59 Michał Górny
  0 siblings, 0 replies; 804+ messages in thread
From: Michał Górny @ 2018-01-26 14:59 UTC (permalink / raw
  To: gentoo-commits

commit:     eab2edb8b513ba62e8d7ce3bd03c4a686d77cc2c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 25 08:32:40 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jan 26 14:59:00 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=eab2edb8

_emerge.Ebuild*: delay creating DISTDIR shadow until src_unpack

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/_emerge/EbuildExecuter.py | 4 ----
 pym/_emerge/EbuildPhase.py    | 6 ++++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/EbuildExecuter.py b/pym/_emerge/EbuildExecuter.py
index ab79ce901..d387b42be 100644
--- a/pym/_emerge/EbuildExecuter.py
+++ b/pym/_emerge/EbuildExecuter.py
@@ -8,7 +8,6 @@ import portage
 from portage import os
 from portage.eapi import eapi_has_src_prepare_and_src_configure, \
 	eapi_exports_replace_vars
-from portage.package.ebuild.prepare_build_dirs import _prepare_fake_distdir
 
 class EbuildExecuter(CompositeTask):
 
@@ -25,9 +24,6 @@ class EbuildExecuter(CompositeTask):
 		cleanup = 0
 		portage.prepare_build_dirs(pkg.root, settings, cleanup)
 
-		alist = settings.configdict["pkg"].get("A", "").split()
-		_prepare_fake_distdir(settings, alist)
-
 		if eapi_exports_replace_vars(settings['EAPI']):
 			vardb = pkg.root_config.trees['vartree'].dbapi
 			settings["REPLACING_VERSIONS"] = " ".join(

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index aa3a66831..d3fada622 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import gzip
@@ -12,7 +12,7 @@ from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
 from _emerge.EbuildProcess import EbuildProcess
 from _emerge.CompositeTask import CompositeTask
 from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir,
-		_prepare_fake_filesdir)
+		_prepare_fake_distdir, _prepare_fake_filesdir)
 from portage.util import writemsg
 
 try:
@@ -171,6 +171,8 @@ class EbuildPhase(CompositeTask):
 	def _start_ebuild(self):
 
 		if self.phase == "unpack":
+			alist = self.settings.configdict["pkg"].get("A", "").split()
+			_prepare_fake_distdir(self.settings, alist)
 			_prepare_fake_filesdir(self.settings)
 
 		fd_pipes = self.fd_pipes


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-02-19 19:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-02-19 19:20 UTC (permalink / raw
  To: gentoo-commits

commit:     7a6099f046a0c1f7d45751daf13c1e68253878aa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 18 21:19:39 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 19 19:18:24 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a6099f0

emerge --search: use slash to auto-detect category (bug 647940)

Since search strings containing a slash do no work unless category
match mode is enabled, use slash to auto-detect category match mode,
so that users do not have to prefix the search string with the special
@ symbol.

Bug: https://bugs.gentoo.org/647940
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>
Reviewed-by: M. J. Everitt <m.j.everitt <AT> iee.org>

 pym/_emerge/search.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pym/_emerge/search.py b/pym/_emerge/search.py
index 36897fb15..eb52b2ca3 100644
--- a/pym/_emerge/search.py
+++ b/pym/_emerge/search.py
@@ -256,6 +256,10 @@ class search(object):
 		if self.searchkey.startswith('@'):
 			match_category = 1
 			self.searchkey = self.searchkey[1:]
+		# Auto-detect category match mode (@ symbol can be deprecated
+		# after this is available in a stable version of portage).
+		if '/' in self.searchkey:
+			match_category = 1
 		fuzzy = False
 		if regexsearch:
 			self.searchre=re.compile(self.searchkey,re.I)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-03-21 19:05 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-03-21 19:05 UTC (permalink / raw
  To: gentoo-commits

commit:     c3b98e6b66364a08d1dadd3df7d84ad5f133fb1c
Author:     hugbubby <hugbubby <AT> protonmail <DOT> com>
AuthorDate: Wed Mar 21 18:55:56 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 21 19:04:15 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c3b98e6b

_solve_..slot_conflicts: Remove double-check of unexplored stack.

Closes: https://github.com/gentoo/portage/pull/272

 pym/_emerge/depgraph.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5c863103e..431784f1f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1539,9 +1539,11 @@ class depgraph(object):
 		explored_nodes = set()
 
 		while unexplored:
-			# Handle all unexplored packages.
-			while unexplored:
-				node = unexplored.pop()
+			while True:
+				try:
+				    node = unexplored.pop()
+				except IndexError:
+					break
 				for child in conflict_graph.child_nodes(node):
 					# Don't explore a node more than once, in order
 					# to avoid infinite recursion. The forced set


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-03-21 19:08 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-03-21 19:08 UTC (permalink / raw
  To: gentoo-commits

commit:     25880176a9706f9714b5be12c68facc432d6f04b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 21 19:07:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 21 19:08:01 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=25880176

_solve_..slot_conflicts: fix whitespace in previous commit

Fixes: c3b98e6b6636 (_solve_..slot_conflicts: Remove double-check of unexplored stack.)

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 431784f1f..47c8a87e8 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1541,7 +1541,7 @@ class depgraph(object):
 		while unexplored:
 			while True:
 				try:
-				    node = unexplored.pop()
+					node = unexplored.pop()
 				except IndexError:
 					break
 				for child in conflict_graph.child_nodes(node):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-03-21 19:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-03-21 19:25 UTC (permalink / raw
  To: gentoo-commits

commit:     9de7c259ed4f75abbd09cfdbdfa183cec36c1286
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 21 19:25:07 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 21 19:25:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9de7c259

_solve_..slot_conflicts: fix KeyError: 'pop from an empty set'

Fixes: c3b98e6b6636 (_solve_..slot_conflicts: Remove double-check of unexplored stack.)

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 47c8a87e8..6c728684f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1542,7 +1542,7 @@ class depgraph(object):
 			while True:
 				try:
 					node = unexplored.pop()
-				except IndexError:
+				except KeyError:
 					break
 				for child in conflict_graph.child_nodes(node):
 					# Don't explore a node more than once, in order


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-03-28  9:25 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-03-28  9:25 UTC (permalink / raw
  To: gentoo-commits

commit:     99edcc9df73315a8effc60cf210f958f7a118886
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 28 09:23:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 28 09:23:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=99edcc9d

PackagePhase: fix PKG_INSTALL_MASK prefix support

Fixes: 3416876c0ee7 ("{,PKG_}INSTALL_MASK: python implementation")

 pym/_emerge/PackagePhase.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/PackagePhase.py b/pym/_emerge/PackagePhase.py
index 859f254be..107e2ca36 100644
--- a/pym/_emerge/PackagePhase.py
+++ b/pym/_emerge/PackagePhase.py
@@ -55,7 +55,9 @@ class PackagePhase(CompositeTask):
 		else:
 			self._start_task(AsyncFunction(
 				target=install_mask_dir,
-				args=(self._proot, self._pkg_install_mask)),
+				args=(os.path.join(self._proot,
+					self.settings['EPREFIX'].lstrip(os.sep)),
+					self._pkg_install_mask)),
 				self._pkg_install_mask_exit)
 
 	def _pkg_install_mask_exit(self, proc):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-03-28 15:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-03-28 15:24 UTC (permalink / raw
  To: gentoo-commits

commit:     839b0d3a58332538c7ea92b6cc4b538332f2deb4
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 28 13:22:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 28 15:23:58 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=839b0d3a

emerge: Add PORTAGE_BINHOST to emerge --info

Closes: https://github.com/gentoo/portage/pull/285

 pym/_emerge/actions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 1d4e66def..347ef5fbc 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1816,7 +1816,7 @@ def action_info(settings, trees, myopts, myfiles):
 	else:
 		myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
 		          'DISTDIR', 'ENV_UNSET', 'PKGDIR', 'PORTAGE_TMPDIR',
-		          'PORTAGE_BUNZIP2_COMMAND',
+		          'PORTAGE_BINHOST', 'PORTAGE_BUNZIP2_COMMAND',
 		          'PORTAGE_BZIP2_COMMAND',
 		          'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
 		          'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'FEATURES',


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-03-30  3:50 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-03-30  3:50 UTC (permalink / raw
  To: gentoo-commits

commit:     c5ad40dbe8f74dcdb2b08d42240e217a8ef440e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 03:35:24 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 03:47:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5ad40db

depgraph._serialize_tasks: resolve portage/repoman blockers (bug 651936)

When ensuring that all runtime dependencies are installed before
a new instance of portage, ignore uninstalls. This makes it possible
to solve a blocker between a new version of portage and an older
version of repoman, where an uninstall task for the older version
of repoman appears in the runtime dependencies of the new instance
of portage.

Bug: https://bugs.gentoo.org/651936

 pym/_emerge/depgraph.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 6af7d5714..963bf25f4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -7671,11 +7671,13 @@ class depgraph(object):
 				return True
 			if node not in mergeable_nodes:
 				return False
-			if node == replacement_portage and \
-				mygraph.child_nodes(node,
-				ignore_priority=priority_range.ignore_medium_soft):
-				# Make sure that portage always has all of it's
-				# RDEPENDs installed first.
+			if node == replacement_portage and any(
+				getattr(rdep, 'operation', None) != 'uninstall'
+				for rdep in mygraph.child_nodes(node,
+				ignore_priority=priority_range.ignore_medium_soft)):
+				# Make sure that portage always has all of its
+				# RDEPENDs installed first, but ignore uninstalls
+				# (these occur when new portage blocks older repoman).
 				return False
 			selected_nodes.add(node)
 			for child in mygraph.child_nodes(node,


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-20 15:45 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-20 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     2f1816dd7a8ba68a857ea9081431f0a5ab90ee4c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 19 02:50:57 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 19 07:33:30 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2f1816dd

EbuildPhase._ebuild_exit: use async_unlock (bug 614108)

Use async_unlock to avoid event loop recursion, and AsyncTaskFuture
to fit the resulting future into the CompositeTask framework that
EbuildPhase uses.

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/EbuildPhase.py | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 3174cac1a..890b17870 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -1,6 +1,7 @@
 # Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import functools
 import gzip
 import io
 import sys
@@ -15,6 +16,7 @@ from _emerge.PackagePhase import PackagePhase
 from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir,
 		_prepare_fake_distdir, _prepare_fake_filesdir)
 from portage.util import writemsg
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 
 try:
 	from portage.xml.metadata import MetaDataXML
@@ -197,13 +199,23 @@ class EbuildPhase(CompositeTask):
 		self._start_task(ebuild_process, self._ebuild_exit)
 
 	def _ebuild_exit(self, ebuild_process):
-
-		if self._ebuild_lock is not None:
-			self._ebuild_lock.unlock()
-			self._ebuild_lock = None
+		self._assert_current(ebuild_process)
+		if self._ebuild_lock is None:
+			self._ebuild_exit_unlocked(ebuild_process)
+		else:
+			self._start_task(
+				AsyncTaskFuture(future=self._ebuild_lock.async_unlock()),
+				functools.partial(self._ebuild_exit_unlocked, ebuild_process))
+
+	def _ebuild_exit_unlocked(self, ebuild_process, unlock_task=None):
+		if unlock_task is not None:
+			self._assert_current(unlock_task)
+			# Normally, async_unlock should not raise an exception here.
+			unlock_task.future.result()
 
 		fail = False
-		if self._default_exit(ebuild_process) != os.EX_OK:
+		if ebuild_process.returncode != os.EX_OK:
+			self.returncode = ebuild_process.returncode
 			if self.phase == "test" and \
 				"test-fail-continue" in self.settings.features:
 				# mark test phase as complete (bug #452030)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-20 16:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-20 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     0783351b0cb69fc33b984b1fe51e6c642c3bab7d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 19 16:12:00 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 20 15:49:41 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0783351b

EbuildBuildDir: add async_unlock method (bug 614108)

Call the existing AsynchronousLock async_unlock method
for the build directory lock, and also handle removal of the
category directory (with async lock/unlock).

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/EbuildBuildDir.py | 46 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/pym/_emerge/EbuildBuildDir.py b/pym/_emerge/EbuildBuildDir.py
index 58905c2f6..1f1385a3b 100644
--- a/pym/_emerge/EbuildBuildDir.py
+++ b/pym/_emerge/EbuildBuildDir.py
@@ -88,6 +88,9 @@ class EbuildBuildDir(SlotObject):
 		if self._lock_obj is None:
 			return
 
+		# Keep this legacy implementation until all consumers have migrated
+		# to async_unlock, since run_until_complete(self.async_unlock())
+		# would add unwanted event loop recursion here.
 		self._lock_obj.unlock()
 		self._lock_obj = None
 		self.locked = False
@@ -102,6 +105,49 @@ class EbuildBuildDir(SlotObject):
 			finally:
 				catdir_lock.unlock()
 
+	def async_unlock(self):
+		"""
+		Release the lock asynchronously. Release notification is available
+		via the add_done_callback method of the returned Future instance.
+
+		@returns: Future, result is None
+		"""
+		result = self.scheduler.create_future()
+
+		def builddir_unlocked(future):
+			if future.exception() is not None:
+				result.set_exception(future.exception())
+			else:
+				self._lock_obj = None
+				self.locked = False
+				self.settings.pop('PORTAGE_BUILDDIR_LOCKED', None)
+				catdir_lock = AsynchronousLock(
+					path=self._catdir, scheduler=self.scheduler)
+				catdir_lock.addExitListener(catdir_locked)
+				catdir_lock.start()
+
+		def catdir_locked(catdir_lock):
+			if catdir_lock.wait() != os.EX_OK:
+				result.set_result(None)
+			else:
+				try:
+					os.rmdir(self._catdir)
+				except OSError:
+					pass
+				catdir_lock.async_unlock().add_done_callback(catdir_unlocked)
+
+		def catdir_unlocked(future):
+			if future.exception() is None:
+				result.set_result(None)
+			else:
+				result.set_exception(future.exception())
+
+		if self._lock_obj is None:
+			self.scheduler.call_soon(result.set_result, None)
+		else:
+			self._lock_obj.async_unlock().add_done_callback(builddir_unlocked)
+		return result
+
 	class AlreadyLocked(portage.exception.PortageException):
 		pass
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-20 16:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-20 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     87c079175c7a504ae893ed7d6ced03638d4cc853
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 20 05:39:31 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 20 15:50:42 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=87c07917

AbstractEbuildProcess: use async_unlock (bug 614108)

Override the _async_wait method to asynchronously unlock
self._build_dir when necessary, override the _wait method in order
to function as a failsafe if _async_wait has not been called for
some reason, and fix the SubProcess superclass to call _async_wait
when appropriate.

Execution of the _wait method's failsafe code will automatically
become a fatal error at the same time as event loop recursion is
disabled.

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/AbstractEbuildProcess.py | 65 +++++++++++++++++++++++++++++++++---
 pym/_emerge/SubProcess.py            |  2 +-
 2 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 8bd30a640..2aa0c4a35 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -2,6 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
+import functools
 import io
 import platform
 import stat
@@ -23,7 +24,8 @@ from portage.util import apply_secpass_permissions
 class AbstractEbuildProcess(SpawnProcess):
 
 	__slots__ = ('phase', 'settings',) + \
-		('_build_dir', '_ipc_daemon', '_exit_command', '_exit_timeout_id')
+		('_build_dir', '_build_dir_unlock', '_ipc_daemon',
+		'_exit_command', '_exit_timeout_id')
 
 	_phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',)
 	_phases_interactive_whitelist = ('config',)
@@ -247,7 +249,7 @@ class AbstractEbuildProcess(SpawnProcess):
 
 	def _cancel_timeout_cb(self):
 		self._exit_timeout_id = None
-		self.wait()
+		self._async_wait()
 		return False # only run once
 
 	def _orphan_process_warn(self):
@@ -354,9 +356,7 @@ class AbstractEbuildProcess(SpawnProcess):
 					self.returncode = 1
 					if not self.cancelled:
 						self._unexpected_exit()
-			if self._build_dir is not None:
-				self._build_dir.unlock()
-				self._build_dir = None
+
 		elif not self.cancelled:
 			exit_file = self.settings.get('PORTAGE_EBUILD_EXIT_FILE')
 			if exit_file and not os.path.exists(exit_file):
@@ -367,3 +367,58 @@ class AbstractEbuildProcess(SpawnProcess):
 					self.returncode = 1
 					if not self.cancelled:
 						self._unexpected_exit()
+
+	def _wait(self):
+		"""
+		Override _wait to unlock self._build_dir if necessary. Normally, it
+		should already be unlocked, so this functions only as a failsafe.
+		Execution of the failsafe code will automatically become a fatal
+		error at the same time as event loop recursion is disabled.
+		"""
+		SpawnProcess._wait(self)
+
+		if self._build_dir is not None:
+			self._build_dir_unlock = self._build_dir.async_unlock()
+			# Unlock only once.
+			self._build_dir = None
+
+		if not (self._build_dir_unlock is None or
+			self._build_dir_unlock.done()):
+			# This will automatically become a fatal error at the same
+			# time as event loop recursion is disabled.
+			self.scheduler.run_until_complete(self._build_dir_unlock)
+
+		return self.returncode
+
+	def _async_wait(self):
+		"""
+		Override _async_wait to asynchronously unlock self._build_dir
+		when necessary.
+		"""
+		if self._build_dir is None:
+			SpawnProcess._async_wait(self)
+		elif self._build_dir_unlock is None:
+			self._async_unlock_builddir(returncode=self.returncode)
+
+	def _async_unlock_builddir(self, returncode=None):
+		"""
+		Release the lock asynchronously, and if a returncode parameter
+		is given then set self.returncode and notify exit listeners.
+		"""
+		if self._build_dir_unlock is not None:
+			raise AssertionError('unlock already in progress')
+		if returncode is not None:
+			# The returncode will be set after unlock is complete.
+			self.returncode = None
+		self._build_dir_unlock = self._build_dir.async_unlock()
+		# Unlock only once.
+		self._build_dir = None
+		self._build_dir_unlock.add_done_callback(
+			functools.partial(self._unlock_builddir_exit, returncode=returncode))
+
+	def _unlock_builddir_exit(self, unlock_future, returncode=None):
+		# Normally, async_unlock should not raise an exception here.
+		unlock_future.result()
+		if returncode is not None:
+			self.returncode = returncode
+			SpawnProcess._async_wait(self)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index b81cfd5f6..141181d9f 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -116,7 +116,7 @@ class SubProcess(AbstractPollTask):
 		if pid != self.pid:
 			raise AssertionError("expected pid %s, got %s" % (self.pid, pid))
 		self._set_returncode((pid, condition))
-		self.wait()
+		self._async_wait()
 
 	def _waitpid_loop(self):
 		source_id = self.scheduler.child_watch_add(


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-20 16:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-20 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     7f7174748266197aa3112f7c6c93a255d1d18ed0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 20 04:49:25 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 20 15:50:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7f717474

PackageUninstall: use async_unlock (bug 614108)

Add an _async_unlock_builddir method which accepts a
returncode parameter for cases where it should set the
returncode and notify exit listeners.

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/PackageUninstall.py | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index 16c2f749b..8f19e38e4 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -1,11 +1,13 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import functools
 import logging
 import portage
 from portage import os
 from portage.dbapi._MergeProcess import MergeProcess
 from portage.exception import UnsupportedAPIException
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 from _emerge.EbuildBuildDir import EbuildBuildDir
 from _emerge.emergelog import emergelog
 from _emerge.CompositeTask import CompositeTask
@@ -65,9 +67,7 @@ class PackageUninstall(CompositeTask):
 			writemsg_level=self._writemsg_level)
 
 		if retval != os.EX_OK:
-			self._builddir_lock.unlock()
-			self.returncode = retval
-			self._async_wait()
+			self._async_unlock_builddir(returncode=retval)
 			return
 
 		self._writemsg_level(">>> Unmerging %s...\n" % (self.pkg.cpv,),
@@ -90,8 +90,27 @@ class PackageUninstall(CompositeTask):
 		else:
 			self._emergelog(" >>> unmerge success: %s" % (self.pkg.cpv,))
 			self.world_atom(self.pkg)
-		self._builddir_lock.unlock()
-		self.wait()
+		self._async_unlock_builddir(returncode=self.returncode)
+
+	def _async_unlock_builddir(self, returncode=None):
+		"""
+		Release the lock asynchronously, and if a returncode parameter
+		is given then set self.returncode and notify exit listeners.
+		"""
+		if returncode is not None:
+			# The returncode will be set after unlock is complete.
+			self.returncode = None
+		self._start_task(
+			AsyncTaskFuture(future=self._builddir_lock.async_unlock()),
+			functools.partial(self._unlock_builddir_exit, returncode=returncode))
+
+	def _unlock_builddir_exit(self, unlock_task, returncode=None):
+		self._assert_current(unlock_task)
+		# Normally, async_unlock should not raise an exception here.
+		unlock_task.future.result()
+		if returncode is not None:
+			self.returncode = returncode
+			self._async_wait()
 
 	def _emergelog(self, msg):
 		emergelog("notitles" not in self.settings.features, msg)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-20 16:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-20 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     720fef408d07e6aeb4ca81f39c38df3085367795
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 20 05:21:19 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 20 15:50:33 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=720fef40

Binpkg: use async_unlock (bug 614108)

Add an _async_unlock_builddir method which accepts a
returncode parameter for cases where it should set the
returncode and notify exit listeners.

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/Binpkg.py | 50 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 33 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 1c10c6b69..09a1fe680 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -1,6 +1,8 @@
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import functools
+
 import _emerge.emergelog
 from _emerge.EbuildPhase import EbuildPhase
 from _emerge.BinpkgFetcher import BinpkgFetcher
@@ -13,6 +15,7 @@ from _emerge.EbuildBuildDir import EbuildBuildDir
 from _emerge.SpawnProcess import SpawnProcess
 from portage.eapi import eapi_exports_replace_vars
 from portage.util import ensure_dirs
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 import portage
 from portage import os
 from portage import shutil
@@ -146,8 +149,7 @@ class Binpkg(CompositeTask):
 		if fetcher.returncode is not None:
 			self._fetched_pkg = fetcher.pkg_path
 			if self._default_exit(fetcher) != os.EX_OK:
-				self._unlock_builddir()
-				self.wait()
+				self._async_unlock_builddir(returncode=self.returncode)
 				return
 
 		if self.opts.pretend:
@@ -175,8 +177,7 @@ class Binpkg(CompositeTask):
 	def _verifier_exit(self, verifier):
 		if verifier is not None and \
 			self._default_exit(verifier) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		logger = self.logger
@@ -227,8 +228,7 @@ class Binpkg(CompositeTask):
 
 	def _clean_exit(self, clean_phase):
 		if self._default_exit(clean_phase) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		dir_path = self.settings['PORTAGE_BUILDDIR']
@@ -290,8 +290,7 @@ class Binpkg(CompositeTask):
 
 	def _env_extractor_exit(self, env_extractor):
 		if self._default_exit(env_extractor) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		setup_phase = EbuildPhase(background=self.background,
@@ -304,8 +303,7 @@ class Binpkg(CompositeTask):
 
 	def _setup_exit(self, setup_phase):
 		if self._default_exit(setup_phase) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		extractor = BinpkgExtractorAsync(background=self.background,
@@ -320,10 +318,9 @@ class Binpkg(CompositeTask):
 
 	def _extractor_exit(self, extractor):
 		if self._default_exit(extractor) != os.EX_OK:
-			self._unlock_builddir()
 			self._writemsg_level("!!! Error Extracting '%s'\n" % \
 				self._pkg_path, noiselevel=-1, level=logging.ERROR)
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		try:
@@ -355,11 +352,10 @@ class Binpkg(CompositeTask):
 
 	def _chpathtool_exit(self, chpathtool):
 		if self._final_exit(chpathtool) != os.EX_OK:
-			self._unlock_builddir()
 			self._writemsg_level("!!! Error Adjusting Prefix to %s\n" %
 				(self.settings["EPREFIX"],),
 				noiselevel=-1, level=logging.ERROR)
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		# We want to install in "our" prefix, not the binary one
@@ -385,11 +381,31 @@ class Binpkg(CompositeTask):
 
 		self.wait()
 
-	def _unlock_builddir(self):
+	def _async_unlock_builddir(self, returncode=None):
+		"""
+		Release the lock asynchronously, and if a returncode parameter
+		is given then set self.returncode and notify exit listeners.
+		"""
 		if self.opts.pretend or self.opts.fetchonly:
+			if returncode is not None:
+				self.returncode = returncode
+				self._async_wait()
 			return
+		if returncode is not None:
+			# The returncode will be set after unlock is complete.
+			self.returncode = None
 		portage.elog.elog_process(self.pkg.cpv, self.settings)
-		self._build_dir.unlock()
+		self._start_task(
+			AsyncTaskFuture(future=self._build_dir.async_unlock()),
+			functools.partial(self._unlock_builddir_exit, returncode=returncode))
+
+	def _unlock_builddir_exit(self, unlock_task, returncode=None):
+		self._assert_current(unlock_task)
+		# Normally, async_unlock should not raise an exception here.
+		unlock_task.future.result()
+		if returncode is not None:
+			self.returncode = returncode
+			self._async_wait()
 
 	def create_install_task(self):
 		task = EbuildMerge(exit_hook=self._install_exit,
@@ -403,7 +419,6 @@ class Binpkg(CompositeTask):
 
 	def _install_exit(self, task):
 		self.settings.pop("PORTAGE_BINPKG_FILE", None)
-		self._unlock_builddir()
 		if task.returncode == os.EX_OK and \
 			'binpkg-logs' not in self.settings.features and \
 			self.settings.get("PORTAGE_LOG_FILE"):
@@ -411,3 +426,4 @@ class Binpkg(CompositeTask):
 				os.unlink(self.settings["PORTAGE_LOG_FILE"])
 			except OSError:
 				pass
+		self._async_unlock_builddir()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-20 16:18 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-20 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     5ca8ef781952d8148c21a1f5369c6d04335a9208
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 19 16:18:36 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 20 15:49:59 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ca8ef78

EbuildBuild: use async_unlock (bug 614108)

Add an _async_unlock_builddir method which accepts a
returncode parameter for cases where it should set the
returncode and notify exit listeners.

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/EbuildBuild.py | 52 ++++++++++++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 20 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 48f470483..f1a2103a3 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -3,6 +3,7 @@
 
 from __future__ import unicode_literals
 
+import functools
 import io
 
 import _emerge.emergelog
@@ -23,6 +24,8 @@ from portage import _encodings, _unicode_decode, _unicode_encode, os
 from portage.package.ebuild.digestcheck import digestcheck
 from portage.package.ebuild.doebuild import _check_temp_dir
 from portage.package.ebuild._spawn_nofetch import SpawnNofetchWithoutBuilddir
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
+
 
 class EbuildBuild(CompositeTask):
 
@@ -185,8 +188,7 @@ class EbuildBuild(CompositeTask):
 
 	def _pre_clean_exit(self, pre_clean_phase):
 		if self._default_exit(pre_clean_phase) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		# for log handling
@@ -209,10 +211,7 @@ class EbuildBuild(CompositeTask):
 			msg_lines.append(msg)
 			fetcher._eerror(msg_lines)
 			portage.elog.elog_process(self.pkg.cpv, self.settings)
-			self.returncode = 1
-			self._current_task = None
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=1)
 			return
 
 		if already_fetched:
@@ -283,8 +282,7 @@ class EbuildBuild(CompositeTask):
 
 		if 'fetch' not in self.pkg.restrict and \
 			'nofetch' not in self.pkg.defined_phases:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		self.returncode = None
@@ -294,18 +292,32 @@ class EbuildBuild(CompositeTask):
 
 	def _nofetch_exit(self, nofetch_phase):
 		self._final_exit(nofetch_phase)
-		self._unlock_builddir()
-		self.returncode = 1
-		self.wait()
+		self._async_unlock_builddir(returncode=1)
 
-	def _unlock_builddir(self):
+	def _async_unlock_builddir(self, returncode=None):
+		"""
+		Release the lock asynchronously, and if a returncode parameter
+		is given then set self.returncode and notify exit listeners.
+		"""
+		if returncode is not None:
+			# The returncode will be set after unlock is complete.
+			self.returncode = None
 		portage.elog.elog_process(self.pkg.cpv, self.settings)
-		self._build_dir.unlock()
+		self._start_task(
+			AsyncTaskFuture(future=self._build_dir.async_unlock()),
+			functools.partial(self._unlock_builddir_exit, returncode=returncode))
+
+	def _unlock_builddir_exit(self, unlock_task, returncode=None):
+		self._assert_current(unlock_task)
+		# Normally, async_unlock should not raise an exception here.
+		unlock_task.future.result()
+		if returncode is not None:
+			self.returncode = returncode
+			self._async_wait()
 
 	def _build_exit(self, build):
 		if self._default_exit(build) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		buildpkg = self._buildpkg
@@ -370,8 +382,7 @@ class EbuildBuild(CompositeTask):
 		"""
 
 		if self._default_exit(packager) != os.EX_OK:
-			self._unlock_builddir()
-			self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
 			return
 
 		if self.opts.buildpkgonly:
@@ -425,8 +436,9 @@ class EbuildBuild(CompositeTask):
 	def _clean_exit(self, clean_phase):
 		if self._final_exit(clean_phase) != os.EX_OK or \
 			self.opts.buildpkgonly:
-			self._unlock_builddir()
-		self.wait()
+			self._async_unlock_builddir(returncode=self.returncode)
+		else:
+			self.wait()
 
 	def create_install_task(self):
 		"""
@@ -461,4 +473,4 @@ class EbuildBuild(CompositeTask):
 		return task
 
 	def _install_exit(self, task):
-		self._unlock_builddir()
+		self._async_unlock_builddir()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-21 18:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-21 18:43 UTC (permalink / raw
  To: gentoo-commits

commit:     87a21a06c8829be6ded41a4c06dcfc19f8ffefc2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 17:32:49 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 21 18:41:58 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=87a21a06

BinpkgFetcher: use async_unlock (bug 614108)

Convert BinpkgFetcher to a CompositeTask in order to handle asynchronous
unlock, and move remaining BinpkgFetcher code to a _BinpkgFetcherProcess
class that still inherits SpawnProcess.

Bug: https://bugs.gentoo.org/614108

 pym/_emerge/BinpkgFetcher.py | 57 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 44 insertions(+), 13 deletions(-)

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index c8fd64487..5ca7a45cf 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -1,7 +1,10 @@
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import functools
+
 from _emerge.AsynchronousLock import AsynchronousLock
+from _emerge.CompositeTask import CompositeTask
 from _emerge.SpawnProcess import SpawnProcess
 try:
 	from urllib.parse import urlparse as urllib_parse_urlparse
@@ -11,24 +14,56 @@ import stat
 import sys
 import portage
 from portage import os
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 from portage.util._pty import _create_pty_or_pipe
 
 if sys.hexversion >= 0x3000000:
 	long = int
 
-class BinpkgFetcher(SpawnProcess):
 
-	__slots__ = ("pkg", "pretend",
-		"locked", "pkg_path", "_lock_obj")
+class BinpkgFetcher(CompositeTask):
+
+	__slots__ = ("pkg", "pretend", "logfile", "pkg_path")
 
 	def __init__(self, **kwargs):
-		SpawnProcess.__init__(self, **kwargs)
+		CompositeTask.__init__(self, **kwargs)
 		pkg = self.pkg
 		self.pkg_path = pkg.root_config.trees["bintree"].getname(
 			pkg.cpv) + ".partial"
 
 	def _start(self):
+		self._start_task(
+			_BinpkgFetcherProcess(background=self.background,
+				logfile=self.logfile, pkg=self.pkg, pkg_path=self.pkg_path,
+				pretend=self.pretend, scheduler=self.scheduler),
+			self._fetcher_exit)
+
+	def _fetcher_exit(self, fetcher):
+		self._assert_current(fetcher)
+		if not self.pretend and fetcher.returncode == os.EX_OK:
+			fetcher.sync_timestamp()
+		if fetcher.locked:
+			self._start_task(
+				AsyncTaskFuture(future=fetcher.async_unlock()),
+				functools.partial(self._fetcher_exit_unlocked, fetcher))
+		else:
+			self._fetcher_exit_unlocked(fetcher)
+
+	def _fetcher_exit_unlocked(self, fetcher, unlock_task=None):
+		if unlock_task is not None:
+			self._assert_current(unlock_task)
+			unlock_task.future.result()
+
+		self._current_task = None
+		self.returncode = fetcher.returncode
+		self._async_wait()
+
 
+class _BinpkgFetcherProcess(SpawnProcess):
+
+	__slots__ = ("pkg", "pretend", "locked", "pkg_path", "_lock_obj")
+
+	def _start(self):
 		pkg = self.pkg
 		pretend = self.pretend
 		bintree = pkg.root_config.trees["bintree"]
@@ -123,9 +158,7 @@ class BinpkgFetcher(SpawnProcess):
 			_create_pty_or_pipe(copy_term_size=stdout_pipe)
 		return (master_fd, slave_fd)
 
-	def _set_returncode(self, wait_retval):
-		SpawnProcess._set_returncode(self, wait_retval)
-		if not self.pretend and self.returncode == os.EX_OK:
+	def sync_timestamp(self):
 			# If possible, update the mtime to match the remote package if
 			# the fetcher didn't already do it automatically.
 			bintree = self.pkg.root_config.trees["bintree"]
@@ -151,9 +184,6 @@ class BinpkgFetcher(SpawnProcess):
 								except OSError:
 									pass
 
-		if self.locked:
-			self.unlock()
-
 	def lock(self):
 		"""
 		This raises an AlreadyLocked exception if lock() is called
@@ -179,10 +209,11 @@ class BinpkgFetcher(SpawnProcess):
 	class AlreadyLocked(portage.exception.PortageException):
 		pass
 
-	def unlock(self):
+	def async_unlock(self):
 		if self._lock_obj is None:
-			return
-		self._lock_obj.unlock()
+			raise AssertionError('already unlocked')
+		result = self._lock_obj.async_unlock()
 		self._lock_obj = None
 		self.locked = False
+		return result
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-21 20:17 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-21 20:17 UTC (permalink / raw
  To: gentoo-commits

commit:     3031af210e44af825096a7601fa368851428e661
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 20:13:53 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 21 20:16:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3031af21

CompositeTask._wait: recurse less (bug 591760)

In order to reduce the amount of recursion, use a future to
wait for task exit.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/CompositeTask.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index 40cf8596b..f3acc9696 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -82,7 +82,12 @@ class CompositeTask(AsynchronousTask):
 				# a different task or None. Something is wrong.
 				raise AssertionError("self._current_task has not " + \
 					"changed since calling wait", self, task)
-			task.wait()
+
+			# This triggers less recursion than calling task.wait().
+			waiter = self.scheduler.create_future()
+			task.addExitListener(waiter.set_result)
+			while not waiter.done():
+				self.scheduler.iteration()
 			prev = task
 
 		return self.returncode


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22  0:56 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22  0:56 UTC (permalink / raw
  To: gentoo-commits

commit:     adf2e6dd57b5bcaa4a668e3085024ebc3224a2ca
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 19:18:08 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 00:50:57 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=adf2e6dd

BinpkgFetcher: use async lock (bug 614110)

In order to avoid event loop recursion, convert the
_BinpkgFetcherProcess.lock() method to an async_lock
method for use by BinpkgFetcher.

Bug: https://bugs.gentoo.org/614110
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/BinpkgFetcher.py | 53 +++++++++++++++++++++++++++-----------------
 1 file changed, 33 insertions(+), 20 deletions(-)

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 5ca7a45cf..2bbc0a26f 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -32,11 +32,24 @@ class BinpkgFetcher(CompositeTask):
 			pkg.cpv) + ".partial"
 
 	def _start(self):
-		self._start_task(
-			_BinpkgFetcherProcess(background=self.background,
-				logfile=self.logfile, pkg=self.pkg, pkg_path=self.pkg_path,
-				pretend=self.pretend, scheduler=self.scheduler),
-			self._fetcher_exit)
+		fetcher = _BinpkgFetcherProcess(background=self.background,
+			logfile=self.logfile, pkg=self.pkg, pkg_path=self.pkg_path,
+			pretend=self.pretend, scheduler=self.scheduler)
+
+		if not self.pretend:
+			portage.util.ensure_dirs(os.path.dirname(self.pkg_path))
+			if "distlocks" in self.pkg.root_config.settings.features:
+				self._start_task(
+					AsyncTaskFuture(future=fetcher.async_lock()),
+					functools.partial(self._start_locked, fetcher))
+				return
+
+		self._start_task(fetcher, self._fetcher_exit)
+
+	def _start_locked(self, fetcher, lock_task):
+		self._assert_current(lock_task)
+		lock_task.future.result()
+		self._start_task(fetcher, self._fetcher_exit)
 
 	def _fetcher_exit(self, fetcher):
 		self._assert_current(fetcher)
@@ -68,13 +81,8 @@ class _BinpkgFetcherProcess(SpawnProcess):
 		pretend = self.pretend
 		bintree = pkg.root_config.trees["bintree"]
 		settings = bintree.settings
-		use_locks = "distlocks" in settings.features
 		pkg_path = self.pkg_path
 
-		if not pretend:
-			portage.util.ensure_dirs(os.path.dirname(pkg_path))
-			if use_locks:
-				self.lock()
 		exists = os.path.exists(pkg_path)
 		resume = exists and os.path.basename(pkg_path) in bintree.invalids
 		if not (pretend or resume):
@@ -184,7 +192,7 @@ class _BinpkgFetcherProcess(SpawnProcess):
 								except OSError:
 									pass
 
-	def lock(self):
+	def async_lock(self):
 		"""
 		This raises an AlreadyLocked exception if lock() is called
 		while a lock is already held. In order to avoid this, call
@@ -194,17 +202,22 @@ class _BinpkgFetcherProcess(SpawnProcess):
 		if self._lock_obj is not None:
 			raise self.AlreadyLocked((self._lock_obj,))
 
-		async_lock = AsynchronousLock(path=self.pkg_path,
-			scheduler=self.scheduler)
-		async_lock.start()
+		result = self.scheduler.create_future()
 
-		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,))
+		def acquired_lock(async_lock):
+			if async_lock.wait() == os.EX_OK:
+				self.locked = True
+				result.set_result(None)
+			else:
+				result.set_exception(AssertionError(
+					"AsynchronousLock failed with returncode %s"
+					% (async_lock.returncode,)))
 
-		self._lock_obj = async_lock
-		self.locked = True
+		self._lock_obj = AsynchronousLock(path=self.pkg_path,
+			scheduler=self.scheduler)
+		self._lock_obj.addExitListener(acquired_lock)
+		self._lock_obj.start()
+		return result
 
 	class AlreadyLocked(portage.exception.PortageException):
 		pass


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22 18:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     c5ab0696cec1f0f020d2d8ad416f9b1444a467de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 18:16:55 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:16:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5ab0696

SubProcess: fix _unregister_if_appropriate event loop recursion (bug 614104)

Override the AbstractPollTask._unregister_if_appropriate method to avoid
event loop recursion when the pid exit status is not yet available, by
calling self._async_waitpid() instead of self.wait(). Also make
_async_waitpid fallback to _async_wait if the pid exit status happens to
be available already.

Bug: https://bugs.gentoo.org/614104

 pym/_emerge/SubProcess.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index 141181d9f..f684c5a22 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -108,7 +108,9 @@ class SubProcess(AbstractPollTask):
 		prefered over _waitpid_loop, since the synchronous nature
 		of _waitpid_loop can cause event loop recursion.
 		"""
-		if self._waitpid_id is None:
+		if self.returncode is not None:
+			self._async_wait()
+		elif self._waitpid_id is None:
 			self._waitpid_id = self.scheduler.child_watch_add(
 				self.pid, self._async_waitpid_cb)
 
@@ -158,6 +160,22 @@ class SubProcess(AbstractPollTask):
 					f.close()
 			self._files = None
 
+	def _unregister_if_appropriate(self, event):
+		"""
+		Override the AbstractPollTask._unregister_if_appropriate method to
+		call _async_waitpid instead of wait(), so that event loop recursion
+		is not triggered when the pid exit status is not yet available.
+		"""
+		if self._registered:
+			if event & self._exceptional_events:
+				self._log_poll_exception(event)
+				self._unregister()
+				self.cancel()
+				self._async_waitpid()
+			elif event & self.scheduler.IO_HUP:
+				self._unregister()
+				self._async_waitpid()
+
 	def _set_returncode(self, wait_retval):
 		"""
 		Set the returncode in a manner compatible with


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     ee5305f26a0bdc6054307289c2487c241735bcbb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 07:32:45 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:30:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ee5305f2

Binpkg: use async_lock (bug 614112)

Asynchronously lock the build directory, and use AsyncTaskFuture
to fit the resulting future into the CompositeTask framework that
Binpkg uses.

Bug: https://bugs.gentoo.org/614112

 pym/_emerge/Binpkg.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 09a1fe680..e9c5ef568 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -112,15 +112,25 @@ class Binpkg(CompositeTask):
 			self.wait()
 			return
 
-		pkg = self.pkg
-		pkg_count = self.pkg_count
 		if not (self.opts.pretend or self.opts.fetchonly):
-			self._build_dir.lock()
+			self._start_task(
+				AsyncTaskFuture(future=self._build_dir.async_lock()),
+				self._start_fetcher)
+		else:
+			self._start_fetcher()
+
+	def _start_fetcher(self, lock_task=None):
+		if lock_task is not None:
+			self._assert_current(lock_task)
+			lock_task.future.result()
 			# Initialize PORTAGE_LOG_FILE (clean_log won't work without it).
 			portage.prepare_build_dirs(self.settings["ROOT"], self.settings, 1)
 			# If necessary, discard old log so that we don't
 			# append to it.
 			self._build_dir.clean_log()
+
+		pkg = self.pkg
+		pkg_count = self.pkg_count
 		fetcher = BinpkgFetcher(background=self.background,
 			logfile=self.settings.get("PORTAGE_LOG_FILE"), pkg=self.pkg,
 			pretend=self.opts.pretend, scheduler=self.scheduler)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     30c69adfc0ffa450ff3a4d4d176023db66171ae7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 06:36:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:30:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=30c69adf

AbstractEbuildProcess: use async_lock (bug 614112)

Asynchronously lock the build directory. The asynchronous lock delays
creation of the pid, and it's possible for the _wait method to be called
before the pid is available. Therefore, AbstractEbuildProcess._wait()
must wait for the pid to become available before it can call the
SpawnProcess._wait() method.

Bug: https://bugs.gentoo.org/614112

 pym/_emerge/AbstractEbuildProcess.py | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 2aa0c4a35..d481e6046 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -25,7 +25,7 @@ class AbstractEbuildProcess(SpawnProcess):
 
 	__slots__ = ('phase', 'settings',) + \
 		('_build_dir', '_build_dir_unlock', '_ipc_daemon',
-		'_exit_command', '_exit_timeout_id')
+		'_exit_command', '_exit_timeout_id', '_start_future')
 
 	_phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',)
 	_phases_interactive_whitelist = ('config',)
@@ -130,15 +130,19 @@ class AbstractEbuildProcess(SpawnProcess):
 			# since we're not displaying to a terminal anyway.
 			self.settings['NOCOLOR'] = 'true'
 
+		start_ipc_daemon = False
 		if self._enable_ipc_daemon:
 			self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None)
 			if self.phase not in self._phases_without_builddir:
+				start_ipc_daemon = True
 				if 'PORTAGE_BUILDDIR_LOCKED' not in self.settings:
 					self._build_dir = EbuildBuildDir(
 						scheduler=self.scheduler, settings=self.settings)
-					self._build_dir.lock()
-				self.settings['PORTAGE_IPC_DAEMON'] = "1"
-				self._start_ipc_daemon()
+					self._start_future = self._build_dir.async_lock()
+					self._start_future.add_done_callback(
+						functools.partial(self._start_post_builddir_lock,
+						start_ipc_daemon=start_ipc_daemon))
+					return
 			else:
 				self.settings.pop('PORTAGE_IPC_DAEMON', None)
 		else:
@@ -159,6 +163,19 @@ class AbstractEbuildProcess(SpawnProcess):
 			else:
 				self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None)
 
+		self._start_post_builddir_lock(start_ipc_daemon=start_ipc_daemon)
+
+	def _start_post_builddir_lock(self, lock_future=None, start_ipc_daemon=False):
+		if lock_future is not None:
+			if lock_future is not self._start_future:
+				raise AssertionError('lock_future is not self._start_future')
+			self._start_future = None
+			lock_future.result()
+
+		if start_ipc_daemon:
+			self.settings['PORTAGE_IPC_DAEMON'] = "1"
+			self._start_ipc_daemon()
+
 		if self.fd_pipes is None:
 			self.fd_pipes = {}
 		null_fd = None
@@ -375,6 +392,11 @@ class AbstractEbuildProcess(SpawnProcess):
 		Execution of the failsafe code will automatically become a fatal
 		error at the same time as event loop recursion is disabled.
 		"""
+		# SpawnProcess._wait() requires the pid, so wait here for the
+		# pid to become available.
+		while self._start_future is not None:
+			self.scheduler.run_until_complete(self._start_future)
+
 		SpawnProcess._wait(self)
 
 		if self._build_dir is not None:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     c59348dc275b433d61735f8053e0db1a2ef6432b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 07:59:00 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:30:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c59348dc

PackageUninstall: use async_lock (bug 614112)

Asynchronously lock the build directory, and use AsyncTaskFuture
to fit the resulting future into the CompositeTask framework that
PackageUninstall uses.

Bug: https://bugs.gentoo.org/614112

 pym/_emerge/PackageUninstall.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index 8f19e38e4..3fe1fb0a6 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -55,8 +55,13 @@ class PackageUninstall(CompositeTask):
 
 		self._builddir_lock = EbuildBuildDir(
 			scheduler=self.scheduler, settings=self.settings)
-		self._builddir_lock.lock()
+		self._start_task(
+			AsyncTaskFuture(future=self._builddir_lock.async_lock()),
+			self._start_unmerge)
 
+	def _start_unmerge(self, lock_task):
+		self._assert_current(lock_task)
+		lock_task.future.result()
 		portage.prepare_build_dirs(
 			settings=self.settings, cleanup=True)
 
@@ -74,6 +79,7 @@ class PackageUninstall(CompositeTask):
 			noiselevel=-1)
 		self._emergelog("=== Unmerging... (%s)" % (self.pkg.cpv,))
 
+		cat, pf = portage.catsplit(self.pkg.cpv)
 		unmerge_task = MergeProcess(
 			mycat=cat, mypkg=pf, settings=self.settings,
 			treetype="vartree", vartree=self.pkg.root_config.trees["vartree"],


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     9d7b43779d17ca9f698bb90e0ac7b1f43afa9575
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 06:05:34 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:30:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9d7b4377

EbuildBuildDir: add async_lock method (bug 614112)

Asynchronoulsy handle locking of both the category directory and
build directory.

Bug: https://bugs.gentoo.org/614112

 pym/_emerge/EbuildBuildDir.py | 76 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/pym/_emerge/EbuildBuildDir.py b/pym/_emerge/EbuildBuildDir.py
index 69f694992..9163deacf 100644
--- a/pym/_emerge/EbuildBuildDir.py
+++ b/pym/_emerge/EbuildBuildDir.py
@@ -1,6 +1,8 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import functools
+
 from _emerge.AsynchronousLock import AsynchronousLock
 
 import portage
@@ -84,6 +86,80 @@ class EbuildBuildDir(SlotObject):
 			except OSError:
 				pass
 
+	def async_lock(self):
+		"""
+		Acquire the lock asynchronously. Notification is available
+		via the add_done_callback method of the returned Future instance.
+
+		This raises an AlreadyLocked exception if async_lock() is called
+		while a lock is already held. In order to avoid this, call
+		async_unlock() or check whether the "locked" attribute is True
+		or False before calling async_lock().
+
+		@returns: Future, result is None
+		"""
+		if self._lock_obj is not None:
+			raise self.AlreadyLocked((self._lock_obj,))
+
+		dir_path = self.settings.get('PORTAGE_BUILDDIR')
+		if not dir_path:
+			raise AssertionError('PORTAGE_BUILDDIR is unset')
+		catdir = os.path.dirname(dir_path)
+		self._catdir = catdir
+		catdir_lock = AsynchronousLock(path=catdir, scheduler=self.scheduler)
+		builddir_lock = AsynchronousLock(path=dir_path, scheduler=self.scheduler)
+		result = self.scheduler.create_future()
+
+		def catdir_locked(catdir_lock):
+			try:
+				self._assert_lock(catdir_lock)
+			except AssertionError as e:
+				result.set_exception(e)
+				return
+
+			try:
+				portage.util.ensure_dirs(catdir,
+					gid=portage.portage_gid,
+					mode=0o70, mask=0)
+			except PortageException as e:
+				if not os.path.isdir(catdir):
+					result.set_exception(e)
+					return
+
+			builddir_lock.addExitListener(builddir_locked)
+			builddir_lock.start()
+
+		def builddir_locked(builddir_lock):
+			try:
+				self._assert_lock(builddir_lock)
+			except AssertionError as e:
+				catdir_lock.async_unlock.add_done_callback(
+					functools.partial(catdir_unlocked, exception=e))
+				return
+
+			self._lock_obj = builddir_lock
+			self.locked = True
+			self.settings['PORTAGE_BUILDDIR_LOCKED'] = '1'
+			catdir_lock.async_unlock().add_done_callback(catdir_unlocked)
+
+		def catdir_unlocked(future, exception=None):
+			if not (exception is None and future.exception() is None):
+				result.set_exception(exception or future.exception())
+			else:
+				result.set_result(None)
+
+		try:
+			portage.util.ensure_dirs(os.path.dirname(catdir),
+				gid=portage.portage_gid,
+				mode=0o70, mask=0)
+		except PortageException:
+			if not os.path.isdir(os.path.dirname(catdir)):
+				raise
+
+		catdir_lock.addExitListener(catdir_locked)
+		catdir_lock.start()
+		return result
+
 	def async_unlock(self):
 		"""
 		Release the lock asynchronously. Release notification is available


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-22 21:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-22 21:52 UTC (permalink / raw
  To: gentoo-commits

commit:     0dfa50e1d85aea0d63497fb823139541bc989e2e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 07:49:00 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:30:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0dfa50e1

EbuildBuild: use async_lock (bug 614112)

Asynchronously lock the build directory, and use AsyncTaskFuture
to fit the resulting future into the CompositeTask framework that
EbuildBuild uses.

Bug: https://bugs.gentoo.org/614112

 pym/_emerge/EbuildBuild.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index f1a2103a3..9d4afd0ea 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -150,8 +150,13 @@ class EbuildBuild(CompositeTask):
 
 		self._build_dir = EbuildBuildDir(
 			scheduler=self.scheduler, settings=settings)
-		self._build_dir.lock()
+		self._start_task(
+			AsyncTaskFuture(future=self._build_dir.async_lock()),
+			self._start_pre_clean)
 
+	def _start_pre_clean(self, lock_task):
+		self._assert_current(lock_task)
+		lock_task.future.result()
 		# Cleaning needs to happen before fetch, since the build dir
 		# is used for log handling.
 		msg = " === (%s of %s) Cleaning (%s::%s)" % \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23  2:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23  2:41 UTC (permalink / raw
  To: gentoo-commits

commit:     bb2484afc217058267b5ba5d2d792bc1c46203b7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 02:27:53 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 02:38:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bb2484af

Scheduler: fix create_world_atom event loop recursion (bug 653848)

Generate world atoms while the event loop is not running, since
otherwise portdbapi match calls in the create_world_atom function
could trigger event loop recursion.

Bug: https://bugs.gentoo.org/653848

 pym/_emerge/Scheduler.py         | 19 ++++++++++++++-----
 pym/_emerge/create_world_atom.py |  6 ++++--
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 71fe3e07d..6778708bb 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -448,6 +448,7 @@ class Scheduler(PollScheduler):
 			self._pkg_cache = {}
 			self._digraph = None
 			self._mergelist = []
+			self._world_atoms = None
 			self._deep_system_deps.clear()
 			return
 
@@ -456,6 +457,18 @@ class Scheduler(PollScheduler):
 		self._digraph = graph_config.graph
 		self._mergelist = graph_config.mergelist
 
+		# Generate world atoms while the event loop is not running,
+		# since otherwise portdbapi match calls in the create_world_atom
+		# function could trigger event loop recursion.
+		self._world_atoms = {}
+		for pkg in self._mergelist:
+			if getattr(pkg, 'operation', None) != 'merge':
+				continue
+			atom = create_world_atom(pkg, self._args_set,
+				pkg.root_config, before_install=True)
+			if atom is not None:
+				self._world_atoms[pkg] = atom
+
 		if "--nodeps" in self.myopts or \
 			(self._max_jobs is not True and self._max_jobs < 2):
 			# save some memory
@@ -1939,11 +1952,7 @@ class Scheduler(PollScheduler):
 		atom = None
 
 		if pkg.operation != "uninstall":
-			# Do this before acquiring the lock, since it queries the
-			# portdbapi which can call the global event loop, triggering
-			# a concurrent call to this method or something else that
-			# needs an exclusive (non-reentrant) lock on the world file.
-			atom = create_world_atom(pkg, args_set, root_config)
+			atom = self._world_atoms.get(pkg)
 
 		try:
 

diff --git a/pym/_emerge/create_world_atom.py b/pym/_emerge/create_world_atom.py
index 74b0fa5d7..947f8088a 100644
--- a/pym/_emerge/create_world_atom.py
+++ b/pym/_emerge/create_world_atom.py
@@ -11,7 +11,7 @@ if sys.hexversion >= 0x3000000:
 else:
 	_unicode = unicode
 
-def create_world_atom(pkg, args_set, root_config):
+def create_world_atom(pkg, args_set, root_config, before_install=False):
 	"""Create a new atom for the world file if one does not exist.  If the
 	argument atom is precise enough to identify a specific slot then a slot
 	atom will be returned. Atoms that are in the system set may also be stored
@@ -83,11 +83,13 @@ def create_world_atom(pkg, args_set, root_config):
 		# If there is no installed package matching the SLOT atom,
 		# it probably changed SLOT spontaneously due to USE=multislot,
 		# so just record an unslotted atom.
-		if vardb.match(slot_atom):
+		if vardb.match(slot_atom) or before_install:
 			# Now verify that the argument is precise
 			# enough to identify a specific slot.
 			matches = mydb.match(arg_atom)
 			matched_slots = set()
+			if before_install:
+				matched_slots.add(pkg.slot)
 			if mydb is vardb:
 				for cpv in matches:
 					matched_slots.add(mydb._pkg_str(cpv, None).slot)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 18:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     e512275c2997a2069049bbb5acdb40e155cf19c7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 21:47:00 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 18:39:42 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e512275c

EbuildFetcher: use _async_uri_map in _start (bug 653810)

Use _async_uri_map to avoid event loop recursion in _start.

Bug: https://bugs.gentoo.org/653810
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/EbuildFetcher.py | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 1f574740b..8f6cc60fe 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -13,6 +13,7 @@ from portage import _unicode_decode
 from portage.checksum import _hash_filter
 from portage.elog.messages import eerror
 from portage.package.ebuild.fetch import _check_distfile, fetch
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 from portage.util._async.ForkProcess import ForkProcess
 from portage.util._pty import _create_pty_or_pipe
 from _emerge.CompositeTask import CompositeTask
@@ -40,6 +41,25 @@ class EbuildFetcher(CompositeTask):
 		return self._fetcher_proc.already_fetched(settings)
 
 	def _start(self):
+		self._start_task(
+			AsyncTaskFuture(future=self._fetcher_proc._async_uri_map()),
+			self._start_fetch)
+
+	def _start_fetch(self, uri_map_task):
+		self._assert_current(uri_map_task)
+		try:
+			uri_map = uri_map_task.future.result()
+		except portage.exception.InvalidDependString as e:
+			msg_lines = []
+			msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \
+				(self.pkg.cpv, e)
+			msg_lines.append(msg)
+			self._fetcher_proc._eerror(msg_lines)
+			self._current_task = None
+			self.returncode = 1
+			self._async_wait()
+			return
+
 		self._start_task(self._fetcher_proc, self._default_final_exit)
 
 
@@ -123,18 +143,8 @@ class _EbuildFetcherProcess(ForkProcess):
 		root_config = self.pkg.root_config
 		portdb = root_config.trees["porttree"].dbapi
 		ebuild_path = self._get_ebuild_path()
-
-		try:
-			uri_map = self.scheduler.run_until_complete(self._async_uri_map())
-		except portage.exception.InvalidDependString as e:
-			msg_lines = []
-			msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \
-				(self.pkg.cpv, e)
-			msg_lines.append(msg)
-			self._eerror(msg_lines)
-			self._set_returncode((self.pid, 1 << 8))
-			self._async_wait()
-			return
+		# This is initialized by an earlier _async_uri_map call.
+		uri_map = self._uri_map
 
 		if not uri_map:
 			# Nothing to fetch.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 18:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     0a5692bd4f4ab4a54daf2ce09112617cbc21c9ad
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 22:22:20 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 18:39:47 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0a5692bd

EbuildFetcher: add async_already_fetched method (bug 653810)

Add an async_already_fetched method to replace the synchronous
already_fetched method, and use it to prevent event loop recursion.

Bug: https://bugs.gentoo.org/653810
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/EbuildBuild.py   |  8 +++++++-
 pym/_emerge/EbuildFetcher.py | 30 ++++++++++++++++++++++++------
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 8ad8bcae9..9651bd419 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -216,8 +216,14 @@ class EbuildBuild(CompositeTask):
 			logfile=self.settings.get('PORTAGE_LOG_FILE'),
 			pkg=self.pkg, scheduler=self.scheduler)
 
+		self._start_task(AsyncTaskFuture(
+			future=fetcher.async_already_fetched(self.settings)),
+			functools.partial(self._start_fetch, fetcher))
+
+	def _start_fetch(self, fetcher, already_fetched_task):
+		self._assert_current(already_fetched_task)
 		try:
-			already_fetched = fetcher.already_fetched(self.settings)
+			already_fetched = already_fetched_task.future.result()
 		except portage.exception.InvalidDependString as e:
 			msg_lines = []
 			msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 8f6cc60fe..589eda85d 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -28,7 +28,7 @@ class EbuildFetcher(CompositeTask):
 		CompositeTask.__init__(self, **kwargs)
 		self._fetcher_proc = _EbuildFetcherProcess(**kwargs)
 
-	def already_fetched(self, settings):
+	def async_already_fetched(self, settings):
 		"""
 		Returns True if all files already exist locally and have correct
 		digests, otherwise return False. When returning True, appropriate
@@ -38,7 +38,7 @@ class EbuildFetcher(CompositeTask):
 		such messages. This will raise InvalidDependString if SRC_URI is
 		invalid.
 		"""
-		return self._fetcher_proc.already_fetched(settings)
+		return self._fetcher_proc.async_already_fetched(settings)
 
 	def _start(self):
 		self._start_task(
@@ -68,11 +68,29 @@ class _EbuildFetcherProcess(ForkProcess):
 	__slots__ = ("config_pool", "ebuild_path", "fetchonly", "fetchall",
 		"pkg", "prefetch", "_digests", "_manifest", "_settings", "_uri_map")
 
-	def already_fetched(self, settings):
-		uri_map = self.scheduler.run_until_complete(self._async_uri_map())
-		if not uri_map:
-			return True
+	def async_already_fetched(self, settings):
+		result = self.scheduler.create_future()
+
+		def uri_map_done(uri_map_future):
+			if uri_map_future.exception() is not None or result.cancelled():
+				if not result.cancelled():
+					result.set_exception(uri_map_future.exception())
+				return
+
+			uri_map = uri_map_future.result()
+			if uri_map:
+				result.set_result(
+					self._check_already_fetched(settings, uri_map))
+			else:
+				result.set_result(True)
+
+		uri_map_future = self._async_uri_map()
+		result.add_done_callback(lambda result:
+			aux_get_future.cancel() if result.cancelled() else None)
+		uri_map_future.add_done_callback(uri_map_done)
+		return result
 
+	def _check_already_fetched(self, settings, uri_map):
 		digests = self._get_digests()
 		distdir = settings["DISTDIR"]
 		allow_missing = self._get_manifest().allow_missing


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 18:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     a0e96e92ae040052f9f11e1731e221346886aa3b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 20:20:45 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 18:39:31 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0e96e92

EbuildFetcher: inherit CompositeTask (bug 653810)

Make EbuildFetcher inherit CompositeTask, and move remaining code
to a _EbuildFetcherProcess class that still inherits ForkProcess.
The CompositeTask framework will be used to split EbuildFetcher
into subtasks, in order to prevent event loop recursion.

Bug: https://bugs.gentoo.org/653810
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/EbuildFetcher.py | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index d98d00736..81eeb6dcd 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -15,12 +15,17 @@ from portage.elog.messages import eerror
 from portage.package.ebuild.fetch import _check_distfile, fetch
 from portage.util._async.ForkProcess import ForkProcess
 from portage.util._pty import _create_pty_or_pipe
+from _emerge.CompositeTask import CompositeTask
 
-class EbuildFetcher(ForkProcess):
+
+class EbuildFetcher(CompositeTask):
 
 	__slots__ = ("config_pool", "ebuild_path", "fetchonly", "fetchall",
-		"pkg", "prefetch") + \
-		("_digests", "_manifest", "_settings", "_uri_map")
+		"logfile", "pkg", "prefetch", "_fetcher_proc")
+
+	def __init__(self, **kwargs):
+		CompositeTask.__init__(self, **kwargs)
+		self._fetcher_proc = _EbuildFetcherProcess(**kwargs)
 
 	def already_fetched(self, settings):
 		"""
@@ -32,7 +37,18 @@ class EbuildFetcher(ForkProcess):
 		such messages. This will raise InvalidDependString if SRC_URI is
 		invalid.
 		"""
+		return self._fetcher_proc.already_fetched(settings)
+
+	def _start(self):
+		self._start_task(self._fetcher_proc, self._default_final_exit)
+
 
+class _EbuildFetcherProcess(ForkProcess):
+
+	__slots__ = ("config_pool", "ebuild_path", "fetchonly", "fetchall",
+		"pkg", "prefetch", "_digests", "_manifest", "_settings", "_uri_map")
+
+	def already_fetched(self, settings):
 		uri_map = self._get_uri_map()
 		if not uri_map:
 			return True


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 18:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     9596fc68bf13b5e8f44b522d2b2e9c303615462f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 21:18:53 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 18:39:37 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9596fc68

EbuildFetcher: add _async_uri_map method (bug 653810)

Add an _async_uri_map method to replace the synchronous _get_uri_map
method. This will be used to prevent event loop recursion.

Bug: https://bugs.gentoo.org/653810
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/EbuildFetcher.py | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 81eeb6dcd..1f574740b 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -49,7 +49,7 @@ class _EbuildFetcherProcess(ForkProcess):
 		"pkg", "prefetch", "_digests", "_manifest", "_settings", "_uri_map")
 
 	def already_fetched(self, settings):
-		uri_map = self._get_uri_map()
+		uri_map = self.scheduler.run_until_complete(self._async_uri_map())
 		if not uri_map:
 			return True
 
@@ -125,7 +125,7 @@ class _EbuildFetcherProcess(ForkProcess):
 		ebuild_path = self._get_ebuild_path()
 
 		try:
-			uri_map = self._get_uri_map()
+			uri_map = self.scheduler.run_until_complete(self._async_uri_map())
 		except portage.exception.InvalidDependString as e:
 			msg_lines = []
 			msg = "Fetch failed for '%s' due to invalid SRC_URI: %s" % \
@@ -210,21 +210,34 @@ class _EbuildFetcherProcess(ForkProcess):
 			self._digests = self._get_manifest().getTypeDigests("DIST")
 		return self._digests
 
-	def _get_uri_map(self):
+	def _async_uri_map(self):
 		"""
-		This can raise InvalidDependString from portdbapi.getFetchMap().
+		This calls the portdbapi.async_fetch_map method and returns the
+		resulting Future (may contain InvalidDependString exception).
 		"""
 		if self._uri_map is not None:
-			return self._uri_map
+			result = self.scheduler.create_future()
+			result.set_result(self._uri_map)
+			return result
+
 		pkgdir = os.path.dirname(self._get_ebuild_path())
 		mytree = os.path.dirname(os.path.dirname(pkgdir))
 		use = None
 		if not self.fetchall:
 			use = self.pkg.use.enabled
 		portdb = self.pkg.root_config.trees["porttree"].dbapi
-		self._uri_map = portdb.getFetchMap(self.pkg.cpv,
+
+		def cache_result(result):
+			try:
+				self._uri_map = result.result()
+			except Exception:
+				# The caller handles this when it retrieves the result.
+				pass
+
+		result = portdb.async_fetch_map(self.pkg.cpv,
 			useflags=use, mytree=mytree)
-		return self._uri_map
+		result.add_done_callback(cache_result)
+		return result
 
 	def _prefetch_size_ok(self, uri_map, settings, ebuild_path):
 		distdir = settings["DISTDIR"]


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 18:58 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     07233a526d1cc0937436fe0ad4de0a46553f5ff0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 18:57:02 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 18:57:02 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=07233a52

EbuildFetcher: fix broken aux_get_future reference in cancel callback

Fixes: 0a5692bd4f4a ("EbuildFetcher: add async_already_fetched method (bug 653810)")

 pym/_emerge/EbuildFetcher.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 589eda85d..f59b5cffa 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -86,7 +86,7 @@ class _EbuildFetcherProcess(ForkProcess):
 
 		uri_map_future = self._async_uri_map()
 		result.add_done_callback(lambda result:
-			aux_get_future.cancel() if result.cancelled() else None)
+			uri_map_future.cancel() if result.cancelled() else None)
 		uri_map_future.add_done_callback(uri_map_done)
 		return result
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 19:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     7e3bbd0f70f86d84964cd2507d85aae5d7a7a422
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 19:44:25 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 19:44:25 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7e3bbd0f

_EbuildFetcherProcess: pass loop parameter to async_fetch_map

Fixes: 9596fc68bf13 ("EbuildFetcher: add _async_uri_map method (bug 653810)")

 pym/_emerge/EbuildFetcher.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index f59b5cffa..466beac06 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -263,7 +263,7 @@ class _EbuildFetcherProcess(ForkProcess):
 				pass
 
 		result = portdb.async_fetch_map(self.pkg.cpv,
-			useflags=use, mytree=mytree)
+			useflags=use, mytree=mytree, loop=self.scheduler)
 		result.add_done_callback(cache_result)
 		return result
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-23 19:48 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-23 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     b58ba964c79f8ec7e450b871059306bbc433a7ca
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 19:46:45 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 19:46:45 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b58ba964

EbuildBuild: pass loop parameter to async_fetch_map

Fixes: db4dca876cdb ("EbuildBuild._start(): fix event loop recursion (bug 653844)")

 pym/_emerge/EbuildBuild.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 9651bd419..e5b96691a 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -48,7 +48,8 @@ class EbuildBuild(CompositeTask):
 		self._start_task(
 			AsyncTaskFuture(
 				future=self.pkg.root_config.trees["porttree"].dbapi.\
-				async_aux_get(self.pkg.cpv, ["SRC_URI"], myrepo=self.pkg.repo)),
+				async_aux_get(self.pkg.cpv, ["SRC_URI"], myrepo=self.pkg.repo,
+				loop=self.scheduler)),
 			self._start_with_metadata)
 
 	def _start_with_metadata(self, aux_get_task):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-24  6:57 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-24  6:57 UTC (permalink / raw
  To: gentoo-commits

commit:     7f1a362fea4ca0bf4cd0476ceb3a61afb8ef1a7e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 24 06:40:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 06:56:18 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7f1a362f

EbuildMetadataPhase._output_handler: fix event loop recursion (bug 591760)

When pid exit status is not yet available, use the Subprocess
_async_waitpid() method to avoid event loop recursion.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/EbuildMetadataPhase.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index bbb1ca9dc..1ee967532 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -144,8 +144,11 @@ class EbuildMetadataPhase(SubProcess):
 					break
 				else:
 					if not self._raw_metadata[-1]:
-						self._unregister()
-						self.wait()
+						if self.pid is None:
+							self._unregister()
+							self._async_wait()
+						else:
+							self.self._async_waitpid()
 						break
 
 		self._unregister_if_appropriate(event)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-24  7:42 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-24  7:42 UTC (permalink / raw
  To: gentoo-commits

commit:     292f81f17ada179f1edf367cd9faddc299b3bf15
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 24 07:42:11 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 07:42:11 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=292f81f1

EbuildMetadataPhase: fix self.self reference

Fixes: 7f1a362fea4c ("EbuildMetadataPhase._output_handler: fix event loop recursion (bug 591760)")

 pym/_emerge/EbuildMetadataPhase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 1ee967532..d146424c3 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -148,7 +148,7 @@ class EbuildMetadataPhase(SubProcess):
 							self._unregister()
 							self._async_wait()
 						else:
-							self.self._async_waitpid()
+							self._async_waitpid()
 						break
 
 		self._unregister_if_appropriate(event)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-24 19:43 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-24 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     78bb69447833895b588bbed42f02b364d3ebbfcc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 20 22:11:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 24 19:42:27 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=78bb6944

emerge --config: return pkg_config exit status (bug 653638)

Fix emerge --config exit status so that it will return 1 if
the pkg_config function calls die.

Bug: https://bugs.gentoo.org/653638
Reviewed-by: Manuel Rüger <mrueg <AT> gentoo.org>

 pym/_emerge/actions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index b90aa8cb0..1a289f523 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -617,6 +617,7 @@ def action_config(settings, trees, myopts, myfiles):
 		portage.doebuild(ebuildpath, "clean", settings=mysettings,
 			debug=debug, mydbapi=vardb, tree="vartree")
 	print()
+	return retval
 
 def action_depclean(settings, trees, ldpath_mtimes,
 	myopts, action, myfiles, spinner, scheduler=None):
@@ -3203,7 +3204,7 @@ def run_action(emerge_config):
 	# HELP action
 	elif "config" == emerge_config.action:
 		validate_ebuild_environment(emerge_config.trees)
-		action_config(emerge_config.target_config.settings,
+		return action_config(emerge_config.target_config.settings,
 			emerge_config.trees, emerge_config.opts, emerge_config.args)
 
 	# SEARCH action


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-26  6:20 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-26  6:20 UTC (permalink / raw
  To: gentoo-commits

commit:     f7b1b61f682f3d635aaded630d8e61f1756c8023
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 26 06:12:19 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 06:13:57 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f7b1b61f

PipeReader._output_handler: use _async_wait() (bug 591760)

Use _async_wait() to avoid event loop recursion.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/PipeReader.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index a8392c329..b8e61834c 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import fcntl
@@ -77,7 +77,8 @@ class PipeReader(AbstractPollTask):
 				self._read_data.append(data)
 			else:
 				self._unregister()
-				self.wait()
+				self.returncode = self.returncode or os.EX_OK
+				self._async_wait()
 				break
 
 		self._unregister_if_appropriate(event)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-26  7:12 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-26  7:12 UTC (permalink / raw
  To: gentoo-commits

commit:     94a37752ab21883065ed7150b902dfda2b45a5b3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 26 07:00:18 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 07:08:54 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=94a37752

AsynchronousLock: use _async_wait() (bug 591760)

Use _async_wait() to avoid event loop recursion.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/AsynchronousLock.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 0178feab2..820d047b2 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import fcntl
@@ -70,7 +70,8 @@ class AsynchronousLock(AsynchronousTask):
 
 	def _imp_exit(self, imp):
 		# call exit listeners
-		self.wait()
+		self.returncode = imp.returncode
+		self._async_wait()
 
 	def _cancel(self):
 		if isinstance(self._imp, AsynchronousTask):
@@ -251,7 +252,7 @@ class _LockProcess(AbstractPollTask):
 						level=logging.ERROR, noiselevel=-1)
 				self._unregister()
 				self.returncode = proc.returncode
-				self.wait()
+				self._async_wait()
 				return
 
 			if not self.cancelled and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-26  8:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-26  8:06 UTC (permalink / raw
  To: gentoo-commits

commit:     03a635e3a95fbe4afc6fb2fae2e56c03ef946933
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 26 07:40:05 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 08:01:05 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=03a635e3

AbstractPollTask._unregister_if_appropriate: use _async_wait() (bug 591760)

Use _async_wait() to avoid event loop recursion. This change
only affects PipeLogger, PipeReader, and FifoWriter, since other
subclasses inherit the Subprocess implementation that was fixed
in commit c5ab0696cec1f0f020d2d8ad416f9b1444a467de.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/AbstractPollTask.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index aa8fc6593..d2965cc31 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -128,10 +128,12 @@ class AbstractPollTask(AsynchronousTask):
 				self._log_poll_exception(event)
 				self._unregister()
 				self.cancel()
-				self.wait()
+				self.returncode = self.returncode or os.EX_OK
+				self._async_wait()
 			elif event & self.scheduler.IO_HUP:
 				self._unregister()
-				self.wait()
+				self.returncode = self.returncode or os.EX_OK
+				self._async_wait()
 
 	def _wait(self):
 		if self.returncode is not None:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-26  8:06 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-26  8:06 UTC (permalink / raw
  To: gentoo-commits

commit:     f1fbe2dcf51984d5fd06a14541335618537aa006
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 26 07:38:28 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 07:58:29 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f1fbe2dc

PipeReader._array_output_handler: use _async_wait() (bug 591760)

Use _async_wait() to avoid event loop recursion.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/PipeReader.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index b8e61834c..eabf9f40b 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -99,7 +99,8 @@ class PipeReader(AbstractPollTask):
 				self._read_data.append(data)
 			else:
 				self._unregister()
-				self.wait()
+				self.returncode = self.returncode or os.EX_OK
+				self._async_wait()
 				break
 
 		self._unregister_if_appropriate(event)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-26  8:46 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-26  8:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9b93296e14e2e7f52cd2bf4d626eb7387f6786ab
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 26 08:09:08 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 08:39:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b93296e

CompositeTask._cancel(): use _async_wait() (bug 591760)

After setting the returncode due to the current task being
queued, use _async_wait() for consistency with the case
where the current task needs to be cancelled, so that either
case ultimately results in notification of exit listeners.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/CompositeTask.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/_emerge/CompositeTask.py b/pym/_emerge/CompositeTask.py
index bfd4bacbd..113e5935f 100644
--- a/pym/_emerge/CompositeTask.py
+++ b/pym/_emerge/CompositeTask.py
@@ -18,6 +18,7 @@ class CompositeTask(AsynchronousTask):
 			if self._current_task is self._TASK_QUEUED:
 				self.returncode = 1
 				self._current_task = None
+				self._async_wait()
 			else:
 				self._current_task.cancel()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-27 20:56 Ulrich Müller
  0 siblings, 0 replies; 804+ messages in thread
From: Ulrich Müller @ 2018-04-27 20:56 UTC (permalink / raw
  To: gentoo-commits

commit:     0a919d906b52c9397a45f6800df2ba261d562088
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 27 20:55:19 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Apr 27 20:55:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0a919d90

Revert "pym/_emerge/main.py: Fix --moo output"

This reverts commit e03499b7466bc053bc31ced89e4a890f516be7a3.

Bug: https://bugs.gentoo.org/654224

 pym/_emerge/main.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 226387495..e1b949b92 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -82,7 +82,7 @@ COWSAY_MOO = r"""
  -----------------------
         \   ^__^
          \  (oo)\_______
-            (__)\       )\/\\
+            (__)\       )\/\
                 ||----w |
                 ||     ||
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-28 20:19 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-28 20:19 UTC (permalink / raw
  To: gentoo-commits

commit:     efc4905546f505f69d5b1355aaa0c80e665a6f4a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 28 20:18:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 28 20:18:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=efc49055

MetadataRegen: fix deprecated _wait usage (bug 653856)

Override PollScheduler._cleanup() instead of AsynchronousTask._wait(),
since AsynchronousTask._wait() is deprecated.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/MetadataRegen.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index d92b6a06e..8eb110a46 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import portage
@@ -77,18 +77,15 @@ class MetadataRegen(AsyncScheduler):
 						settings=portdb.doebuild_settings,
 						write_auxdb=self._write_auxdb)
 
-	def _wait(self):
-
-		AsyncScheduler._wait(self)
+	def _cleanup(self):
+		super(MetadataRegen, self)._cleanup()
 
 		portdb = self._portdb
 		dead_nodes = {}
 
-		self._termination_check()
-		if self._terminated_tasks:
+		if self._terminated.is_set():
 			portdb.flush_cache()
-			self.returncode = self._cancelled_returncode
-			return self.returncode
+			return
 
 		if self._global_cleanse:
 			for mytree in portdb.porttrees:
@@ -132,7 +129,6 @@ class MetadataRegen(AsyncScheduler):
 						pass
 
 		portdb.flush_cache()
-		return self.returncode
 
 	def _task_exit(self, metadata_process):
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-28 22:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-28 22:26 UTC (permalink / raw
  To: gentoo-commits

commit:     54256075a4b525e86d6837a3ecf6502eb484d3a0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 28 22:25:21 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 28 22:25:21 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=54256075

AsynchronousTask: fix deprecated _wait usage (bug 653856)

Make the default _start implementation call _async_wait() instead
of wait().

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AsynchronousTask.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 7d2e6253b..4e664d00e 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -12,7 +12,7 @@ class AsynchronousTask(SlotObject):
 	to public methods can be wrapped for implementing
 	hooks such as exit listener notification.
 
-	Sublasses should call self.wait() to notify exit listeners after
+	Sublasses should call self._async_wait() to notify exit listeners after
 	the task is complete and self.returncode has been set.
 	"""
 
@@ -51,7 +51,7 @@ class AsynchronousTask(SlotObject):
 
 	def _start(self):
 		self.returncode = os.EX_OK
-		self.wait()
+		self._async_wait()
 
 	def isAlive(self):
 		return self.returncode is None
@@ -81,6 +81,9 @@ class AsynchronousTask(SlotObject):
 		return self.returncode
 
 	def _wait(self):
+		"""
+		Deprecated. Use _async_wait() instead.
+		"""
 		return self.returncode
 
 	def _async_wait(self):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-28 23:41 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-28 23:41 UTC (permalink / raw
  To: gentoo-commits

commit:     01698b9f3f3145b3b902db9f4f5cb07f2f7c737f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 28 23:36:47 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 28 23:36:47 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=01698b9f

AsynchronousLock: fix deprecated _wait usage (bug 653856)

Use _async_wait() instead of wait().

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AsynchronousLock.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 820d047b2..5cdfd98f6 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -83,6 +83,9 @@ class AsynchronousLock(AsynchronousTask):
 		return self.returncode
 
 	def _wait(self):
+		"""
+		Deprecated. Use _async_wait() instead.
+		"""
 		if self.returncode is not None:
 			return self.returncode
 		self.returncode = self._imp.wait()
@@ -142,7 +145,7 @@ class _LockThread(AbstractPollTask):
 	def _run_lock_cb(self):
 		self._unregister()
 		self.returncode = os.EX_OK
-		self.wait()
+		self._async_wait()
 		return False
 
 	def _cancel(self):
@@ -287,7 +290,7 @@ class _LockProcess(AbstractPollTask):
 			self._acquired = True
 			self._unregister()
 			self.returncode = os.EX_OK
-			self.wait()
+			self._async_wait()
 
 		return True
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-28 23:52 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-28 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     a914433a17122776e79456d33c72ecfaee199715
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 28 23:51:03 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Apr 28 23:51:03 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a914433a

FifoIpcDaemon: fix deprecated _wait usage (bug 653856)

Use _async_wait() instead of wait().

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/FifoIpcDaemon.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index 7468de5e2..6efdc11b4 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -79,9 +79,12 @@ class FifoIpcDaemon(AbstractPollTask):
 			self.returncode = 1
 		self._unregister()
 		# notify exit listeners
-		self.wait()
+		self._async_wait()
 
 	def _wait(self):
+		"""
+		Deprecated. Use _async_wait() instead.
+		"""
 		if self.returncode is not None:
 			return self.returncode
 		self._wait_loop()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  0:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  0:26 UTC (permalink / raw
  To: gentoo-commits

commit:     5ca431566538965927a33565c222c8994ad288d5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 00:24:21 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 00:24:21 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ca43156

SubProcess._poll(): fix deprecated wait() usage (bug 653856)

Use _async_wait() instead of wait().

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/SubProcess.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index f684c5a22..13cf9d361 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -40,7 +40,7 @@ class SubProcess(AbstractPollTask):
 		if retval[0] == 0:
 			return None
 		self._set_returncode(retval)
-		self.wait()
+		self._async_wait()
 		return self.returncode
 
 	def _cancel(self):
@@ -62,7 +62,9 @@ class SubProcess(AbstractPollTask):
 			self.returncode is None
 
 	def _wait(self):
-
+		"""
+		Deprecated. Use _async_wait() instead.
+		"""
 		if self.returncode is not None:
 			return self.returncode
 
@@ -121,6 +123,9 @@ class SubProcess(AbstractPollTask):
 		self._async_wait()
 
 	def _waitpid_loop(self):
+		"""
+		Deprecated. Use _async_waitpid() instead.
+		"""
 		source_id = self.scheduler.child_watch_add(
 			self.pid, self._waitpid_cb)
 		try:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  0:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  0:49 UTC (permalink / raw
  To: gentoo-commits

commit:     3e235049eb36dd983b695ed50aca4e32d7d28950
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 00:48:41 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 00:48:41 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3e235049

AbstractEbuildProcess: use _async_waitpid after kill (bug 403697)

Use _async_waitpid() instead of _async_wait() in the _cancel_timeout_cb
method, since the pid exit status may not be available yet.

Bug: https://bugs.gentoo.org/403697

 pym/_emerge/AbstractEbuildProcess.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index d481e6046..1012ce166 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -266,7 +266,7 @@ class AbstractEbuildProcess(SpawnProcess):
 
 	def _cancel_timeout_cb(self):
 		self._exit_timeout_id = None
-		self._async_wait()
+		self._async_waitpid()
 		return False # only run once
 
 	def _orphan_process_warn(self):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  2:11 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  2:11 UTC (permalink / raw
  To: gentoo-commits

commit:     bcbf9ec87252658900f26aa957653a4db718152a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 02:02:08 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 02:04:24 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bcbf9ec8

AbstractPollTask._wait_loop: asyncio compat (bug 653856)

Use the asyncio shim for asyncio compatibility.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AbstractPollTask.py | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index d2965cc31..0aac97be5 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -7,6 +7,7 @@ import logging
 import os
 
 from portage.util import writemsg_level
+from portage.util.futures import asyncio
 from _emerge.AsynchronousTask import AsynchronousTask
 
 class AbstractPollTask(AsynchronousTask):
@@ -142,20 +143,15 @@ class AbstractPollTask(AsynchronousTask):
 		return self.returncode
 
 	def _wait_loop(self, timeout=None):
-
-		if timeout is None:
-			while self._registered:
-				self.scheduler.iteration()
-			return
-
-		def timeout_cb():
-			timeout_cb.timed_out = True
-			return False
-		timeout_cb.timed_out = False
-		timeout_cb.timeout_id = self.scheduler.timeout_add(timeout, timeout_cb)
-
+		loop = getattr(self.scheduler, '_asyncio_wrapper', self.scheduler)
+		tasks = [self.async_wait()]
+		if timeout is not None:
+			tasks.append(asyncio.ensure_future(
+				asyncio.sleep(timeout / 1000, loop=loop), loop=loop))
 		try:
-			while self._registered and not timeout_cb.timed_out:
-				self.scheduler.iteration()
+			loop.run_until_complete(asyncio.ensure_future(
+				asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED,
+				loop=loop), loop=loop))
 		finally:
-			self.scheduler.source_remove(timeout_cb.timeout_id)
+			for task in tasks:
+				task.cancel()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  3:47 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  3:47 UTC (permalink / raw
  To: gentoo-commits

commit:     88ce275deabd4b260be916572639de800591a288
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 03:39:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 03:39:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=88ce275d

Scheduler._main_loop: asyncio compat (bug 653856)

Use create_future, call_later, and run_until_complete for
asyncio compatibility.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/Scheduler.py | 44 +++++++++++++++++++++-----------------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 6778708bb..4c1ea5078 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -71,8 +71,8 @@ FAILURE = 1
 
 class Scheduler(PollScheduler):
 
-	# max time between loadavg checks (milliseconds)
-	_loadavg_latency = 30000
+	# max time between loadavg checks (seconds)
+	_loadavg_latency = 30
 
 	# max time between display status updates (milliseconds)
 	_max_display_latency = 3000
@@ -239,6 +239,8 @@ class Scheduler(PollScheduler):
 		self._jobs = 0
 		self._running_tasks = {}
 		self._completed_tasks = set()
+		self._main_exit = None
+		self._main_loadavg_handle = None
 
 		self._failed_pkgs = []
 		self._failed_pkgs_all = []
@@ -1373,34 +1375,18 @@ class Scheduler(PollScheduler):
 		blocker_db.discardBlocker(pkg)
 
 	def _main_loop(self):
-		loadavg_check_id = None
+		self._main_exit = self._event_loop.create_future()
+
 		if self._max_load is not None and \
 			self._loadavg_latency is not None and \
 			(self._max_jobs is True or self._max_jobs > 1):
 			# We have to schedule periodically, in case the load
 			# average has changed since the last call.
-			loadavg_check_id = self._event_loop.timeout_add(
+			self._main_loadavg_handle = self._event_loop.call_later(
 				self._loadavg_latency, self._schedule)
 
-		try:
-			# Populate initial event sources. Unless we're scheduling
-			# based on load average, we only need to do this once
-			# here, since it can be called during the loop from within
-			# event handlers.
-			self._schedule()
-
-			# Loop while there are jobs to be scheduled.
-			while self._keep_scheduling():
-				self._event_loop.iteration()
-
-			# Clean shutdown of previously scheduled jobs. In the
-			# case of termination, this allows for basic cleanup
-			# such as flushing of buffered output to logs.
-			while self._is_work_scheduled():
-				self._event_loop.iteration()
-		finally:
-			if loadavg_check_id is not None:
-				self._event_loop.source_remove(loadavg_check_id)
+		self._schedule()
+		self._event_loop.run_until_complete(self._main_exit)
 
 	def _merge(self):
 
@@ -1441,6 +1427,10 @@ class Scheduler(PollScheduler):
 		self._digraph = None
 		self._task_queues.fetch.clear()
 		self._prefetchers.clear()
+		self._main_exit = None
+		if self._main_loadavg_handle is not None:
+			self._main_loadavg_handle.cancel()
+			self._main_loadavg_handle = None
 
 	def _choose_pkg(self):
 		"""
@@ -1606,6 +1596,14 @@ class Scheduler(PollScheduler):
 				not self._task_queues.merge)):
 				break
 
+		if not (self._is_work_scheduled() or
+			self._keep_scheduling() or self._main_exit.done()):
+			self._main_exit.set_result(None)
+		elif self._main_loadavg_handle is not None:
+			self._main_loadavg_handle.cancel()
+			self._main_loadavg_handle = self._event_loop.call_later(
+				self._loadavg_latency, self._schedule)
+
 	def _sigcont_handler(self, signum, frame):
 		self._sigcont_time = time.time()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  3:55 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  3:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c984e65e743d049c715f66e96bacb4e830922a34
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 03:52:18 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 03:52:18 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c984e65e

AsynchronousTask._async_wait: asyncio compat (bug 653856)

Use call_soon for asyncio compatibility.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AsynchronousTask.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 4e664d00e..9d8df7f5e 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -94,11 +94,7 @@ class AsynchronousTask(SlotObject):
 		loop recursion (or stack overflow) that synchronous calling of
 		exit listeners can cause. This method is thread-safe.
 		"""
-		self.scheduler.idle_add(self._async_wait_cb)
-
-	def _async_wait_cb(self):
-		self.wait()
-		return False
+		self.scheduler.call_soon(self.wait)
 
 	def cancel(self):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  4:02 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  4:02 UTC (permalink / raw
  To: gentoo-commits

commit:     123aee71d3e15c2b8b2d354902d83a8f8596fbeb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 04:01:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 04:01:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=123aee71

_LockThread._run_lock: asyncio compat (bug 653856)

Use call_soon_threadsafe for asyncio compatibility.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AsynchronousLock.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 5cdfd98f6..2019adaab 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -140,13 +140,12 @@ class _LockThread(AbstractPollTask):
 	def _run_lock(self):
 		self._lock_obj = lockfile(self.path, wantnewlockfile=True)
 		# Thread-safe callback to EventLoop
-		self.scheduler.idle_add(self._run_lock_cb)
+		self.scheduler.call_soon_threadsafe(self._run_lock_cb)
 
 	def _run_lock_cb(self):
 		self._unregister()
 		self.returncode = os.EX_OK
 		self._async_wait()
-		return False
 
 	def _cancel(self):
 		# There's currently no way to force thread termination.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29  4:38 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29  4:38 UTC (permalink / raw
  To: gentoo-commits

commit:     bca4f6a58512471cdf1caf644cee9858ca3bd1eb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 26 09:51:43 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 04:21:56 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bca4f6a5

AsynchronousTask: disable event loop recursion (bug 653856)

Make the wait() and _async_wait() methods raise InvalidStateError
when the event loop is running and the returncode is not available,
since these cases would trigger event loop recursion. There are no
known remaining cases that cause event loop recursion via wait()
and _async_wait(), and this patch protects against changes that would
accidentally re-introduce event loop recursion.

Since the wait() method now raises InvalidStateError in cases where
it previously would have called the _wait() method, this patch makes
it possible to remove the _wait() method implementations from all
subclasses of AsynchronousTask. Subclasses that used the _wait()
method to perform cleanup now use the _async_wait() method instead.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AbstractEbuildProcess.py |  5 ++++-
 pym/_emerge/AsynchronousTask.py      | 24 ++++++++++++++----------
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 1012ce166..b10aa4bfa 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -18,6 +18,7 @@ from portage.localization import _
 from portage.package.ebuild._ipc.ExitCommand import ExitCommand
 from portage.package.ebuild._ipc.QueryCommand import QueryCommand
 from portage import shutil, os
+from portage.util.futures import asyncio
 from portage.util._pty import _create_pty_or_pipe
 from portage.util import apply_secpass_permissions
 
@@ -420,6 +421,8 @@ class AbstractEbuildProcess(SpawnProcess):
 		if self._build_dir is None:
 			SpawnProcess._async_wait(self)
 		elif self._build_dir_unlock is None:
+			if self.returncode is None:
+				raise asyncio.InvalidStateError('Result is not ready.')
 			self._async_unlock_builddir(returncode=self.returncode)
 
 	def _async_unlock_builddir(self, returncode=None):

diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 9d8df7f5e..246895d71 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -1,9 +1,10 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import signal
 
 from portage import os
+from portage.util.futures import asyncio
 from portage.util.SlotObject import SlotObject
 
 class AsynchronousTask(SlotObject):
@@ -17,8 +18,7 @@ class AsynchronousTask(SlotObject):
 	"""
 
 	__slots__ = ("background", "cancelled", "returncode", "scheduler") + \
-		("_exit_listeners", "_exit_listener_stack", "_start_listeners",
-		"_waiting")
+		("_exit_listeners", "_exit_listener_stack", "_start_listeners")
 
 	_cancelled_returncode = - signal.SIGINT
 
@@ -68,15 +68,19 @@ class AsynchronousTask(SlotObject):
 
 	def wait(self):
 		"""
-		Deprecated. Use async_wait() instead.
+		Wait for the returncode attribute to become ready, and return
+		it. If the returncode is not ready and the event loop is already
+		running, then the async_wait() method should be used instead of
+		wait(), because wait() will raise asyncio.InvalidStateError in
+		this case.
+
+		@rtype: int
+		@returns: the value of self.returncode
 		"""
 		if self.returncode is None:
-			if not self._waiting:
-				self._waiting = True
-				try:
-					self._wait()
-				finally:
-					self._waiting = False
+			if self.scheduler.is_running():
+				raise asyncio.InvalidStateError('Result is not ready.')
+			self.scheduler.run_until_complete(self.async_wait())
 		self._wait_hook()
 		return self.returncode
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 21:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     22fbdd3bf7de43c3bb216cd2da0623cd24280499
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 19:16:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 20:27:32 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=22fbdd3b

SpawnProcess: fix deprecated _set_returncode (bug 654276)

Move cleanup code from _set_returncode to _unregister, since
_set_returncode expects an os.waitpid return value which is
inconveniently different from the returncode that is passed to
asyncio.AbstractChildWatcher.add_child_handler callbacks.

Bug: https://bugs.gentoo.org/654276

 pym/_emerge/SpawnProcess.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 78eb5e9c0..f592c543d 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -117,8 +117,7 @@ class SpawnProcess(SubProcess):
 
 		if isinstance(retval, int):
 			# spawn failed
-			self._unregister()
-			self._set_returncode((self.pid, retval))
+			self.returncode = retval
 			self._async_wait()
 			return
 
@@ -172,9 +171,11 @@ class SpawnProcess(SubProcess):
 		self._pipe_logger = None
 		self._async_waitpid()
 
-	def _set_returncode(self, wait_retval):
-		SubProcess._set_returncode(self, wait_retval)
-		self._cgroup_cleanup()
+	def _unregister(self):
+		SubProcess._unregister(self)
+		if self.cgroup is not None:
+			self._cgroup_cleanup()
+			self.cgroup = None
 
 	def _cancel(self):
 		SubProcess._cancel(self)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 21:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     b2ba35d4704172e8ddbfa0c98900f4b6ed20416b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 20:03:05 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 20:03:43 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b2ba35d4

AbstractPollTask: call _unregister in _async_wait (bug 654276)

Subclasses of AbstractPollTask perform idempotent cleanup in
the _unregister method, so it's useful for _async_wait to call it
automatically. This allows for migration of various cleanup code from
_set_returncode to _unregister, for the purposes of bug 654276.

Bug: https://bugs.gentoo.org/654276

 pym/_emerge/AbstractPollTask.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 0ce3594b4..2c5403751 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -114,8 +114,12 @@ class AbstractPollTask(AsynchronousTask):
 
 		return buf
 
+	def _async_wait(self):
+		self._unregister()
+		super(AbstractPollTask, self)._async_wait()
+
 	def _unregister(self):
-		raise NotImplementedError(self)
+		self._registered = False
 
 	def _log_poll_exception(self, event):
 		writemsg_level(
@@ -127,12 +131,10 @@ class AbstractPollTask(AsynchronousTask):
 		if self._registered:
 			if event & self._exceptional_events:
 				self._log_poll_exception(event)
-				self._unregister()
 				self.cancel()
 				self.returncode = self.returncode or os.EX_OK
 				self._async_wait()
 			elif event & self.scheduler.IO_HUP:
-				self._unregister()
 				self.returncode = self.returncode or os.EX_OK
 				self._async_wait()
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 21:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     943bd29a388a7d113066bad660c9bfdb6fab0821
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 20:35:37 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 20:35:37 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=943bd29a

EbuildFetcher: fix deprecated _set_returncode (bug 654276)

Move cleanup code from _set_returncode to _async_waitpid_cb,
since _set_returncode expects an os.waitpid return value which
is inconveniently different from the returncode that is passed to
asyncio.AbstractChildWatcher.add_child_handler callbacks.

Bug: https://bugs.gentoo.org/654276

 pym/_emerge/EbuildFetcher.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 466beac06..7c2cb3a58 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import copy
@@ -166,7 +166,7 @@ class _EbuildFetcherProcess(ForkProcess):
 
 		if not uri_map:
 			# Nothing to fetch.
-			self._set_returncode((self.pid, os.EX_OK << 8))
+			self.returncode = os.EX_OK
 			self._async_wait()
 			return
 
@@ -178,7 +178,7 @@ class _EbuildFetcherProcess(ForkProcess):
 		if self.prefetch and \
 			self._prefetch_size_ok(uri_map, settings, ebuild_path):
 			self.config_pool.deallocate(settings)
-			self._set_returncode((self.pid, os.EX_OK << 8))
+			self.returncode = os.EX_OK
 			self._async_wait()
 			return
 
@@ -327,8 +327,12 @@ class _EbuildFetcherProcess(ForkProcess):
 		if msg:
 			self.scheduler.output(msg, log_path=self.logfile)
 
-	def _set_returncode(self, wait_retval):
-		ForkProcess._set_returncode(self, wait_retval)
+	def _async_waitpid_cb(self, *args, **kwargs):
+		"""
+		Override _async_waitpid_cb to perform cleanup that is
+		not necessarily idempotent.
+		"""
+		ForkProcess._async_waitpid_cb(self, *args, **kwargs)
 		# Collect elog messages that might have been
 		# created by the pkg_nofetch phase.
 		# Skip elog messages for prefetch, in order to avoid duplicates.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 21:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     6d6e7debbd768b399bba5a32156bd59bb18f737d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 20:19:24 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 20:27:32 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6d6e7deb

BinpkgFetcher: fix deprecated _set_returncode (bug 654276)

The _set_returncode method is deprecated because it expects
an os.waitpid return value which is inconveniently
different from the returncode that is passed to
asyncio.AbstractChildWatcher.add_child_handler callbacks.

Bug: https://bugs.gentoo.org/654276

 pym/_emerge/BinpkgFetcher.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py
index 2bbc0a26f..8e651a1c7 100644
--- a/pym/_emerge/BinpkgFetcher.py
+++ b/pym/_emerge/BinpkgFetcher.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import functools
@@ -108,7 +108,7 @@ class _BinpkgFetcherProcess(SpawnProcess):
 
 		if pretend:
 			portage.writemsg_stdout("\n%s\n" % uri, noiselevel=-1)
-			self._set_returncode((self.pid, os.EX_OK << 8))
+			self.returncode = os.EX_OK
 			self._async_wait()
 			return
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 21:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     08f03935b92e8fcacf95c583e389f349f5db67b8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 19:09:00 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 20:27:32 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=08f03935

AbstractEbuildProcess: fix deprecated _set_returncode (bug 654276)

Move cleanup code from _set_returncode to _async_waitpid_cb,
since _set_returncode expects an os.waitpid return value which
is inconveniently different from the returncode that is passed to
asyncio.AbstractChildWatcher.add_child_handler callbacks.

Bug: https://bugs.gentoo.org/654276

 pym/_emerge/AbstractEbuildProcess.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 03c834912..2ed175750 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -64,7 +64,7 @@ class AbstractEbuildProcess(SpawnProcess):
 			"since PORTAGE_BUILDDIR does not exist: '%s'") % \
 			(self.phase, self.settings['PORTAGE_BUILDDIR'])
 			self._eerror(textwrap.wrap(msg, 72))
-			self._set_returncode((self.pid, 1 << 8))
+			self.returncode = 1
 			self._async_wait()
 			return
 
@@ -355,8 +355,12 @@ class AbstractEbuildProcess(SpawnProcess):
 			["%s received strange poll event: %s\n" % \
 			(self.__class__.__name__, event,)])
 
-	def _set_returncode(self, wait_retval):
-		SpawnProcess._set_returncode(self, wait_retval)
+	def _async_waitpid_cb(self, *args, **kwargs):
+		"""
+		Override _async_waitpid_cb to perform cleanup that is
+		not necessarily idempotent.
+		"""
+		SpawnProcess._async_waitpid_cb(self, *args, **kwargs)
 
 		if self._exit_timeout_id is not None:
 			self.scheduler.source_remove(self._exit_timeout_id)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 21:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 21:29 UTC (permalink / raw
  To: gentoo-commits

commit:     9b013dc77de62604d151f82831ca3cd494788d5f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 20:42:31 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 20:44:27 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9b013dc7

EbuildMetadataPhase: fix deprecated _set_returncode (bug 654276)

Move cleanup code from _set_returncode to _async_waitpid_cb,
since _set_returncode expects an os.waitpid return value which
is inconveniently different from the returncode that is passed to
asyncio.AbstractChildWatcher.add_child_handler callbacks.

Bug: https://bugs.gentoo.org/654276

 pym/_emerge/EbuildMetadataPhase.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index d146424c3..7a5310b83 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.SubProcess import SubProcess
@@ -49,14 +49,14 @@ class EbuildMetadataPhase(SubProcess):
 		if not parsed_eapi:
 			# An empty EAPI setting is invalid.
 			self._eapi_invalid(None)
-			self._set_returncode((self.pid, 1 << 8))
+			self.returncode = 1
 			self._async_wait()
 			return
 
 		self.eapi_supported = portage.eapi_is_supported(parsed_eapi)
 		if not self.eapi_supported:
 			self.metadata = {"EAPI": parsed_eapi}
-			self._set_returncode((self.pid, os.EX_OK << 8))
+			self.returncode = os.EX_OK
 			self._async_wait()
 			return
 
@@ -124,8 +124,7 @@ class EbuildMetadataPhase(SubProcess):
 
 		if isinstance(retval, int):
 			# doebuild failed before spawning
-			self._unregister()
-			self._set_returncode((self.pid, retval << 8))
+			self.returncode = retval
 			self._async_wait()
 			return
 
@@ -155,8 +154,12 @@ class EbuildMetadataPhase(SubProcess):
 
 		return True
 
-	def _set_returncode(self, wait_retval):
-		SubProcess._set_returncode(self, wait_retval)
+	def _async_waitpid_cb(self, *args, **kwargs):
+		"""
+		Override _async_waitpid_cb to perform cleanup that is
+		not necessarily idempotent.
+		"""
+		SubProcess._async_waitpid_cb(self, *args, **kwargs)
 		# self._raw_metadata is None when _start returns
 		# early due to an unsupported EAPI
 		if self.returncode == os.EX_OK and \


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 22:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 22:24 UTC (permalink / raw
  To: gentoo-commits

commit:     4da425966a82bfbbb68908010995941a44b45598
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 21:39:28 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 21:41:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4da42596

AbstractEbuildProcess: call_later asyncio compat (bug 591760)

Use call_later for asyncio compatibility.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/AbstractEbuildProcess.py | 11 ++++-------
 pym/_emerge/SubProcess.py            |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 2ed175750..ccc3b8e32 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -37,7 +37,7 @@ class AbstractEbuildProcess(SpawnProcess):
 	# doesn't hurt to be generous here since the scheduler
 	# continues to process events during this period, and it can
 	# return long before the timeout expires.
-	_exit_timeout = 10000 # 10 seconds
+	_exit_timeout = 10 # seconds
 
 	# The EbuildIpcDaemon support is well tested, but this variable
 	# is left so we can temporarily disable it if any issues arise.
@@ -247,7 +247,7 @@ class AbstractEbuildProcess(SpawnProcess):
 		if self._registered:
 			# Let the process exit naturally, if possible.
 			self._exit_timeout_id = \
-				self.scheduler.timeout_add(self._exit_timeout,
+				self.scheduler.call_later(self._exit_timeout,
 				self._exit_command_timeout_cb)
 
 	def _exit_command_timeout_cb(self):
@@ -258,17 +258,14 @@ class AbstractEbuildProcess(SpawnProcess):
 			# being killed by a signal.
 			self.cancel()
 			self._exit_timeout_id = \
-				self.scheduler.timeout_add(self._cancel_timeout,
+				self.scheduler.call_later(self._cancel_timeout,
 					self._cancel_timeout_cb)
 		else:
 			self._exit_timeout_id = None
 
-		return False # only run once
-
 	def _cancel_timeout_cb(self):
 		self._exit_timeout_id = None
 		self._async_waitpid()
-		return False # only run once
 
 	def _orphan_process_warn(self):
 		phase = self.phase
@@ -363,7 +360,7 @@ class AbstractEbuildProcess(SpawnProcess):
 		SpawnProcess._async_waitpid_cb(self, *args, **kwargs)
 
 		if self._exit_timeout_id is not None:
-			self.scheduler.source_remove(self._exit_timeout_id)
+			self._exit_timeout_id.cancel()
 			self._exit_timeout_id = None
 
 		if self._ipc_daemon is not None:

diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index aa4778737..a37482ca4 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -16,7 +16,7 @@ class SubProcess(AbstractPollTask):
 
 	# This is how much time we allow for waitpid to succeed after
 	# we've sent a kill signal to our subprocess.
-	_cancel_timeout = 1000 # 1 second
+	_cancel_timeout = 1 # seconds
 
 	def _poll(self):
 		# Simply rely on _async_waitpid_cb to set the returncode.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 22:24 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-29 22:24 UTC (permalink / raw
  To: gentoo-commits

commit:     28fd93d4de0c1adcecb7ce10c7514d5718ccf43f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 21:58:38 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 22:18:28 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=28fd93d4

Scheduler: call_later asyncio compat (bug 591760)

Use call_later for asyncio compatibility.

Bug: https://bugs.gentoo.org/591760

 pym/_emerge/Scheduler.py | 39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 4c1ea5078..422308184 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -74,8 +74,8 @@ class Scheduler(PollScheduler):
 	# max time between loadavg checks (seconds)
 	_loadavg_latency = 30
 
-	# max time between display status updates (milliseconds)
-	_max_display_latency = 3000
+	# max time between display status updates (seconds)
+	_max_display_latency = 3
 
 	_opts_ignore_blockers = \
 		frozenset(["--buildpkgonly",
@@ -1398,10 +1398,15 @@ class Scheduler(PollScheduler):
 		failed_pkgs = self._failed_pkgs
 		portage.locks._quiet = self._background
 		portage.elog.add_listener(self._elog_listener)
-		display_timeout_id = None
+
+		def display_callback():
+			self._status_display.display()
+			display_callback.handle = self._event_loop.call_later(
+				self._max_display_latency, display_callback)
+		display_callback.handle = None
+
 		if self._status_display._isatty and not self._status_display.quiet:
-			display_timeout_id = self._event_loop.timeout_add(
-				self._max_display_latency, self._status_display.display)
+			display_callback()
 		rval = os.EX_OK
 
 		try:
@@ -1410,8 +1415,8 @@ class Scheduler(PollScheduler):
 			self._main_loop_cleanup()
 			portage.locks._quiet = False
 			portage.elog.remove_listener(self._elog_listener)
-			if display_timeout_id is not None:
-				self._event_loop.source_remove(display_timeout_id)
+			if display_callback.handle is not None:
+				display_callback.handle.cancel()
 			if failed_pkgs:
 				rval = failed_pkgs[-1].returncode
 
@@ -1625,12 +1630,11 @@ class Scheduler(PollScheduler):
 					elapsed_seconds < self._sigcont_delay:
 
 					if self._job_delay_timeout_id is not None:
-						self._event_loop.source_remove(
-							self._job_delay_timeout_id)
+						self._job_delay_timeout_id.cancel()
 
-					self._job_delay_timeout_id = self._event_loop.timeout_add(
-						1000 * (self._sigcont_delay - elapsed_seconds),
-						self._schedule_once)
+					self._job_delay_timeout_id = self._event_loop.call_later(
+						self._sigcont_delay - elapsed_seconds,
+						self._schedule)
 					return True
 
 				# Only set this to None after the delay has expired,
@@ -1651,19 +1655,14 @@ class Scheduler(PollScheduler):
 			if elapsed_seconds > 0 and elapsed_seconds < delay:
 
 				if self._job_delay_timeout_id is not None:
-					self._event_loop.source_remove(
-						self._job_delay_timeout_id)
+					self._job_delay_timeout_id.cancel()
 
-				self._job_delay_timeout_id = self._event_loop.timeout_add(
-					1000 * (delay - elapsed_seconds), self._schedule_once)
+				self._job_delay_timeout_id = self._event_loop.call_later(
+					delay - elapsed_seconds, self._schedule)
 				return True
 
 		return False
 
-	def _schedule_once(self):
-		self._schedule()
-		return False
-
 	def _schedule_tasks_imp(self):
 		"""
 		@rtype: bool


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-30  6:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-30  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     31094342b2c55ecdf249e0b4a1df22d391f7fc1e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 05:34:07 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 06:20:01 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=31094342

PipeReader: add_reader asyncio compat (bug 654382)

Use add_reader for asyncio compatibility.

Bug: https://bugs.gentoo.org/654382

 pym/_emerge/PipeReader.py | 27 ++++++++-------------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 267d0cea1..6b567d8b1 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -17,10 +17,9 @@ class PipeReader(AbstractPollTask):
 	"""
 
 	__slots__ = ("input_files",) + \
-		("_read_data", "_reg_ids", "_use_array")
+		("_read_data", "_use_array")
 
 	def _start(self):
-		self._reg_ids = set()
 		self._read_data = []
 
 		if self._use_array:
@@ -43,8 +42,7 @@ class PipeReader(AbstractPollTask):
 					fcntl.fcntl(fd, fcntl.F_SETFD,
 						fcntl.fcntl(fd, fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
 
-			self._reg_ids.add(self.scheduler.io_add_watch(fd,
-				self._registered_events, output_handler))
+			self.scheduler.add_reader(fd, output_handler, fd)
 		self._registered = True
 
 	def _cancel(self):
@@ -60,10 +58,10 @@ class PipeReader(AbstractPollTask):
 		"""Free the memory buffer."""
 		self._read_data = None
 
-	def _output_handler(self, fd, event):
+	def _output_handler(self, fd):
 
 		while True:
-			data = self._read_buf(fd, event)
+			data = self._read_buf(fd, None)
 			if data is None:
 				break
 			if data:
@@ -74,18 +72,14 @@ class PipeReader(AbstractPollTask):
 				self._async_wait()
 				break
 
-		self._unregister_if_appropriate(event)
-
-		return True
-
-	def _array_output_handler(self, fd, event):
+	def _array_output_handler(self, fd):
 
 		for f in self.input_files.values():
 			if f.fileno() == fd:
 				break
 
 		while True:
-			data = self._read_array(f, event)
+			data = self._read_array(f, self.scheduler.IO_IN)
 			if data is None:
 				break
 			if data:
@@ -96,8 +90,6 @@ class PipeReader(AbstractPollTask):
 				self._async_wait()
 				break
 
-		self._unregister_if_appropriate(event)
-
 		return True
 
 	def _unregister(self):
@@ -107,16 +99,13 @@ class PipeReader(AbstractPollTask):
 
 		self._registered = False
 
-		if self._reg_ids is not None:
-			for reg_id in self._reg_ids:
-				self.scheduler.source_remove(reg_id)
-			self._reg_ids = None
-
 		if self.input_files is not None:
 			for f in self.input_files.values():
 				if isinstance(f, int):
+					self.scheduler.remove_reader(f)
 					os.close(f)
 				else:
+					self.scheduler.remove_reader(f.fileno())
 					f.close()
 			self.input_files = None
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-30  6:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-30  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     e1145930e94db753e29330a54e24b0814bd6c80c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 03:22:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 06:20:01 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e1145930

EbuildMetadataPhase: add_reader asyncio compat (bug 654382)

Use add_reader for asyncio compatibility.

Bug: https://bugs.gentoo.org/654382

 pym/_emerge/EbuildMetadataPhase.py | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index 7a5310b83..42bcd6739 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -15,7 +15,6 @@ from portage import _unicode_encode
 from portage.dep import extract_unpack_dependencies
 from portage.eapi import eapi_has_automatic_unpack_dependencies
 
-import errno
 import fcntl
 import io
 
@@ -109,8 +108,7 @@ class EbuildMetadataPhase(SubProcess):
 
 		self._raw_metadata = []
 		files.ebuild = master_fd
-		self._reg_id = self.scheduler.io_add_watch(files.ebuild,
-			self._registered_events, self._output_handler)
+		self.scheduler.add_reader(files.ebuild, self._output_handler)
 		self._registered = True
 
 		retval = portage.doebuild(ebuild_path, "depend",
@@ -130,19 +128,14 @@ class EbuildMetadataPhase(SubProcess):
 
 		self.pid = retval[0]
 
-	def _output_handler(self, fd, event):
-
-		if event & self.scheduler.IO_IN:
-			while True:
-				try:
-					self._raw_metadata.append(
-						os.read(self._files.ebuild, self._bufsize))
-				except OSError as e:
-					if e.errno not in (errno.EAGAIN,):
-						raise
-					break
-				else:
-					if not self._raw_metadata[-1]:
+	def _output_handler(self):
+		while True:
+			buf = self._read_buf(self._files.ebuild, None)
+			if buf is None:
+				break # EAGAIN
+			elif buf:
+				self._raw_metadata.append(buf)
+			else: # EIO/POLLHUP
 						if self.pid is None:
 							self._unregister()
 							self._async_wait()
@@ -150,9 +143,9 @@ class EbuildMetadataPhase(SubProcess):
 							self._async_waitpid()
 						break
 
-		self._unregister_if_appropriate(event)
-
-		return True
+	def _unregister(self):
+		self.scheduler.remove_reader(self._files.ebuild)
+		SubProcess._unregister(self)
 
 	def _async_waitpid_cb(self, *args, **kwargs):
 		"""


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-30  6:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-30  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     dfbb97f20ad7cc537f73c204eb740f8e376e27bb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 02:55:14 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 06:13:25 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=dfbb97f2

_LockProcess: add_reader asyncio compat (bug 654382)

Use add_reader for asyncio compatibility.

Bug: https://bugs.gentoo.org/654382

 pym/_emerge/AsynchronousLock.py | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index c5991bcff..6cf37369f 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -2,7 +2,6 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import fcntl
-import errno
 import logging
 import sys
 
@@ -181,8 +180,7 @@ class _LockProcess(AbstractPollTask):
 	"""
 
 	__slots__ = ('path',) + \
-		('_acquired', '_kill_test', '_proc', '_files',
-		 '_reg_id','_unlock_future')
+		('_acquired', '_kill_test', '_proc', '_files', '_unlock_future')
 
 	def _start(self):
 		in_pr, in_pw = os.pipe()
@@ -204,8 +202,7 @@ class _LockProcess(AbstractPollTask):
 				fcntl.fcntl(in_pr, fcntl.F_SETFD,
 					fcntl.fcntl(in_pr, fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
 
-		self._reg_id = self.scheduler.io_add_watch(in_pr,
-			self.scheduler.IO_IN, self._output_handler)
+		self.scheduler.add_reader(in_pr, self._output_handler)
 		self._registered = True
 		self._proc = SpawnProcess(
 			args=[portage._python_interpreter,
@@ -268,14 +265,8 @@ class _LockProcess(AbstractPollTask):
 			self._proc.poll()
 		return self.returncode
 
-	def _output_handler(self, f, event):
-		buf = None
-		if event & self.scheduler.IO_IN:
-			try:
-				buf = os.read(self._files['pipe_in'], self._bufsize)
-			except OSError as e:
-				if e.errno not in (errno.EAGAIN,):
-					raise
+	def _output_handler(self):
+		buf = self._read_buf(self._files['pipe_in'], None)
 		if buf:
 			self._acquired = True
 			self._unregister()
@@ -287,16 +278,13 @@ class _LockProcess(AbstractPollTask):
 	def _unregister(self):
 		self._registered = False
 
-		if self._reg_id is not None:
-			self.scheduler.source_remove(self._reg_id)
-			self._reg_id = None
-
 		if self._files is not None:
 			try:
 				pipe_in = self._files.pop('pipe_in')
 			except KeyError:
 				pass
 			else:
+				self.scheduler.remove_reader(pipe_in)
 				os.close(pipe_in)
 
 	def _unlock(self):


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-30  6:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-30  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     c06c7e50244292e263e5512f7baefc16bbe85456
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 04:05:22 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 06:20:01 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c06c7e50

EbuildIpcDaemon: add_reader asyncio compat (bug 654382)

Use add_reader for asyncio compatibility.

Bug: https://bugs.gentoo.org/654382

 pym/_emerge/EbuildIpcDaemon.py | 28 +++++++---------------------
 pym/_emerge/FifoIpcDaemon.py   | 20 ++++++++------------
 2 files changed, 15 insertions(+), 33 deletions(-)

diff --git a/pym/_emerge/EbuildIpcDaemon.py b/pym/_emerge/EbuildIpcDaemon.py
index 8414d2020..c16049ee4 100644
--- a/pym/_emerge/EbuildIpcDaemon.py
+++ b/pym/_emerge/EbuildIpcDaemon.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -32,24 +32,12 @@ class EbuildIpcDaemon(FifoIpcDaemon):
 
 	__slots__ = ('commands',)
 
-	def _input_handler(self, fd, event):
+	def _input_handler(self):
 		# Read the whole pickle in a single atomic read() call.
-		data = None
-		if event & self.scheduler.IO_IN:
-			# For maximum portability, use os.read() here since
-			# array.fromfile() and file.read() are both known to
-			# erroneously return an empty string from this
-			# non-blocking fifo stream on FreeBSD (bug #337465).
-			try:
-				data = os.read(fd, self._bufsize)
-			except OSError as e:
-				if e.errno != errno.EAGAIN:
-					raise
-				# Assume that another event will be generated
-				# if there's any relevant data.
-
-		if data:
-
+		data = self._read_buf(self._files.pipe_in, None)
+		if data is None:
+			pass # EAGAIN
+		elif data:
 			try:
 				obj = pickle.loads(data)
 			except SystemExit:
@@ -85,7 +73,7 @@ class EbuildIpcDaemon(FifoIpcDaemon):
 				if reply_hook is not None:
 					reply_hook()
 
-		elif event & self.scheduler.IO_HUP:
+		else: # EIO/POLLHUP
 			# This can be triggered due to a race condition which happens when
 			# the previous _reopen_input() call occurs before the writer has
 			# closed the pipe (see bug #401919). It's not safe to re-open
@@ -107,8 +95,6 @@ class EbuildIpcDaemon(FifoIpcDaemon):
 				finally:
 					unlockfile(lock_obj)
 
-		return True
-
 	def _send_reply(self, reply):
 		# File streams are in unbuffered mode since we do atomic
 		# read and write of whole pickles. Use non-blocking mode so

diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py
index 3676e98da..0cbaa13c7 100644
--- a/pym/_emerge/FifoIpcDaemon.py
+++ b/pym/_emerge/FifoIpcDaemon.py
@@ -15,8 +15,7 @@ from portage.cache.mappings import slot_dict_class
 
 class FifoIpcDaemon(AbstractPollTask):
 
-	__slots__ = ("input_fifo", "output_fifo",) + \
-		("_files", "_reg_id",)
+	__slots__ = ("input_fifo", "output_fifo", "_files")
 
 	_file_names = ("pipe_in",)
 	_files_dict = slot_dict_class(_file_names, prefix="")
@@ -40,9 +39,9 @@ class FifoIpcDaemon(AbstractPollTask):
 					fcntl.fcntl(self._files.pipe_in,
 						fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
 
-		self._reg_id = self.scheduler.io_add_watch(
+		self.scheduler.add_reader(
 			self._files.pipe_in,
-			self._registered_events, self._input_handler)
+			self._input_handler)
 
 		self._registered = True
 
@@ -51,7 +50,7 @@ class FifoIpcDaemon(AbstractPollTask):
 		Re-open the input stream, in order to suppress
 		POLLHUP events (bug #339976).
 		"""
-		self.scheduler.source_remove(self._reg_id)
+		self.scheduler.remove_reader(self._files.pipe_in)
 		os.close(self._files.pipe_in)
 		self._files.pipe_in = \
 			os.open(self.input_fifo, os.O_RDONLY|os.O_NONBLOCK)
@@ -67,9 +66,9 @@ class FifoIpcDaemon(AbstractPollTask):
 					fcntl.fcntl(self._files.pipe_in,
 						fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
 
-		self._reg_id = self.scheduler.io_add_watch(
+		self.scheduler.add_reader(
 			self._files.pipe_in,
-			self._registered_events, self._input_handler)
+			self._input_handler)
 
 	def isAlive(self):
 		return self._registered
@@ -81,7 +80,7 @@ class FifoIpcDaemon(AbstractPollTask):
 		# notify exit listeners
 		self._async_wait()
 
-	def _input_handler(self, fd, event):
+	def _input_handler(self):
 		raise NotImplementedError(self)
 
 	def _unregister(self):
@@ -91,11 +90,8 @@ class FifoIpcDaemon(AbstractPollTask):
 
 		self._registered = False
 
-		if self._reg_id is not None:
-			self.scheduler.source_remove(self._reg_id)
-			self._reg_id = None
-
 		if self._files is not None:
 			for f in self._files.values():
+				self.scheduler.remove_reader(f)
 				os.close(f)
 			self._files = None


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-30 19:28 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-04-30 19:28 UTC (permalink / raw
  To: gentoo-commits

commit:     2bd3d97d18644f2dc348df808a0f32d4d36e7120
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 30 19:05:07 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 30 19:05:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2bd3d97d

AbstractPollTask: remove unused IO_* references

Fixes: c11a6ec05f02 ("AbstractPollTask: add_reader asyncio compat (bug 654382)")

 pym/_emerge/AbstractPollTask.py | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index 3a869cb46..f68cd3a15 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -16,15 +16,6 @@ class AbstractPollTask(AsynchronousTask):
 
 	_bufsize = 4096
 
-	@property
-	def _exceptional_events(self):
-		return self.scheduler.IO_ERR | self.scheduler.IO_NVAL
-
-	@property
-	def _registered_events(self):
-		return self.scheduler.IO_IN | self.scheduler.IO_HUP | \
-			self._exceptional_events
-
 	def isAlive(self):
 		return bool(self._registered)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-01 16:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-01 16:26 UTC (permalink / raw
  To: gentoo-commits

commit:     716f69482ffabf1a8e0e3496942a00ee5cdfa229
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  3 20:31:38 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May  1 16:25:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=716f6948

emerge: Add --sysroot option to set SYSROOT environment variable

Closes: https://github.com/gentoo/portage/pull/276

 pym/_emerge/main.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index e1b949b92..e8b2c2e13 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -732,6 +732,11 @@ def parse_opts(tmpcmdline, silent=False):
 			"action" : "append",
 		},
 
+		"--sysroot": {
+			"help":"specify the location for build dependencies specified in DEPEND",
+			"action":"store"
+		},
+
 		"--use-ebuild-visibility": {
 			"help"     : "use unbuilt ebuild metadata for visibility checks on built packages",
 			"choices"  : true_y_or_n
@@ -1201,6 +1206,8 @@ def emerge_main(args=None):
 		os.environ["PORTAGE_DEBUG"] = "1"
 	if "--config-root" in myopts:
 		os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"]
+	if "--sysroot" in myopts:
+		os.environ["SYSROOT"] = myopts["--sysroot"]
 	if "--root" in myopts:
 		os.environ["ROOT"] = myopts["--root"]
 	if "--prefix" in myopts:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-04 17:00 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-04 17:00 UTC (permalink / raw
  To: gentoo-commits

commit:     17604fd598d799c6af24b66fc2c240f90dddd420
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May  4 16:47:49 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May  4 16:51:32 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=17604fd5

EbuildMerge: wait build dir to unlock (bug 654812)

Wait for the build dir to unlock, in order to ensure that
the category directory is removed when appropriate.

Fixes: 720fef408d07 ("Binpkg: use async_unlock (bug 614108)")
Fixes: 5ca8ef781952 ("EbuildBuild: use async_unlock (bug 614108)")
Bug: https://bugs.gentoo.org/654812

 pym/_emerge/Binpkg.py      | 12 +++++++++++-
 pym/_emerge/EbuildBuild.py | 12 +++++++++++-
 pym/_emerge/EbuildMerge.py | 26 +++++++++++++++++++++-----
 3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index e9c5ef568..2b67816e8 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import functools
@@ -428,6 +428,10 @@ class Binpkg(CompositeTask):
 		return task
 
 	def _install_exit(self, task):
+		"""
+		@returns: Future, result is the returncode from an
+			EbuildBuildDir.async_unlock() task
+		"""
 		self.settings.pop("PORTAGE_BINPKG_FILE", None)
 		if task.returncode == os.EX_OK and \
 			'binpkg-logs' not in self.settings.features and \
@@ -437,3 +441,9 @@ class Binpkg(CompositeTask):
 			except OSError:
 				pass
 		self._async_unlock_builddir()
+		if self._current_task is None:
+			result = self.scheduler.create_future()
+			self.scheduler.call_soon(result.set_result, os.EX_OK)
+		else:
+			result = self._current_task.async_wait()
+		return result

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index e5b96691a..00d4680f5 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -494,4 +494,14 @@ class EbuildBuild(CompositeTask):
 		return task
 
 	def _install_exit(self, task):
+		"""
+		@returns: Future, result is the returncode from an
+			EbuildBuildDir.async_unlock() task
+		"""
 		self._async_unlock_builddir()
+		if self._current_task is None:
+			result = self.scheduler.create_future()
+			self.scheduler.call_soon(result.set_result, os.EX_OK)
+		else:
+			result = self._current_task.async_wait()
+		return result

diff --git a/pym/_emerge/EbuildMerge.py b/pym/_emerge/EbuildMerge.py
index 07d9134c3..bedea902d 100644
--- a/pym/_emerge/EbuildMerge.py
+++ b/pym/_emerge/EbuildMerge.py
@@ -1,9 +1,12 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import functools
+
 from _emerge.CompositeTask import CompositeTask
 from portage import os
 from portage.dbapi._MergeProcess import MergeProcess
+from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 
 class EbuildMerge(CompositeTask):
 
@@ -35,8 +38,7 @@ class EbuildMerge(CompositeTask):
 
 	def _merge_exit(self, merge_task):
 		if self._final_exit(merge_task) != os.EX_OK:
-			self.exit_hook(self)
-			self.wait()
+			self._start_exit_hook(self.returncode)
 			return
 
 		self.postinst_failure = merge_task.postinst_failure
@@ -55,5 +57,19 @@ class EbuildMerge(CompositeTask):
 		logger.log(" ::: completed emerge (%s of %s) %s to %s" % \
 			(pkg_count.curval, pkg_count.maxval, pkg.cpv, pkg.root))
 
-		self.exit_hook(self)
-		self.wait()
+		self._start_exit_hook(self.returncode)
+
+	def _start_exit_hook(self, returncode):
+		"""
+		Start the exit hook, and set returncode after it completes.
+		"""
+		# The returncode will be set after exit hook is complete.
+		self.returncode = None
+		self._start_task(
+			AsyncTaskFuture(future=self.exit_hook(self)),
+			functools.partial(self._exit_hook_exit, returncode))
+
+	def _exit_hook_exit(self, returncode, task):
+		self._assert_current(task)
+		self.returncode = returncode
+		self._async_wait()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-13  5:04 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-13  5:04 UTC (permalink / raw
  To: gentoo-commits

commit:     5497d9033e180a759ed97e5aab920d6ec6ea26cd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 13 04:52:47 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 13 04:53:21 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5497d903

_EbuildFetcherProcess: fix event loop recursion (bug 655378)

Get SRC_URI metadata asynchronously in order to avoid event
loop recursion in doebuild_environment.

Bug: https://bugs.gentoo.org/655378

 pym/_emerge/EbuildFetcher.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index 7c2cb3a58..3b30ebb59 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -60,13 +60,26 @@ class EbuildFetcher(CompositeTask):
 			self._async_wait()
 			return
 
+		# First get the SRC_URI metadata (it's not cached in self.pkg.metadata
+		# because some packages have an extremely large SRC_URI value).
+		self._start_task(
+			AsyncTaskFuture(
+				future=self.pkg.root_config.trees["porttree"].dbapi.\
+				async_aux_get(self.pkg.cpv, ["SRC_URI"], myrepo=self.pkg.repo,
+				loop=self.scheduler)),
+			self._start_with_metadata)
+
+	def _start_with_metadata(self, aux_get_task):
+		self._assert_current(aux_get_task)
+		self._fetcher_proc.src_uri, = aux_get_task.future.result()
 		self._start_task(self._fetcher_proc, self._default_final_exit)
 
 
 class _EbuildFetcherProcess(ForkProcess):
 
 	__slots__ = ("config_pool", "ebuild_path", "fetchonly", "fetchall",
-		"pkg", "prefetch", "_digests", "_manifest", "_settings", "_uri_map")
+		"pkg", "prefetch", "src_uri", "_digests", "_manifest",
+		"_settings", "_uri_map")
 
 	def async_already_fetched(self, settings):
 		result = self.scheduler.create_future()
@@ -172,6 +185,7 @@ class _EbuildFetcherProcess(ForkProcess):
 
 		settings = self.config_pool.allocate()
 		settings.setcpv(self.pkg)
+		settings.configdict["pkg"]["SRC_URI"] = self.src_uri
 		portage.doebuild_environment(ebuild_path, 'fetch',
 			settings=settings, db=portdb)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-27  4:10 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-27  4:10 UTC (permalink / raw
  To: gentoo-commits

commit:     a629f11a0fa140bfd85baeefaf99c5896f972acc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 27 04:05:27 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 27 04:08:50 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a629f11a

AbstractPollTask._read_array: document performance

A benchmark that copies bytes from /dev/zero to /dev/null shows
that arrays give a 15% performance improvement for Python 2.7.14.
However, arrays significantly *decrease* performance for Python 3.

Also, remove obsolete documentation about the POLLIN bit.

 pym/_emerge/AbstractPollTask.py | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/pym/_emerge/AbstractPollTask.py b/pym/_emerge/AbstractPollTask.py
index f898aa708..4157794c6 100644
--- a/pym/_emerge/AbstractPollTask.py
+++ b/pym/_emerge/AbstractPollTask.py
@@ -25,15 +25,9 @@ class AbstractPollTask(AsynchronousTask):
 		because it has bugs in all known versions of Python (including
 		Python 2.7 and Python 3.2). See PipeReaderArrayTestCase.
 
-		| POLLIN | RETURN
-		| BIT    | VALUE
-		| ---------------------------------------------------
-		| 1      | Read self._bufsize into an instance of
-		|        | array.array('B') and return it, handling
-		|        | EOFError and IOError. An empty array
-		|        | indicates EOF.
-		| ---------------------------------------------------
-		| 0      | None
+		A benchmark that copies bytes from /dev/zero to /dev/null shows
+		that arrays give a 15% performance improvement for Python 2.7.14.
+		However, arrays significantly *decrease* performance for Python 3.
 		"""
 		buf = array.array('B')
 		try:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-27  4:26 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-27  4:26 UTC (permalink / raw
  To: gentoo-commits

commit:     d329d1142df1662db452642ac719595d15a0d5bd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 27 04:24:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 27 04:25:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d329d114

PiperReader._start: handle case where fd is 0

 pym/_emerge/PipeReader.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index 151be94ea..fc3b7ca55 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -28,7 +28,7 @@ class PipeReader(AbstractPollTask):
 			output_handler = self._output_handler
 
 		for f in self.input_files.values():
-			fd = isinstance(f, int) and f or f.fileno()
+			fd = f if isinstance(f, int) else f.fileno()
 			fcntl.fcntl(fd, fcntl.F_SETFL,
 				fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-27  4:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-27  4:49 UTC (permalink / raw
  To: gentoo-commits

commit:     b7f94fccf4163364ab7b4c4f0dcd42b8847f03e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 27 04:42:29 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 27 04:42:29 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b7f94fcc

PiperReader._start: pass file to _array_output_handler

 pym/_emerge/PipeReader.py | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py
index fc3b7ca55..1aa5ee3bf 100644
--- a/pym/_emerge/PipeReader.py
+++ b/pym/_emerge/PipeReader.py
@@ -22,11 +22,6 @@ class PipeReader(AbstractPollTask):
 	def _start(self):
 		self._read_data = []
 
-		if self._use_array:
-			output_handler = self._array_output_handler
-		else:
-			output_handler = self._output_handler
-
 		for f in self.input_files.values():
 			fd = f if isinstance(f, int) else f.fileno()
 			fcntl.fcntl(fd, fcntl.F_SETFL,
@@ -42,7 +37,11 @@ class PipeReader(AbstractPollTask):
 					fcntl.fcntl(fd, fcntl.F_SETFD,
 						fcntl.fcntl(fd, fcntl.F_GETFD) | fcntl.FD_CLOEXEC)
 
-			self.scheduler.add_reader(fd, output_handler, fd)
+			if self._use_array:
+				self.scheduler.add_reader(fd, self._array_output_handler, f)
+			else:
+				self.scheduler.add_reader(fd, self._output_handler, fd)
+
 		self._registered = True
 
 	def _cancel(self):
@@ -72,11 +71,7 @@ class PipeReader(AbstractPollTask):
 				self._async_wait()
 				break
 
-	def _array_output_handler(self, fd):
-
-		for f in self.input_files.values():
-			if f.fileno() == fd:
-				break
+	def _array_output_handler(self, f):
 
 		while True:
 			data = self._read_array(f)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-05-31  8:44 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-05-31  8:44 UTC (permalink / raw
  To: gentoo-commits

commit:     d07a47ff3c06f6e8b2adc21ae29eecae07badc9e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 31 08:27:45 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 31 08:27:45 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d07a47ff

emerge: make --nodeps disable --dynamic-deps (bug 656942)

Since --nodeps disable's the depgraph's	_dynamic_deps_preload code,
calls to BlockerDB can trigger inappropriate calls to the FakeVartree
_aux_get_wrapper method, triggering event loop recursion. Therefore,
make --nodeps disable --dynamic-deps, in order to eliminate the
inappropriate _aux_get_wrapper calls.

Bug: https://bugs.gentoo.org/656942

 pym/_emerge/create_depgraph_params.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 1fd1f5e36..08605baa1 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -48,7 +48,7 @@ def create_depgraph_params(myopts, myaction):
 	myparams["ignore_soname_deps"] = myopts.get(
 		"--ignore-soname-deps", "y")
 
-	dynamic_deps = myopts.get("--dynamic-deps", "y") != "n"
+	dynamic_deps = myopts.get("--dynamic-deps", "y") != "n" and "--nodeps" not in myopts
 	if dynamic_deps:
 		myparams["dynamic_deps"] = True
 


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-06-05 20:49 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-06-05 20:49 UTC (permalink / raw
  To: gentoo-commits

commit:     e8067a8e6fbdaccca5915e66c77518e82b090401
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  5 20:41:40 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun  5 20:41:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8067a8e

emerge --depclean: 'str' has no attribute 'soname' (bug 657420)

Convert str to Atom, in order to avoid an AttributeError in the
DbapiProvidesIndex.match method. Also, add comment explaining the
reason for _unicode(atom) usage here, since it's not obvious.

Bug: https://bugs.gentoo.org/657420

 pym/_emerge/actions.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 70fb8d3b4..f7232341d 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -944,8 +944,23 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 			msg.append("the following required packages not being installed:")
 			msg.append("")
 			for atom, parent in unresolvable:
+				# For readability, we want to display the atom with USE
+				# conditionals evaluated whenever possible. However,
+				# there is a very special case where the atom does not
+				# match because the unevaluated form contains one or
+				# more flags for which the target package has missing
+				# IUSE, but due to conditionals those flags are only
+				# visible in the unevaluated form of the atom. In this
+				# case, we must display the unevaluated atom, so that
+				# the user can see the conditional USE deps that would
+				# otherwise be invisible. Use Atom(_unicode(atom)) to
+				# test for a package where this case would matter. This
+				# is not necessarily the same as atom.without_use,
+				# since Atom(_unicode(atom)) may still contain some
+				# USE dependencies that remain after evaluation of
+				# conditionals.
 				if atom.package and atom != atom.unevaluated_atom and \
-					vardb.match(_unicode(atom)):
+					vardb.match(Atom(_unicode(atom))):
 					msg.append("  %s (%s) pulled in by:" %
 						(atom.unevaluated_atom, atom))
 				else:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-06-06  3:22 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-06-06  3:22 UTC (permalink / raw
  To: gentoo-commits

commit:     9e07f3a45c1b321edd07530b278498cb09f8983c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  6 03:14:41 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 03:21:38 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e07f3a4

_unlock_builddir_exit: fix cancel/returncode interaction

When the _unlock_builddir_exit returncode parameter has not been
specified, do not attempt to cancel the current task, since the
task has already completed. This mirrors logic added to the
Binpkg _unlock_builddir_exit method in the previous commit.

Fixes: 937d0156aa06 ("CompositeTask: handle SIGINT/TERM cancelled futures (bug 657436)")
Bug: https://bugs.gentoo.org/657436

 pym/_emerge/AbstractEbuildProcess.py | 8 ++++++--
 pym/_emerge/EbuildBuild.py           | 4 ++--
 pym/_emerge/PackageUninstall.py      | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 370cac529..af6429a00 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -412,7 +412,11 @@ class AbstractEbuildProcess(SpawnProcess):
 
 	def _unlock_builddir_exit(self, unlock_future, returncode=None):
 		# Normally, async_unlock should not raise an exception here.
-		unlock_future.result()
+		unlock_future.cancelled() or unlock_future.result()
 		if returncode is not None:
-			self.returncode = returncode
+			if unlock_future.cancelled():
+				self.cancelled = True
+				self._was_cancelled()
+			else:
+				self.returncode = returncode
 			SpawnProcess._async_wait(self)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 8d264dd1c..ab5a4da74 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -354,12 +354,12 @@ class EbuildBuild(CompositeTask):
 
 	def _unlock_builddir_exit(self, unlock_task, returncode=None):
 		self._assert_current(unlock_task)
-		if unlock_task.cancelled:
+		if unlock_task.cancelled and returncode is not None:
 			self._default_final_exit(unlock_task)
 			return
 
 		# Normally, async_unlock should not raise an exception here.
-		unlock_task.future.result()
+		unlock_task.future.cancelled() or unlock_task.future.result()
 		if returncode is not None:
 			self.returncode = returncode
 			self._async_wait()

diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py
index cb3413056..43210b4bc 100644
--- a/pym/_emerge/PackageUninstall.py
+++ b/pym/_emerge/PackageUninstall.py
@@ -116,12 +116,12 @@ class PackageUninstall(CompositeTask):
 
 	def _unlock_builddir_exit(self, unlock_task, returncode=None):
 		self._assert_current(unlock_task)
-		if unlock_task.cancelled:
+		if unlock_task.cancelled and returncode is not None:
 			self._default_final_exit(unlock_task)
 			return
 
 		# Normally, async_unlock should not raise an exception here.
-		unlock_task.future.result()
+		unlock_task.future.cancelled() or unlock_task.future.result()
 		if returncode is not None:
 			self.returncode = returncode
 			self._async_wait()


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-06-06  4:32 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-06-06  4:32 UTC (permalink / raw
  To: gentoo-commits

commit:     1fc628eead43fa5da4b142479aa004ded8acceab
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  6 04:26:40 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 04:26:40 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1fc628ee

AbstractEbuildProcess: handle SIGINT during dir lock (bug 657436)

When the build dir lock is interrupted by SIGINT/TERM, avoid raising
an unwanted CancelledError.

Bug: https://bugs.gentoo.org/657436

 pym/_emerge/AbstractEbuildProcess.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index af6429a00..bda0bd83f 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -171,6 +171,13 @@ class AbstractEbuildProcess(SpawnProcess):
 			if lock_future is not self._start_future:
 				raise AssertionError('lock_future is not self._start_future')
 			self._start_future = None
+			if lock_future.cancelled():
+				self._build_dir = None
+				self.cancelled = True
+				self._was_cancelled()
+				self._async_wait()
+				return
+
 			lock_future.result()
 
 		if start_ipc_daemon:


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-06-23 22:15 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-06-23 22:15 UTC (permalink / raw
  To: gentoo-commits

commit:     a9a62e57194ccefce1ecabb9df761993f35f53be
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 22:03:35 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 22:15:13 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a9a62e57

SpawnProcess._unregister: cancel PipeLogger (bug 658806)

If the PipeLogger has not closed itself before the _unregister
method has been called, then it must be cancelled so that it
will close the log immediately. This fixes the case reported
in bug 658806, where an unclosed PipeLogger instance left the
log file with a temporarily incomplete gzip stream.

Bug: https://bugs.gentoo.org/658806

 pym/_emerge/SpawnProcess.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index f592c543d..cd535d143 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -176,6 +176,9 @@ class SpawnProcess(SubProcess):
 		if self.cgroup is not None:
 			self._cgroup_cleanup()
 			self.cgroup = None
+		if self._pipe_logger is not None:
+			self._pipe_logger.cancel()
+			self._pipe_logger = None
 
 	def _cancel(self):
 		SubProcess._cancel(self)


^ permalink raw reply related	[flat|nested] 804+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-06-29  4:29 Zac Medico
  0 siblings, 0 replies; 804+ messages in thread
From: Zac Medico @ 2018-06-29  4:29 UTC (permalink / raw
  To: gentoo-commits

commit:     ede0c6a09e48cc1a542f50462e873cb2f945a584
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 29 04:25:14 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 29 04:28:03 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ede0c6a0

depgraph._show_unsatisfied_blockers: AttributeError unevaluated_atom (bug 659564)

Only attempt to access the unevaluated_atom attribute for
package atoms, since soname atoms do not have this attribute.

Bug: https://bugs.gentoo.org/659564

 pym/_emerge/depgraph.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 429d8871c..42857c1a5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -8422,7 +8422,7 @@ class depgraph(object):
 					else:
 						# Display the specific atom from SetArg or
 						# Package types.
-						if atom != atom.unevaluated_atom:
+						if atom.package and atom != atom.unevaluated_atom:
 							# Show the unevaluated atom, since it can reveal
 							# issues with conditional use-flags missing
 							# from IUSE.


^ permalink raw reply related	[flat|nested] 804+ messages in thread

end of thread, other threads:[~2018-06-29  4:29 UTC | newest]

Thread overview: 804+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 22:37 [gentoo-commits] proj/portage:master commit in: pym/_emerge/ Arfrever Frehtes Taifersar Arahesis
  -- strict thread matches above, loose matches on Subject: below --
2018-06-29  4:29 Zac Medico
2018-06-23 22:15 Zac Medico
2018-06-06  4:32 Zac Medico
2018-06-06  3:22 Zac Medico
2018-06-05 20:49 Zac Medico
2018-05-31  8:44 Zac Medico
2018-05-27  4:49 Zac Medico
2018-05-27  4:26 Zac Medico
2018-05-27  4:10 Zac Medico
2018-05-13  5:04 Zac Medico
2018-05-04 17:00 Zac Medico
2018-05-01 16:26 Zac Medico
2018-04-30 19:28 Zac Medico
2018-04-30  6:29 Zac Medico
2018-04-30  6:29 Zac Medico
2018-04-30  6:29 Zac Medico
2018-04-30  6:29 Zac Medico
2018-04-29 22:24 Zac Medico
2018-04-29 22:24 Zac Medico
2018-04-29 21:29 Zac Medico
2018-04-29 21:29 Zac Medico
2018-04-29 21:29 Zac Medico
2018-04-29 21:29 Zac Medico
2018-04-29 21:29 Zac Medico
2018-04-29 21:29 Zac Medico
2018-04-29  4:38 Zac Medico
2018-04-29  4:02 Zac Medico
2018-04-29  3:55 Zac Medico
2018-04-29  3:47 Zac Medico
2018-04-29  2:11 Zac Medico
2018-04-29  0:49 Zac Medico
2018-04-29  0:26 Zac Medico
2018-04-28 23:52 Zac Medico
2018-04-28 23:41 Zac Medico
2018-04-28 22:26 Zac Medico
2018-04-28 20:19 Zac Medico
2018-04-27 20:56 Ulrich Müller
2018-04-26  8:46 Zac Medico
2018-04-26  8:06 Zac Medico
2018-04-26  8:06 Zac Medico
2018-04-26  7:12 Zac Medico
2018-04-26  6:20 Zac Medico
2018-04-24 19:43 Zac Medico
2018-04-24  7:42 Zac Medico
2018-04-24  6:57 Zac Medico
2018-04-23 19:48 Zac Medico
2018-04-23 19:48 Zac Medico
2018-04-23 18:58 Zac Medico
2018-04-23 18:52 Zac Medico
2018-04-23 18:52 Zac Medico
2018-04-23 18:52 Zac Medico
2018-04-23 18:52 Zac Medico
2018-04-23  2:41 Zac Medico
2018-04-22 21:52 Zac Medico
2018-04-22 21:52 Zac Medico
2018-04-22 21:52 Zac Medico
2018-04-22 21:52 Zac Medico
2018-04-22 21:52 Zac Medico
2018-04-22 18:26 Zac Medico
2018-04-22  0:56 Zac Medico
2018-04-21 20:17 Zac Medico
2018-04-21 18:43 Zac Medico
2018-04-20 16:18 Zac Medico
2018-04-20 16:18 Zac Medico
2018-04-20 16:18 Zac Medico
2018-04-20 16:18 Zac Medico
2018-04-20 16:18 Zac Medico
2018-04-20 15:45 Zac Medico
2018-03-30  3:50 Zac Medico
2018-03-28 15:24 Zac Medico
2018-03-28  9:25 Zac Medico
2018-03-21 19:25 Zac Medico
2018-03-21 19:08 Zac Medico
2018-03-21 19:05 Zac Medico
2018-02-19 19:20 Zac Medico
2018-01-26 14:59 Michał Górny
2018-01-07 11:56 Zac Medico
2018-01-05 20:36 Zac Medico
2017-12-10  8:42 Zac Medico
2017-10-04  7:09 Zac Medico
2017-10-04  1:34 Zac Medico
2017-09-29 17:24 Zac Medico
2017-09-25  2:57 Zac Medico
2017-09-25  2:04 Zac Medico
2017-07-09 17:20 Zac Medico
2017-05-30  7:22 Zac Medico
2017-04-20 19:39 Zac Medico
2017-04-20 19:39 Zac Medico
2017-04-12 16:46 Zac Medico
2017-04-04  3:20 Zac Medico
2017-03-31 20:24 Zac Medico
2017-03-27 21:41 Zac Medico
2017-03-23 21:43 Zac Medico
2017-03-16 23:25 Zac Medico
2017-02-21  1:33 Zac Medico
2017-01-26  4:19 Mike Gilbert
2017-01-18 23:05 Zac Medico
2016-12-29  9:13 Zac Medico
2016-12-05  5:14 Brian Dolbec
2016-12-05  5:10 Zac Medico
2016-08-22 16:09 Zac Medico
2016-05-18 16:33 Zac Medico
2016-03-29  8:39 Alexander Berntsen
2016-02-02  1:40 Zac Medico
2016-02-02  1:33 Zac Medico
2016-01-29 23:04 Brian Dolbec
2016-01-28 11:54 Alexander Berntsen
2016-01-29 11:17 ` Alexander Berntsen
2016-01-22 16:04 Zac Medico
2015-12-16 17:09 Zac Medico
2015-12-13 23:39 Zac Medico
2015-12-09 16:51 Zac Medico
2015-11-25 12:43 Arfrever Frehtes Taifersar Arahesis
2015-11-23 16:31 Zac Medico
2015-11-23 16:28 Zac Medico
2015-11-13 21:53 Arfrever Frehtes Taifersar Arahesis
2015-10-13 16:14 Zac Medico
2015-10-08  0:01 Brian Dolbec
2015-10-08  0:01 Brian Dolbec
2015-09-03 18:03 Mike Frysinger
2015-08-06  6:31 Zac Medico
2015-08-02  0:42 Zac Medico
2015-07-15 19:28 Zac Medico
2015-07-14 18:06 Zac Medico
2015-07-07 18:38 Zac Medico
2015-06-17  6:55 Zac Medico
2015-05-13  1:22 Zac Medico
2015-04-28 23:52 Zac Medico
2015-03-03 21:28 git@oystercatcher mirror+tproxy
2015-03-03 21:28 Zac Medico
2015-02-26 18:25 Mike Frysinger
2015-02-25  8:34 Zac Medico
2015-02-14 19:14 Zac Medico
2015-02-13 18:43 Alexander Berntsen
2015-02-13 18:43 Alexander Berntsen
2015-02-01 15:35 Michał Górny
2015-01-18 18:49 Zac Medico
2015-01-05 19:55 Zac Medico
2015-01-05 19:36 Zac Medico
2014-12-21 23:11 Arfrever Frehtes Taifersar Arahesis
2014-12-15 16:28 Arfrever Frehtes Taifersar Arahesis
2014-12-15  3:37 Zac Medico
2014-12-13 14:51 Arfrever Frehtes Taifersar Arahesis
2014-12-13  7:04 Arfrever Frehtes Taifersar Arahesis
2014-12-11  8:42 Zac Medico
2014-12-07 23:14 Zac Medico
2014-12-07 23:14 Zac Medico
2014-11-30 19:49 Arfrever Frehtes Taifersar Arahesis
2014-11-29 18:48 Zac Medico
2014-11-29 18:06 Zac Medico
2014-11-29 17:55 Zac Medico
2014-11-24  8:13 Zac Medico
2014-11-24  8:13 Zac Medico
2014-09-24 22:36 Brian Dolbec
2014-09-24 16:20 Zac Medico
2014-09-15  5:00 Brian Dolbec
2014-09-15  5:00 Brian Dolbec
2014-09-13  5:55 Brian Dolbec
2014-09-01 17:03 Zac Medico
2014-08-19  7:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-12 18:27 Michał Górny
2014-08-19  7:01 ` Michał Górny
2014-08-11 20:26 Alexander Berntsen
2014-08-10  0:10 Brian Dolbec
2014-08-04  1:55 Brian Dolbec
2014-08-03 15:24 [gentoo-commits] proj/portage:v2.2.11 " Brian Dolbec
2014-08-03 15:22 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2014-06-14 20:58 Alexander Berntsen
2014-06-14  2:58 Zac Medico
2014-06-08 11:06 Sebastian Luther
2014-05-18  8:02 Arfrever Frehtes Taifersar Arahesis
2014-04-19  5:44 Brian Dolbec
2014-04-18 19:50 Zac Medico
2014-04-05 13:05 Alexander Berntsen
2014-04-04 23:01 Brian Dolbec
2014-04-04 23:01 Brian Dolbec
2014-03-24 18:28 Sebastian Luther
2014-03-24 18:28 Sebastian Luther
2014-03-23 16:31 Alexander Berntsen
2014-03-02  3:15 Brian Dolbec
2014-03-02  3:15 Brian Dolbec
2014-02-17 20:35 Sebastian Luther
2014-02-05 19:42 Sebastian Luther
2014-02-05 19:42 Sebastian Luther
2014-02-05 19:42 Sebastian Luther
2014-01-27  0:14 Brian Dolbec
2014-01-26  7:31 Arfrever Frehtes Taifersar Arahesis
2013-12-05 15:38 Brian Dolbec
2013-12-02  1:23 Brian Dolbec
2013-12-01 10:19 Brian Dolbec
2013-11-29 23:24 Mike Frysinger
2013-11-28  9:20 Arfrever Frehtes Taifersar Arahesis
2013-11-28  3:06 Arfrever Frehtes Taifersar Arahesis
2013-11-27  3:24 Mike Frysinger
2013-11-26 13:50 Brian Dolbec
2013-11-26 13:50 Brian Dolbec
2013-09-18 18:29 Zac Medico
2013-09-09 16:57 Zac Medico
2013-09-09 16:53 Zac Medico
2013-09-04 19:00 Zac Medico
2013-09-02 19:49 Zac Medico
2013-09-02  0:27 Zac Medico
2013-08-24 16:17 Zac Medico
2013-08-24 16:12 Zac Medico
2013-08-24 16:10 Zac Medico
2013-08-24 16:07 Zac Medico
2013-08-22  3:30 Zac Medico
2013-08-19  9:38 Zac Medico
2013-08-04 20:21 Zac Medico
2013-08-02  9:49 Zac Medico
2013-08-02  8:54 Zac Medico
2013-07-30  5:41 Zac Medico
2013-07-28 23:04 Zac Medico
2013-07-23 20:16 Zac Medico
2013-07-23 19:44 Zac Medico
2013-07-23 19:14 Zac Medico
2013-07-09 21:20 Zac Medico
2013-07-09 20:52 Zac Medico
2013-07-09 19:22 Zac Medico
2013-07-06 21:52 Zac Medico
2013-07-05  5:34 Zac Medico
2013-06-19 21:07 Zac Medico
2013-06-19 20:05 Zac Medico
2013-06-18 15:48 Zac Medico
2013-06-18 14:59 Zac Medico
2013-06-17  5:59 Zac Medico
2013-06-16  1:22 Zac Medico
2013-06-15 23:33 Zac Medico
2013-06-15  0:12 Zac Medico
2013-06-13 18:54 Zac Medico
2013-06-10  4:01 Zac Medico
2013-06-10  3:50 Zac Medico
2013-06-09  1:17 Zac Medico
2013-06-08 20:48 Zac Medico
2013-06-08 11:47 Zac Medico
2013-05-31 23:52 Zac Medico
2013-05-31 23:24 Zac Medico
2013-05-31 22:43 Zac Medico
2013-05-24 18:12 Zac Medico
2013-05-19 17:25 Zac Medico
2013-05-18 18:18 Zac Medico
2013-05-18 12:29 Zac Medico
2013-05-18 12:20 Zac Medico
2013-04-22 16:35 Zac Medico
2013-04-11 23:14 Zac Medico
2013-04-02 19:29 Zac Medico
2013-03-27  5:51 Zac Medico
2013-03-27  5:19 Zac Medico
2013-03-23 23:00 Zac Medico
2013-03-23 22:03 Zac Medico
2013-03-19 21:38 Zac Medico
2013-03-19 20:22 Zac Medico
2013-03-19 18:47 Zac Medico
2013-03-19 18:37 Zac Medico
2013-03-18 10:21 Zac Medico
2013-03-13 15:19 Zac Medico
2013-03-13 15:10 Zac Medico
2013-03-13  5:10 Zac Medico
2013-03-05  1:39 Zac Medico
2013-03-05  1:21 Zac Medico
2013-03-05  1:07 Zac Medico
2013-03-02  2:55 Zac Medico
2013-03-02  0:58 Zac Medico
2013-02-21 14:29 Zac Medico
2013-02-18  4:50 Mike Frysinger
2013-02-14  3:40 Zac Medico
2013-02-14  0:46 Zac Medico
2013-02-13  4:44 Zac Medico
2013-02-12  3:25 Zac Medico
2013-02-11 23:57 Zac Medico
2013-02-11  2:25 Zac Medico
2013-02-09 18:00 Zac Medico
2013-02-08 16:29 Zac Medico
2013-01-24  1:32 Zac Medico
2013-01-24  0:44 Zac Medico
2013-01-15 22:42 Mike Frysinger
2013-01-15 14:46 Zac Medico
2013-01-15 14:25 Zac Medico
2013-01-10 11:11 Zac Medico
2013-01-09  1:29 Zac Medico
2013-01-09  1:06 Zac Medico
2013-01-08  2:10 Zac Medico
2013-01-06  9:14 Zac Medico
2013-01-06  8:44 Zac Medico
2013-01-04  6:30 Zac Medico
2013-01-04  0:02 Zac Medico
2013-01-03  2:54 Zac Medico
2013-01-02 10:48 Zac Medico
2013-01-02  7:32 Zac Medico
2013-01-02  7:29 Zac Medico
2013-01-02  6:04 Zac Medico
2013-01-02  4:48 Zac Medico
2013-01-02  2:54 Zac Medico
2013-01-01 22:39 Zac Medico
2013-01-01 11:09 Zac Medico
2012-12-31 23:52 Zac Medico
2012-12-31 22:24 Zac Medico
2012-12-31 22:12 Zac Medico
2012-12-31  1:05 Zac Medico
2012-12-24 22:13 Zac Medico
2012-12-18  7:10 Zac Medico
2012-12-18  7:04 Zac Medico
2012-12-10  2:07 Zac Medico
2012-12-10  0:56 Zac Medico
2012-12-08  1:49 Zac Medico
2012-12-04  6:01 Zac Medico
2012-12-02 22:17 Zac Medico
2012-11-30  9:12 Zac Medico
2012-11-30  6:24 Zac Medico
2012-11-27  6:02 Zac Medico
2012-11-27  3:45 Zac Medico
2012-11-24 22:08 Zac Medico
2012-11-24 21:14 Zac Medico
2012-11-22 22:16 Arfrever Frehtes Taifersar Arahesis
2012-11-16  4:47 Arfrever Frehtes Taifersar Arahesis
2012-11-11 17:58 Zac Medico
2012-10-26 17:46 Zac Medico
2012-10-26 17:13 Zac Medico
2012-10-19  1:28 Zac Medico
2012-10-18  2:35 Zac Medico
2012-10-18  2:11 Zac Medico
2012-10-18  0:11 Zac Medico
2012-10-17  3:37 Zac Medico
2012-10-16 23:16 Zac Medico
2012-10-16 22:16 Zac Medico
2012-10-16 15:55 Zac Medico
2012-10-16  8:34 Zac Medico
2012-10-15 15:42 Zac Medico
2012-10-15 15:02 Zac Medico
2012-10-15  2:59 Zac Medico
2012-10-13 20:06 Zac Medico
2012-10-10 21:13 Zac Medico
2012-10-07 16:59 Zac Medico
2012-10-06 22:01 Zac Medico
2012-10-06  4:00 Zac Medico
2012-10-03  2:43 Zac Medico
2012-09-26  3:31 Zac Medico
2012-09-16 20:02 Zac Medico
2012-09-12  6:48 Zac Medico
2012-09-10 16:41 Zac Medico
2012-09-09  1:07 Zac Medico
2012-09-09  0:54 Zac Medico
2012-09-04  3:28 Zac Medico
2012-09-04  3:07 Zac Medico
2012-08-28  3:20 Zac Medico
2012-08-22 21:12 Zac Medico
2012-08-21  3:29 Zac Medico
2012-08-20 20:38 Zac Medico
2012-07-18 17:19 Zac Medico
2012-07-10 22:50 Zac Medico
2012-07-03 21:52 Zac Medico
2012-06-24  8:18 Zac Medico
2012-06-23 20:03 Zac Medico
2012-06-23  6:38 Zac Medico
2012-06-23  5:10 Zac Medico
2012-06-23  3:01 Zac Medico
2012-06-23  2:47 Zac Medico
2012-06-23  2:35 Zac Medico
2012-06-23  1:23 Zac Medico
2012-06-22  7:18 Zac Medico
2012-06-21 22:17 Zac Medico
2012-06-21 21:58 Zac Medico
2012-06-20 23:01 Zac Medico
2012-06-20  4:55 Zac Medico
2012-06-19  0:40 Zac Medico
2012-06-17 19:48 Zac Medico
2012-06-17 19:45 Zac Medico
2012-06-17 17:52 Zac Medico
2012-06-17 16:16 Zac Medico
2012-06-17  4:58 Zac Medico
2012-06-17  3:22 Zac Medico
2012-06-17  3:06 Zac Medico
2012-06-16 20:27 Zac Medico
2012-06-16 20:24 Zac Medico
2012-06-04  1:19 Zac Medico
2012-06-04  0:36 Zac Medico
2012-05-30 20:25 Zac Medico
2012-05-14 18:48 Zac Medico
2012-05-14  6:28 Zac Medico
2012-05-13 22:35 Zac Medico
2012-05-13  7:32 Zac Medico
2012-05-09 20:32 Zac Medico
2012-05-09 18:11 Zac Medico
2012-05-03  1:32 Zac Medico
2012-04-21  1:02 Zac Medico
2012-04-16  7:17 Zac Medico
2012-04-13 19:30 Zac Medico
2012-04-05 21:37 Zac Medico
2012-04-05 18:53 Zac Medico
2012-04-05 18:23 Zac Medico
2012-04-05 18:09 Zac Medico
2012-04-03 17:57 Zac Medico
2012-03-27 18:57 Zac Medico
2012-03-27 15:34 Zac Medico
2012-03-26  3:54 Zac Medico
2012-03-26  3:49 Zac Medico
2012-03-25 21:48 Zac Medico
2012-03-21  7:18 Zac Medico
2012-03-19 17:07 Zac Medico
2012-03-19 16:29 Zac Medico
2012-03-09  6:35 Zac Medico
2012-03-09  5:08 Zac Medico
2012-03-09  2:54 Zac Medico
2012-02-29 15:49 Zac Medico
2012-02-26 10:00 Zac Medico
2012-02-24 21:55 Zac Medico
2012-02-20 11:05 Zac Medico
2012-02-20 11:01 Zac Medico
2012-02-17 22:31 Zac Medico
2012-02-17 10:05 Zac Medico
2012-02-16 21:00 Zac Medico
2012-02-16  5:14 Zac Medico
2012-02-16  0:25 Zac Medico
2012-02-15  3:01 Zac Medico
2012-02-15  1:17 Zac Medico
2012-02-14 23:51 Zac Medico
2012-02-14 23:26 Zac Medico
2012-02-13  6:44 Zac Medico
2012-02-12  6:17 Zac Medico
2012-02-12  5:36 Zac Medico
2012-02-12  4:09 Zac Medico
2012-02-12  0:05 Zac Medico
2012-02-11 23:02 Zac Medico
2012-02-11 22:17 Arfrever Frehtes Taifersar Arahesis
2012-02-11 20:05 Zac Medico
2012-02-11 19:48 Zac Medico
2012-02-11  3:19 Zac Medico
2012-02-11  2:10 Zac Medico
2012-02-10 21:58 Zac Medico
2012-02-10 19:48 Zac Medico
2012-02-09  9:13 Zac Medico
2012-02-09  8:21 Zac Medico
2012-02-09  6:23 Zac Medico
2012-02-09  4:04 Zac Medico
2012-02-09  2:10 Zac Medico
2012-02-09  1:58 Zac Medico
2012-02-09  1:50 Zac Medico
2012-02-09  0:33 Zac Medico
2012-02-08 23:44 Zac Medico
2012-02-08 21:20 Zac Medico
2012-02-08 20:24 Zac Medico
2012-02-08  6:09 Zac Medico
2012-02-08  6:09 Zac Medico
2012-02-08  5:17 Zac Medico
2012-02-08  5:17 Zac Medico
2012-02-08  5:17 Zac Medico
2012-02-08  4:35 Zac Medico
2012-02-08  4:25 Zac Medico
2012-02-08  3:59 Zac Medico
2012-02-08  3:34 Zac Medico
2012-02-08  3:34 Zac Medico
2012-02-08  2:14 Zac Medico
2012-02-08  2:14 Zac Medico
2012-02-07 23:24 Zac Medico
2012-02-07 23:04 Zac Medico
2012-02-07 23:04 Zac Medico
2012-02-07 23:04 Zac Medico
2012-02-07 23:04 Zac Medico
2012-01-20 20:29 Zac Medico
2012-01-15 18:00 Zac Medico
2012-01-12 16:59 Zac Medico
2012-01-12 16:33 Zac Medico
2011-12-24 10:23 Zac Medico
2011-12-23 18:07 Zac Medico
2011-12-23 10:15 Zac Medico
2011-12-22  0:44 Zac Medico
2011-12-19  0:13 Zac Medico
2011-12-17 19:33 Zac Medico
2011-12-16 19:56 Zac Medico
2011-12-16 19:32 Zac Medico
2011-12-16 19:18 Zac Medico
2011-12-16 18:58 Zac Medico
2011-12-14  7:31 Zac Medico
2011-12-14  6:30 Zac Medico
2011-12-13 20:01 Zac Medico
2011-12-13 18:35 Zac Medico
2011-12-13 17:27 Zac Medico
2011-12-11  7:49 Zac Medico
2011-12-10 21:37 Zac Medico
2011-12-10 21:13 Zac Medico
2011-12-10  7:08 Zac Medico
2011-12-10  4:00 Zac Medico
2011-12-10  3:55 Zac Medico
2011-12-10  3:31 Zac Medico
2011-12-10  3:03 Zac Medico
2011-12-09  3:21 Zac Medico
2011-12-06 18:53 Zac Medico
2011-12-04 23:56 Zac Medico
2011-12-04 23:43 Zac Medico
2011-12-02 18:30 Zac Medico
2011-12-02  6:14 Zac Medico
2011-12-02  2:34 Zac Medico
2011-12-02  1:44 Zac Medico
2011-12-01 21:22 Zac Medico
2011-12-01 21:05 Zac Medico
2011-11-27 20:53 Zac Medico
2011-11-20 18:54 Zac Medico
2011-11-18 19:40 Zac Medico
2011-11-17 23:10 Zac Medico
2011-11-17 13:39 Zac Medico
2011-11-17  5:15 Zac Medico
2011-11-17  3:43 Zac Medico
2011-11-17  2:09 Zac Medico
2011-11-17  1:39 Zac Medico
2011-11-17  1:25 Zac Medico
2011-11-16 18:44 Zac Medico
2011-11-16 18:26 Zac Medico
2011-11-09 18:13 Zac Medico
2011-11-09  3:23 Zac Medico
2011-11-07 21:15 Arfrever Frehtes Taifersar Arahesis
2011-11-07 20:13 Arfrever Frehtes Taifersar Arahesis
2011-11-07  6:32 Zac Medico
2011-11-07  6:02 Zac Medico
2011-10-30  6:21 Zac Medico
2011-10-29 22:45 Zac Medico
2011-10-29 21:41 Zac Medico
2011-10-29 21:31 Zac Medico
2011-10-29 20:55 Zac Medico
2011-10-29 17:51 Zac Medico
2011-10-29  6:57 Zac Medico
2011-10-29  3:10 Zac Medico
2011-10-27 16:46 Zac Medico
2011-10-25  6:18 Zac Medico
2011-10-23 18:53 Zac Medico
2011-10-20 16:30 Zac Medico
2011-10-16  0:34 Zac Medico
2011-10-15 23:28 Zac Medico
2011-10-15 22:56 Zac Medico
2011-10-15 22:46 Zac Medico
2011-10-15 19:34 Zac Medico
2011-10-10 19:33 Zac Medico
2011-10-10 18:21 Zac Medico
2011-10-10 18:20 Zac Medico
2011-10-10 18:13 Zac Medico
2011-10-10  0:16 Zac Medico
2011-10-10  0:05 Zac Medico
2011-10-02 20:22 Zac Medico
2011-09-30 17:04 Zac Medico
2011-09-29  1:42 Zac Medico
2011-09-29  1:11 Zac Medico
2011-09-28  5:26 Zac Medico
2011-09-23  4:04 Arfrever Frehtes Taifersar Arahesis
2011-09-22 15:45 Zac Medico
2011-09-22  3:06 Zac Medico
2011-09-22  3:06 Zac Medico
2011-09-22  1:59 Zac Medico
2011-09-21 14:11 Zac Medico
2011-09-19 15:54 Zac Medico
2011-09-19 14:37 Zac Medico
2011-09-18 21:57 Zac Medico
2011-09-11 17:31 Zac Medico
2011-09-10 21:51 Zac Medico
2011-09-10 14:31 Zac Medico
2011-09-10  3:22 Zac Medico
2011-09-09 19:58 Zac Medico
2011-09-05  0:59 Zac Medico
2011-09-03 23:33 Zac Medico
2011-09-02  0:24 Zac Medico
2011-08-31  2:32 Zac Medico
2011-08-29  6:49 Zac Medico
2011-08-27 20:17 Arfrever Frehtes Taifersar Arahesis
2011-08-25 22:11 Zac Medico
2011-08-16  5:38 Zac Medico
2011-08-14 23:50 Zac Medico
2011-08-11  3:27 Zac Medico
2011-08-09  6:03 Zac Medico
2011-08-03  5:11 Zac Medico
2011-08-01 22:57 Zac Medico
2011-08-01 11:21 Zac Medico
2011-07-25 20:55 Zac Medico
2011-07-21 16:59 Zac Medico
2011-07-19 20:24 Zac Medico
2011-07-19 19:53 Zac Medico
2011-07-18  8:25 Zac Medico
2011-07-17 18:16 Zac Medico
2011-07-17  4:38 Arfrever Frehtes Taifersar Arahesis
2011-07-17  0:33 Zac Medico
2011-07-17  0:10 Zac Medico
2011-07-17  0:05 Zac Medico
2011-07-16 23:30 Zac Medico
2011-07-16  7:30 Zac Medico
2011-07-16  6:16 Zac Medico
2011-07-12 22:04 Zac Medico
2011-07-12 21:51 Zac Medico
2011-07-12 19:27 Zac Medico
2011-07-12 19:16 Zac Medico
2011-07-11 21:59 Zac Medico
2011-07-11 17:18 Zac Medico
2011-07-11 15:35 Zac Medico
2011-07-11 14:12 Zac Medico
2011-07-10 12:23 Zac Medico
2011-07-10  3:25 Zac Medico
2011-07-09 20:13 Zac Medico
2011-07-08 16:17 Zac Medico
2011-07-08 10:09 Zac Medico
2011-07-03 11:09 Arfrever Frehtes Taifersar Arahesis
2011-06-30 13:11 Zac Medico
2011-06-27 19:34 Arfrever Frehtes Taifersar Arahesis
2011-06-27  6:54 Zac Medico
2011-06-17 22:01 Zac Medico
2011-06-16 15:37 Zac Medico
2011-06-13 21:51 Zac Medico
2011-06-13 13:02 Zac Medico
2011-06-11 19:11 Arfrever Frehtes Taifersar Arahesis
2011-06-11 16:27 Zac Medico
2011-06-11 15:52 Zac Medico
2011-06-11  9:06 Zac Medico
2011-06-11  6:26 Zac Medico
2011-06-11  5:23 Zac Medico
2011-06-11  3:59 Zac Medico
2011-06-11  2:58 Zac Medico
2011-06-11  2:45 Zac Medico
2011-06-11  0:43 Zac Medico
2011-06-10 23:30 Zac Medico
2011-06-09 18:19 Zac Medico
2011-06-09 16:21 Zac Medico
2011-06-09 16:09 Zac Medico
2011-06-09 13:14 Zac Medico
2011-06-09 12:57 Zac Medico
2011-06-08 20:24 Zac Medico
2011-06-08 17:31 Zac Medico
2011-06-08 17:06 Zac Medico
2011-06-06  2:24 Zac Medico
2011-06-05 16:34 Zac Medico
2011-06-05 15:12 Zac Medico
2011-06-04 23:32 Zac Medico
2011-06-04  3:49 Zac Medico
2011-06-04  2:38 Zac Medico
2011-06-04  2:31 Zac Medico
2011-06-04  2:13 Zac Medico
2011-06-03 23:04 Zac Medico
2011-06-03 22:38 Zac Medico
2011-06-03  3:52 Zac Medico
2011-06-03  3:31 Zac Medico
2011-05-27 23:17 Zac Medico
2011-05-27 22:56 Zac Medico
2011-05-27  3:29 Zac Medico
2011-05-27  1:23 Zac Medico
2011-05-27  0:36 Zac Medico
2011-05-26 22:15 Zac Medico
2011-05-26 13:02 Zac Medico
2011-05-26 12:22 Zac Medico
2011-05-26 12:22 Zac Medico
2011-05-26  6:41 Zac Medico
2011-05-26  1:08 Zac Medico
2011-05-26  0:31 Zac Medico
2011-05-25  6:33 Zac Medico
2011-05-25  6:26 Zac Medico
2011-05-25  3:58 Zac Medico
2011-05-25  3:11 Zac Medico
2011-05-25  2:53 Zac Medico
2011-05-25  0:45 Zac Medico
2011-05-25  0:30 Zac Medico
2011-05-24  5:55 Zac Medico
2011-05-23 22:12 Zac Medico
2011-05-23 21:21 Zac Medico
2011-05-22 21:22 Zac Medico
2011-05-22 18:54 Zac Medico
2011-05-22  0:48 Zac Medico
2011-05-21  8:40 Zac Medico
2011-05-20 22:01 Zac Medico
2011-05-20 21:58 Zac Medico
2011-05-20 20:40 Zac Medico
2011-05-20  6:32 Zac Medico
2011-05-20  6:24 Zac Medico
2011-05-20  4:53 Zac Medico
2011-05-18  4:37 Zac Medico
2011-05-18  4:01 Zac Medico
2011-05-18  2:16 Zac Medico
2011-05-18  1:50 Zac Medico
2011-05-18  1:31 Zac Medico
2011-05-18  0:55 Zac Medico
2011-05-17 21:32 Zac Medico
2011-05-17 19:44 Zac Medico
2011-05-17  7:10 Zac Medico
2011-05-17  6:55 Zac Medico
2011-05-17  6:29 Zac Medico
2011-05-17  6:11 Zac Medico
2011-05-16 19:31 Zac Medico
2011-05-16  7:21 Zac Medico
2011-05-16  7:10 Zac Medico
2011-05-16  6:55 Zac Medico
2011-05-16  6:18 Zac Medico
2011-05-15  9:02 Zac Medico
2011-05-15  8:14 Zac Medico
2011-05-15  8:03 Zac Medico
2011-05-15  5:21 Zac Medico
2011-05-14 21:01 Zac Medico
2011-05-11 23:49 Zac Medico
2011-05-11 20:24 Zac Medico
2011-05-11  4:07 Zac Medico
2011-05-10 23:53 Zac Medico
2011-05-10 23:53 Zac Medico
2011-05-10  5:11 Zac Medico
2011-05-10  1:03 Zac Medico
2011-05-09 22:34 Zac Medico
2011-05-09  6:28 Zac Medico
2011-05-09  6:09 Zac Medico
2011-05-08 19:05 Zac Medico
2011-05-08 18:27 Zac Medico
2011-05-08  6:25 Zac Medico
2011-05-08  5:58 Zac Medico
2011-05-08  4:53 Zac Medico
2011-05-07  3:28 Zac Medico
2011-05-05 17:20 Zac Medico
2011-05-05 15:56 Zac Medico
2011-05-04 21:42 Zac Medico
2011-05-04 18:19 Zac Medico
2011-05-04 17:24 Zac Medico
2011-05-02 20:00 Zac Medico
2011-05-02 19:35 Zac Medico
2011-05-02  3:10 Zac Medico
2011-05-02  1:44 Zac Medico
2011-05-01 23:28 Zac Medico
2011-05-01 21:17 Zac Medico
2011-05-01 20:23 Zac Medico
2011-04-30 20:41 Zac Medico
2011-04-29 16:08 Zac Medico
2011-04-29 15:04 Zac Medico
2011-04-28 21:07 Zac Medico
2011-04-28 13:00 Zac Medico
2011-04-27 22:58 Zac Medico
2011-04-27 16:14 Zac Medico
2011-04-27 14:36 Zac Medico
2011-04-27 14:06 Zac Medico
2011-04-26 23:58 Zac Medico
2011-04-26 20:50 Arfrever Frehtes Taifersar Arahesis
2011-04-26 20:27 Zac Medico
2011-04-11 19:01 Zac Medico
2011-04-10 20:06 Zac Medico
2011-04-10 20:04 Zac Medico
2011-03-30 18:38 Zac Medico
2011-03-26 17:25 Zac Medico
2011-03-26 16:13 Zac Medico
2011-03-26  8:53 Zac Medico
2011-03-26  7:06 Zac Medico
2011-03-26  3:38 Zac Medico
2011-03-25 16:53 Zac Medico
2011-03-25 16:00 Zac Medico
2011-03-25  1:17 Zac Medico
2011-03-24  4:09 Zac Medico
2011-03-21  0:16 Zac Medico
2011-03-20 15:58 Zac Medico
2011-03-18 23:45 Zac Medico
2011-03-18 21:38 Zac Medico
2011-03-18 21:11 Zac Medico
2011-03-17 21:40 Zac Medico
2011-03-17 20:08 Zac Medico
2011-03-17  5:36 Zac Medico
2011-03-17  4:57 Zac Medico
2011-03-17  4:51 Zac Medico
2011-03-17  3:47 Zac Medico
2011-03-17  1:43 Zac Medico
2011-03-17  1:19 Zac Medico
2011-03-17  0:36 Zac Medico
2011-03-12 18:39 Zac Medico
2011-03-11  6:02 Zac Medico
2011-03-11  6:02 Zac Medico
2011-03-11  3:30 Zac Medico
2011-03-10  5:55 Zac Medico
2011-03-09  3:29 Zac Medico
2011-03-09  2:54 Arfrever Frehtes Taifersar Arahesis
2011-03-02 16:40 Zac Medico
2011-03-01 21:53 Zac Medico
2011-02-28 18:01 Zac Medico
2011-02-25  6:30 Zac Medico
2011-02-25  6:00 Zac Medico
2011-02-22 17:31 Zac Medico
2011-02-22  3:16 Zac Medico
2011-02-22  3:00 Zac Medico
2011-02-22  2:40 Zac Medico
2011-02-22  2:09 Zac Medico
2011-02-22  0:37 Zac Medico
2011-02-20  9:44 Zac Medico
2011-02-20  9:41 Zac Medico
2011-02-18 16:45 Zac Medico
2011-02-18 16:17 Zac Medico
2011-02-18 16:00 Zac Medico
2011-02-18 15:19 Zac Medico
2011-02-18 12:05 Zac Medico
2011-02-17 10:33 Zac Medico
2011-02-14 17:01 Zac Medico
2011-02-14 16:44 Zac Medico
2011-02-14 16:33 Zac Medico
2011-02-14 15:30 Zac Medico
2011-02-14  7:22 Zac Medico
2011-02-14  7:17 Zac Medico
2011-02-14  6:45 Zac Medico
2011-02-14  6:06 Zac Medico
2011-02-14  5:51 Zac Medico
2011-02-14  5:01 Zac Medico
2011-02-14  3:29 Zac Medico
2011-02-13 11:14 Zac Medico
2011-02-13  9:13 Zac Medico
2011-02-12  6:10 Zac Medico
2011-02-11  8:59 Zac Medico
2011-02-08 19:40 Zac Medico
2011-02-05  7:33 Zac Medico
2011-02-05  3:21 Zac Medico
2011-02-04 17:43 zmedico
2011-02-04 15:46 zmedico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox