summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-08-22 20:58:45 +0000
committerZac Medico <zmedico@gentoo.org>2007-08-22 20:58:45 +0000
commitfc1de7ddfac3dbd3ccb052d2b83b94a47a892d2b (patch)
tree9da2c22cfbf4790b59c40243bf42f1ff5812770d
parent81f57e52f497411a562f593a5259f6d2b5010011 (diff)
downloadportage-fc1de7ddfac3dbd3ccb052d2b83b94a47a892d2b.tar.gz
portage-fc1de7ddfac3dbd3ccb052d2b83b94a47a892d2b.tar.bz2
portage-fc1de7ddfac3dbd3ccb052d2b83b94a47a892d2b.zip
Fix update_dbentry() to process version components properly before passing them into ververify().
svn path=/main/trunk/; revision=7665
-rw-r--r--pym/portage/update.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/portage/update.py b/pym/portage/update.py
index 5c53f57bc..8d6df0143 100644
--- a/pym/portage/update.py
+++ b/pym/portage/update.py
@@ -8,7 +8,8 @@ from portage.util import ConfigProtect, grabfile, new_protect_filename, \
normalize_path, write_atomic, writemsg
from portage.exception import DirectoryNotFound, PortageException
from portage.versions import ververify
-from portage.dep import dep_getkey, get_operator, isvalidatom, isjustname
+from portage.dep import dep_getkey, get_operator, isvalidatom, isjustname, \
+ remove_slot
from portage.const import USER_CONFIG_PATH, WORLD_FILE
ignored_dbentries = ("CONTENTS", "environment.bz2")
@@ -20,7 +21,11 @@ def update_dbentry(update_cmd, mycontent):
old_value = re.escape(old_value);
mycontent = re.sub(old_value+"(:|$|\\s)", new_value+"\\1", mycontent)
def myreplace(matchobj):
- if ververify(matchobj.group(2)):
+ # Strip slot and * operator if necessary
+ # so that ververify works.
+ ver = remove_slot(matchobj.group(2))
+ ver = ver.rstrip("*")
+ if ververify(ver):
return "%s-%s" % (new_value, matchobj.group(2))
else:
return "".join(matchobj.groups())