aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-11-14 17:28:16 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-11-14 17:28:16 (GMT)
commitcae023ad64e403dd4246eab558bbffa9f611b724 (patch)
tree61cd1fc4fcc1bf8ac1394ac9f362a090d6d71608
parentPass settings to _pkg_str constructor. (diff)
downloadportage-cae023ad64e403dd4246eab558bbffa9f611b724.zip
portage-cae023ad64e403dd4246eab558bbffa9f611b724.tar.gz
portage-cae023ad64e403dd4246eab558bbffa9f611b724.tar.bz2
update_dbentry: avoid self-blocker, bug #367215
-rw-r--r--pym/portage/update.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/pym/portage/update.py b/pym/portage/update.py
index 9d29585..61cb8b6 100644
--- a/pym/portage/update.py
+++ b/pym/portage/update.py
@@ -20,6 +20,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
)
from portage.const import USER_CONFIG_PATH
+from portage.dep import match_from_list
from portage.eapi import _get_eapi_attrs
from portage.exception import DirectoryNotFound, InvalidAtom, PortageException
from portage.localization import _
@@ -57,7 +58,16 @@ def update_dbentry(update_cmd, mycontent, eapi=None, parent=None):
if atom.cp != old_value:
continue
- split_content[i] = token.replace(old_value, new_value, 1)
+ new_atom = Atom(token.replace(old_value, new_value, 1),
+ eapi=eapi)
+
+ # Avoid creating self-blockers for bug #367215.
+ if new_atom.blocker and parent is not None and \
+ parent.cp == new_atom.cp and \
+ match_from_list(new_atom, [parent]):
+ continue
+
+ split_content[i] = _unicode(new_atom)
modified = True
if modified: