This patch prevents the offending self-block in the first place: " !cat/pkg " is not replaced. --- /usr/lib/portage/pym/portage/update.py 2012-10-13 18:39:58.103791174 +0100 +++ update.py 2012-11-07 22:04:23.202408168 +0100 @@ -45,7 +45,10 @@ # EAPI (characters allowed in package names may vary). if old_value in mycontent and isvalidatom(new_value, eapi=eapi): old_value = re.escape(old_value); - mycontent = re.sub(old_value+"(:|$|\\s)", new_value+"\\1", mycontent) + # move slotted + mycontent = re.sub(old_value + ":", new_value + ":", mycontent) + # move plain category/package (keep self-blocks in mind #367215) + mycontent = re.sub("(^|[^!])" + old_value + "($|\\s)", "\\1" + new_value + "\\2", mycontent) def myreplace(matchobj): # Strip slot and * operator if necessary # so that ververify works. @@ -55,7 +58,9 @@ return "%s-%s" % (new_value, matchobj.group(2)) else: return "".join(matchobj.groups()) + # move with version specification mycontent = re.sub("(%s-)(\\S*)" % old_value, myreplace, mycontent) + elif update_cmd[0] == "slotmove" and update_cmd[1].operator is None: pkg, origslot, newslot = update_cmd[1:] old_value = "%s:%s" % (pkg, origslot)