From: Fabian Groffen Date: Sun, 18 Mar 2007 11:08:11 +0000 (-0000) Subject: Merged from trunk 6239:6242 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=7c8438bd8dccccc88fdba10c50149f99435d5514;p=portage.git Merged from trunk 6239:6242 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 for this patch. svn path=/main/branches/prefix/; revision=6243 --- diff --git a/bin/dodir b/bin/dodir index 306b53e3d..4c335d57e 100755 --- 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}/}" diff --git a/bin/fowners b/bin/fowners index 1ebdce450..d2b493478 100755 --- a/bin/fowners +++ b/bin/fowners @@ -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}/}" diff --git a/bin/fperms b/bin/fperms index cccd218b3..ff77e68fc 100755 --- a/bin/fperms +++ b/bin/fperms @@ -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}/}" diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index e37f1e6a4..75050ae4d 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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) diff --git a/pym/portage/output.py b/pym/portage/output.py index 10038efa1..d68094150 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -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: """ diff --git a/pym/portage/tests/bin/setup_env.py b/pym/portage/tests/bin/setup_env.py index e0a89f1e2..a69a19ec6 100644 --- a/pym/portage/tests/bin/setup_env.py +++ b/pym/portage/tests/bin/setup_env.py @@ -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)