Move normalize_path into portage_util.
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Jul 2006 19:03:39 +0000 (19:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Jul 2006 19:03:39 +0000 (19:03 -0000)
svn path=/main/trunk/; revision=3891

pym/portage.py
pym/portage_util.py

index f833851bd0abf48e1db5d8324cba7b2b656293cc..68d12fbbef7f4e72116e4c170d6dbef8f2246212 100644 (file)
@@ -76,7 +76,8 @@ try:
        import portage_util
        from portage_util import atomic_ofstream, apply_secpass_permissions, apply_recursive_permissions, \
                dump_traceback, getconfig, grabdict, grabdict_package, grabfile, grabfile_package, \
-               map_dictlist_vals, pickle_read, pickle_write, stack_dictlist, stack_dicts, stack_lists, \
+               map_dictlist_vals, normalize_path, \
+               pickle_read, pickle_write, stack_dictlist, stack_dicts, stack_lists, \
                unique_array, varexpand, writedict, writemsg, writemsg_stdout, write_atomic
        import portage_exception
        import portage_gpg
@@ -187,13 +188,6 @@ def prefix_array(array,prefix,doblanks=1):
                        newarray.append(x)
        return newarray
 
-def normalize_path(mypath):
-       if mypath.startswith(os.path.sep):
-               # posixpath.normpath collapses 3 or more leading slashes to just 1.
-               return os.path.normpath(2*os.path.sep + mypath)
-       else:
-               return os.path.normpath(mypath)
-
 dircache = {}
 cacheHit=0
 cacheMiss=0
index 79babe05c5ac09c9dd6729599e9d9779240e3b3a..0449b614f22f47eef8f9a45920075c52f9aaf0bb 100644 (file)
@@ -30,6 +30,13 @@ def writemsg_stdout(mystr,noiselevel=0):
        """Prints messages stdout based on the noiselimit setting"""
        writemsg(mystr, noiselevel=noiselevel, fd=sys.stdout)
 
+def normalize_path(mypath):
+       if mypath.startswith(os.path.sep):
+               # posixpath.normpath collapses 3 or more leading slashes to just 1.
+               return os.path.normpath(2*os.path.sep + mypath)
+       else:
+               return os.path.normpath(mypath)
+
 def grabfile(myfilename, compat_level=0, recursive=0):
        """This function grabs the lines in a file, normalizes whitespace and returns lines in a list; if a line
        begins with a #, it is ignored, as are empty lines"""