summaryrefslogtreecommitdiffstats
path: root/pym/portage/update.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-07-17 16:52:48 -0700
committerZac Medico <zmedico@gentoo.org>2012-07-17 16:52:48 -0700
commit2df06cb95c1f97a470034bf2be73869256633685 (patch)
treed8f14ef8c5aa81e8def6ac7de87da73fac3ce75a /pym/portage/update.py
parent9ea1eb84c6c2cd91e31196471ec8ad4339988611 (diff)
downloadportage-2df06cb95c1f97a470034bf2be73869256633685.tar.gz
portage-2df06cb95c1f97a470034bf2be73869256633685.tar.bz2
portage-2df06cb95c1f97a470034bf2be73869256633685.zip
move: respect EAPI wrt dots_in_PN, bug #426476
Diffstat (limited to 'pym/portage/update.py')
-rw-r--r--pym/portage/update.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/pym/portage/update.py b/pym/portage/update.py
index a66c60b9a..c9c2af999 100644
--- a/pym/portage/update.py
+++ b/pym/portage/update.py
@@ -18,7 +18,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.util:ConfigProtect,new_protect_filename,' + \
'normalize_path,write_atomic,writemsg',
'portage.util.listdir:_ignorecvs_dirs',
- 'portage.versions:ververify'
+ 'portage.versions:catsplit,ververify'
)
from portage.const import USER_CONFIG_PATH
@@ -29,14 +29,20 @@ from portage.localization import _
if sys.hexversion >= 0x3000000:
long = int
+ _unicode = str
+else:
+ _unicode = unicode
ignored_dbentries = ("CONTENTS", "environment.bz2")
def update_dbentry(update_cmd, mycontent, eapi=None):
+ eapi_attrs = _get_eapi_attrs(eapi)
if update_cmd[0] == "move":
- old_value = str(update_cmd[1])
- if old_value in mycontent:
- new_value = str(update_cmd[2])
+ avoid_dots_in_PN = (not eapi_attrs.dots_in_PN and
+ "." in catsplit(update_cmd[2].cp)[1])
+ if not avoid_dots_in_PN and _unicode(update_cmd[1]) in mycontent:
+ old_value = _unicode(update_cmd[1])
+ new_value = _unicode(update_cmd[2])
old_value = re.escape(old_value);
mycontent = re.sub(old_value+"(:|$|\\s)", new_value+"\\1", mycontent)
def myreplace(matchobj):