* Remove redundant lchown() compatibility code since the
authorZac Medico <zmedico@gentoo.org>
Sat, 29 Dec 2007 12:17:02 +0000 (12:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 29 Dec 2007 12:17:02 +0000 (12:17 -0000)
  getattr(os, "lchown", None) call already handles it.

* Simplify the userland detection code in portage.data and add
  a bash version of it to isolated-functions.sh.

(trunk r9098:9101)

svn path=/main/branches/2.1.2/; revision=9102

bin/isolated-functions.sh
pym/portage_data.py

index 3290654a6723125e6a488d2e041377d7aedf3878..6feb48dd741a8bb0bb2d5bc29f9d5333ec96f38c 100644 (file)
@@ -375,6 +375,17 @@ case "${NOCOLOR:-false}" in
                ;;
 esac
 
+if [[ -z ${USERLAND} ]] ; then
+       case $(uname -s) in
+       *BSD|DragonFly)
+               export USERLAND="BSD"
+               ;;
+       *)
+               export USERLAND="GNU"
+               ;;
+       esac
+fi
+
 if [[ -z ${XARGS} ]] ; then
        case ${USERLAND} in
        BSD|Darwin)
index 3421d9b9d7eaf1700534d18a3efaf7c7dd74cbfb..0e996fa062fcc97da57d23e4b991332315c2db10 100644 (file)
@@ -13,24 +13,18 @@ from output import create_color_func
 bad = create_color_func("BAD")
 
 ostype=os.uname()[0]
-
 userland = None
+if ostype == "DragonFly" or ostype.endswith("BSD"):
+       userland = "BSD"
+else:
+       userland = "GNU"
+
 lchown = getattr(os, "lchown", None)
-if ostype == "Linux" or \
-       ostype.lower().startswith("gnu") or \
-       ostype.lower().endswith("gnu"):
-       userland="GNU"
-elif ostype == "Darwin":
-       userland="Darwin"
-       def lchown(*pos_args, **key_args):
-               pass
-elif ostype.endswith("BSD") or ostype =="DragonFly":
-       userland="BSD"
 
 if not lchown:
-       if "lchown" in dir(os):
-               # Included in python-2.3
-               lchown = os.lchown
+       if ostype == "Darwin":
+               def lchown(*pos_args, **key_args):
+                       pass
        else:
                try:
                        import missingos