Just use a simple replace for the needlessly complex dep_transform function. This...
authorZac Medico <zmedico@gentoo.org>
Thu, 5 Oct 2006 09:03:28 +0000 (09:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 5 Oct 2006 09:03:28 +0000 (09:03 -0000)
svn path=/main/trunk/; revision=4596

pym/portage_update.py

index 671e9bc139867b87f9a389dc8a7bc580ca35ac05..b6a724560b9a93db66f39d658d52f22a1d9dff14 100644 (file)
@@ -203,23 +203,4 @@ def update_config_files(config_root, protect, protect_mask, update_iter):
                        continue
 
 def dep_transform(mydep, oldkey, newkey):
-       origdep = mydep
-       if not len(mydep):
-               return mydep
-       if mydep[0] == "*":
-               mydep = mydep[1:]
-       prefix = ""
-       postfix = ""
-       if mydep[-1] == "*":
-               mydep = mydep[:-1]
-               postfix = "*"
-       if mydep[:2] in [">=", "<="]:
-               prefix = mydep[:2]
-               mydep = mydep[2:]
-       elif mydep[:1] in "=<>~!":
-               prefix = mydep[:1]
-               mydep = mydep[1:]
-       if mydep == oldkey:
-               return prefix + newkey + postfix
-       else:
-               return origdep
+       return mydep.replace(oldkey, newkey, 1)