Zac's USERLAND guessing yields in big problems for Prefix. Prefix users
authorFabian Groffen <grobian@gentoo.org>
Sun, 30 Dec 2007 19:16:00 +0000 (19:16 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 30 Dec 2007 19:16:00 +0000 (19:16 -0000)
/always/ have a GNU userland.  I could reliably make this the case in
portage/data.py.  In isolated-functions.sh I couldn't.  It looks strange
to me it's being set there as well.

I personally hope that USERLAND can go away some day.  Prefix could
cater for this in the current FreeBSD case, by simply having an
alternative EPREFIX for a number of packages that Portage needs (bash,
coreutils, findutils, sed, gawk ...).

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

bin/isolated-functions.sh
pym/portage/data.py

index d38125fb15c230b3269221d93f053a5735a5e7e0..aed9a9476a83870986245a395a127c9ec1e6a9ee 100755 (executable)
@@ -377,16 +377,22 @@ case "${NOCOLOR:-false}" in
                ;;
 esac
 
-if [[ -z ${USERLAND} ]] ; then
-       case $(uname -s) in
-       *BSD|DragonFly)
-               export USERLAND="BSD"
-               ;;
-       *)
-               export USERLAND="GNU"
-               ;;
-       esac
-fi
+# In Prefix every platform has USERLAND=GNU, even FreeBSD.  Since I
+# don't know how to reliably "figure out" we are in a Prefix instance of
+# portage here, I for now disable this check, and hardcode it to GNU.
+# Somehow it appears stange to me that this code is in this file,
+# non-ebuilds/eclasses should never rely on USERLAND and XARGS, don't they?
+#if [[ -z ${USERLAND} ]] ; then
+#      case $(uname -s) in
+#      *BSD|DragonFly)
+#              export USERLAND="BSD"
+#              ;;
+#      *)
+#              export USERLAND="GNU"
+#              ;;
+#      esac
+#fi
+[[ -z ${USERLAND} ]] && USERLAND="GNU"
 
 if [[ -z ${XARGS} ]] ; then
        case ${USERLAND} in
index fa441d375133d56a6c7ddd70a77315be4d4e2f2b..b869e2efdfeaa094724453880501684d56cfe7c8 100644 (file)
@@ -12,7 +12,11 @@ bad = create_color_func("BAD")
 
 ostype=os.uname()[0]
 userland = None
-if ostype == "DragonFly" or ostype.endswith("BSD"):
+# Prefix always has USERLAND=GNU, even on
+# FreeBSD, OpenBSD and Darwin (thank the lord!).
+# Hopefully this entire USERLAND hack can go once
+if portage.const.EPREFIX == "" and
+       (ostype == "DragonFly" or ostype.endswith("BSD")):
        userland = "BSD"
 else:
        userland = "GNU"