Remove the portage_file module for bug #133591.
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Jul 2006 19:09:11 +0000 (19:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Jul 2006 19:09:11 +0000 (19:09 -0000)
svn path=/main/trunk/; revision=3892

pym/eclass_cache.py
pym/portage_file.py [deleted file]
pym/portage_locks.py

index 0661626111ae6216e2ecddf12db51d70c77e3e05..1847cbf765c51c6de8ff43bda8db67d6517f0752 100644 (file)
@@ -1,10 +1,9 @@
 # Copyright: 2005 Gentoo Foundation
 # Author(s): Nicholas Carpaski (carpaski@gentoo.org), Brian Harring (ferringb@gentoo.org)
 # License: GPL2
-# $Id:$
+# $Id$
 
-from portage_util import writemsg
-import portage_file
+from portage_util import normalize_path, writemsg
 import os, sys
 from portage_data import portage_gid
 
@@ -20,7 +19,7 @@ class cache:
                # screw with the porttree ordering, w/out having bash inherit match it, and I'll hurt you.
                # ~harring
                self.porttrees = [self.porttree_root]+overlays
-               self.porttrees = tuple(map(portage_file.normpath, self.porttrees))
+               self.porttrees = tuple(map(normalize_path, self.porttrees))
                self._master_eclass_root = os.path.join(self.porttrees[0],"eclass")
                self.update_eclasses()
 
@@ -40,7 +39,7 @@ class cache:
        def update_eclasses(self):
                self.eclasses = {}
                eclass_len = len(".eclass")
-               for x in [portage_file.normpath(os.path.join(y,"eclass")) for y in self.porttrees]:
+               for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]:
                        if not os.path.isdir(x):
                                continue
                        for y in [y for y in os.listdir(x) if y.endswith(".eclass")]:
diff --git a/pym/portage_file.py b/pym/portage_file.py
deleted file mode 100644 (file)
index 711ba09..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# portage_data.py -- Calculated/Discovered Data Values
-# Copyright 1998-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-
-import os
-import portage_data
-import portage_exception
-from portage_localization import _
-
-def normpath(mypath):
-       newpath = os.path.normpath(mypath)
-       if len(newpath) > 1:
-               if newpath[:2] == "//":
-                       newpath = newpath[1:]
-       return newpath
-                                                               
-
-def makedirs(path, perms=0755, uid=None, gid=None, must_chown=False):
-       old_umask = os.umask(0)
-       if(uid is None):
-               uid = portage_data.portage_uid
-       if(gid is None):
-               gid = portage_data.portage_gid
-       if not path:
-               raise portage_exception.InvalidParameter, _("Invalid path: type: '%(type)s' value: '%(path)s'") % {"path": path, "type": type(path)}
-       if(perm > 1535) or (perm == 0):
-               raise portage_exception.InvalidParameter, _("Invalid permissions passed. Value is octal and no higher than 02777.")
-
-       mypath = normpath(path)
-       dirs = string.split(path, "/")
-       
-       mypath = ""
-       if dirs and dirs[0] == "":
-               mypath = "/"
-               dirs = dirs[1:]
-       for x in dirs:
-               mypath += x+"/"
-               if not os.path.exists(mypath):
-                       os.mkdir(mypath, perm)
-                       try:
-                               os.chown(mypath, uid, gid)
-                       except SystemExit, e:
-                               raise
-                       except:
-                               if must_chown:
-                                       os.umask(old_umask)
-                                       raise
-                               portage_util.writemsg(_("Failed to chown: %(path)s to %(uid)s:%(gid)s\n") % {"path":mypath,"uid":uid,"gid":gid})
-
-       os.umask(old_umask)
-       
-       
-       
-       
-       
-       
-       
-       
-       
-       
index 027399a023a473bc1697578ac13b887b48e21cfa..4a61f6312e9ff9797378ea757c4ee223703ba175 100644 (file)
@@ -11,7 +11,6 @@ import string
 import time
 import types
 import portage_exception
-import portage_file
 import portage_util
 import portage_data
 from portage_exec import atexit_register
@@ -24,7 +23,7 @@ def clean_my_hardlocks():
        for x in hardlock_path_list:
                hardlock_cleanup(x)
 def add_hardlock_file_to_cleanup(path):
-       mypath = portage_file.normpath(path)
+       mypath = portage_util.normalize_path(path)
        if os.path.isfile(mypath):
                mypath = os.path.dirname(mypath)
        if os.path.isdir(mypath):