Move dep_transform from the portage_dep module to portage_update.
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Jul 2006 08:41:13 +0000 (08:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Jul 2006 08:41:13 +0000 (08:41 -0000)
svn path=/main/trunk/; revision=3981

pym/portage.py
pym/portage_dep.py
pym/portage_update.py

index 84a66d39992dc359820a56f2fc93bfbf9f6e0d4b..5e2e653764da88239afafdd5623f3d26ca78a291 100644 (file)
@@ -55,7 +55,7 @@ try:
        import getbinpkg
        import portage_dep
        from portage_dep import dep_getcpv, dep_getkey, get_operator, \
-               dep_transform, isjustname, isspecific, isvalidatom
+               isjustname, isspecific, isvalidatom
 
        # XXX: This needs to get cleaned up.
        import output
@@ -91,8 +91,8 @@ try:
        from portage_checksum import perform_md5,perform_checksum,prelink_capable
        import eclass_cache
        from portage_localization import _
-       from portage_update import fixdbentries, grab_updates, parse_updates, \
-               update_config_files, update_dbentries
+       from portage_update import dep_transform, fixdbentries, grab_updates, \
+               parse_updates, update_config_files, update_dbentries
 
        # Need these functions directly in portage namespace to not break every external tool in existence
        from portage_versions import ververify,vercmp,catsplit,catpkgsplit,pkgsplit,pkgcmp
index 72c6c4257d1c963ccf842ff1c43d12afe88aeab0..619caccb7903790d138d534967aa05f030906475 100644 (file)
@@ -259,25 +259,3 @@ def dep_getkey(mydep):
                return mysplit[0] + "/" + mysplit[1]
        else:
                return mydep
-
-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
index 40f05f795e482dd17ae6544b3a959f9048b4de39..ff09048b13f6adc1d8b787d1b98100ac06185178 100644 (file)
@@ -7,7 +7,7 @@ import errno, os, re, sys
 from portage_util import ConfigProtect, grabfile, new_protect_filename, \
        normalize_path, write_atomic, writemsg
 from portage_exception import DirectoryNotFound, PortageException
-from portage_dep import dep_getkey, dep_transform, isvalidatom, isjustname
+from portage_dep import dep_getkey, isvalidatom, isjustname
 from portage_const import USER_CONFIG_PATH, WORLD_FILE
 
 ignored_dbentries = ("CONTENTS", "environment.bz2")
@@ -196,3 +196,25 @@ def update_config_files(config_root, protect, protect_mask, update_iter):
                        writemsg("!!! An error occured while updating a config file:" + \
                                " '%s'\n" % updating_file, noiselevel=-1)
                        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