Merged from trunk 6239:6242
authorFabian Groffen <grobian@gentoo.org>
Sun, 18 Mar 2007 11:08:11 +0000 (11:08 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 18 Mar 2007 11:08:11 +0000 (11:08 -0000)
make sure we prefix all arguments with $D, including ones that dont
start with a / (SpankMan)

Use locals() instead of setattr to insert generated functions into the
current module.  Thanks to Brian Harring for the suggestion.

Never use listdir with both recursion=True and followSymlinks=True since
it circular symlinks will lead to endless recursion loops.  Thanks to
Tobias Hahn <tobhahn@web.de> for this patch.

svn path=/main/branches/prefix/; revision=6243

bin/dodir
bin/fowners
bin/fperms
pym/portage/dbapi/vartree.py
pym/portage/output.py
pym/portage/tests/bin/setup_env.py

index 306b53e3df2f89d8255bae9985225e617ed70db4..4c335d57ef205e336b9d9e777734e838ea34aafb 100755 (executable)
--- a/bin/dodir
+++ b/bin/dodir
@@ -1,7 +1,6 @@
 #!@BASH@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $
+# $Id$
 
-slash=/
-exec install -d ${DIROPTIONS} "${@/#${slash}/${ED}${slash}}"
+exec install -d ${DIROPTIONS} "${@/#/${ED}/}"
index 1ebdce4500453a745e3c892f5728e303cc56de6f..d2b493478d51992aa0efe1ac8fa0552a7f0cba98 100755 (executable)
@@ -1,7 +1,6 @@
 #!@BASH@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id: fowners 1912 2005-08-25 03:54:42Z ferringb $
+# $Id$
 
-slash=/
-exec chown "${@/#${slash}/${ED}${slash}}"
+exec chown "${@/#/${ED}/}"
index cccd218b3d4d561bddb9ac7d444365f5002123fc..ff77e68fca3ffe666476cb1b7149c858ccbc87e2 100755 (executable)
@@ -1,7 +1,6 @@
 #!@BASH@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id: fperms 1912 2005-08-25 03:54:42Z ferringb $
+# $Id$
 
-slash=/
-exec chmod "${@/#${slash}/${ED}${slash}}"
+exec chmod "${@/#/${ED}/}"
index e37f1e6a4a8e69cfa90072cbedb77eacad65634a..75050ae4dbd56b738f5cfe529a7315b1a66f164a 100644 (file)
@@ -1423,14 +1423,14 @@ class dblink(object):
 
                # Preserve old libs if they are still in use
                if slot_matches and "preserve-libs" in self.settings.features:
-                       myfilelist = listdir(srcroot, recursive=1, filesonly=1, followSymlinks=True)
+                       myfilelist = listdir(srcroot, recursive=1, filesonly=1, followSymlinks=False)
                        mylinklist = filter(os.path.islink, listdir(srcroot, recursive=1, filesonly=0, followSymlinks=False))
                        self._preserve_libs(srcroot, destroot, myfilelist+mylinklist)
 
                # check for package collisions
                if "collision-protect" in self.settings.features:
                        if myfilelist == None:
-                               myfilelist = listdir(srcroot, recursive=1, filesonly=1, followSymlinks=True)
+                               myfilelist = listdir(srcroot, recursive=1, filesonly=1, followSymlinks=False)
                        if mylinklist == None:
                                mylinklist = filter(os.path.islink, listdir(srcroot, recursive=1, filesonly=0, followSymlinks=False))
                        self._collision_protect(srcroot, destroot, otherversions, myfilelist+mylinklist, mylinklist)
index 10038efa1b6f92a2365b087e5f2460da1057f7bb..d68094150da496c16e79fde5bddf9848730e33dc 100644 (file)
@@ -235,7 +235,7 @@ def create_color_func(color_key):
        return derived_func
 
 for c in compat_functions_colors:
-       setattr(sys.modules[__name__], c, create_color_func(c))
+       locals()[c] = create_color_func(c)
 
 class EOutput:
        """
index e0a89f1e29ea3f5b7f1e579c75eeef84306b3c5e..a69a19ec6785a53ff877caa8ebd8ead765b4623f 100644 (file)
@@ -66,4 +66,4 @@ for bin in os.listdir(bindir):
           bin.startswith("new") or \
           bin.startswith("prep") or \
           bin in ["ecompress","ecompressdir","fowners","fperms"]:
-               setattr(sys.modules[__name__], bin, create_portage_wrapper(bin))
+               locals()[bin] = create_portage_wrapper(bin)