summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-29 12:07:56 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-29 12:07:56 +0000
commitb7a57530eebde2fdbce834ca1731cbf0c7f4ee74 (patch)
treed0c6875cfcd597885f295df7d1826939649ef647
parent06ad5480e0680d5c0c9c23659266d95838953e80 (diff)
downloadportage-b7a57530eebde2fdbce834ca1731cbf0c7f4ee74.tar.gz
portage-b7a57530eebde2fdbce834ca1731cbf0c7f4ee74.tar.bz2
portage-b7a57530eebde2fdbce834ca1731cbf0c7f4ee74.zip
Simplify the userland detection code in portage.data and add
a bash version of it to isolated-functions.sh. svn path=/main/trunk/; revision=9100
-rwxr-xr-xbin/isolated-functions.sh11
-rw-r--r--pym/portage/data.py15
2 files changed, 16 insertions, 10 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 3290654a6..6feb48dd7 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -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)
diff --git a/pym/portage/data.py b/pym/portage/data.py
index 8b89f2e4f..a3dbfb885 100644
--- a/pym/portage/data.py
+++ b/pym/portage/data.py
@@ -10,18 +10,13 @@ from portage.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)
-os.environ.setdefault("XARGS", "xargs")
-if ostype == "Linux" or \
- ostype.lower().startswith("gnu") or \
- ostype.lower().endswith("gnu"):
- userland="GNU"
-elif ostype == "Darwin":
- userland="Darwin"
-elif ostype.endswith("BSD") or ostype =="DragonFly":
- userland="BSD"
if not lchown:
try: