Move the USERLAND and XARGS sanity checks from the portage_data
authorZac Medico <zmedico@gentoo.org>
Sat, 29 Dec 2007 09:30:04 +0000 (09:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 29 Dec 2007 09:30:04 +0000 (09:30 -0000)
mule to doebuild().

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

pym/portage.py
pym/portage_data.py

index 2d332e4830bbb75e8bd6c8a8bbc0eebd7530a641..cbf3496b04b5e78e324cc13f1af117716424a9c3 100644 (file)
@@ -1411,21 +1411,12 @@ class config:
                        self.configlist.append(self.backupenv) # XXX Why though?
                        self.configdict["backupenv"]=self.configlist[-1]
 
-                       if not local_config:
-                               # Clean up pollution from portage_data so that it doesn't
-                               # interfere with repoman.
-                               self.backupenv.pop("USERLAND", None)
-
                        # Don't allow the user to override certain variables in the env
                        for k in profile_only_variables:
                                self.backupenv.pop(k, None)
 
                        self.configlist.append(self.backupenv.copy())
                        self.configdict["env"]=self.configlist[-1]
-                       if not local_config:
-                               # Clean up pollution from portage_data so that it doesn't
-                               # interfere with repoman.
-                               self.configdict["env"].pop("USERLAND", None)
 
                        # make lookuplist for loading package.*
                        self.lookuplist=self.configlist[:]
@@ -4517,8 +4508,12 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        if env_stat:
                                mysettings._filter_calling_env = True
                        else:
-                               for var in "ARCH", "USERLAND":
-                                       if mysettings.get(var):
+                               for var in "ARCH", "USERLAND", "XARGS":
+                                       value = mysettings.get(var)
+                                       if value and value.strip():
+                                               continue
+                                       if var == "USERLAND" and userland:
+                                               mysettings["USERLAND"] = userland
                                                continue
                                        msg = ("%s is not set... " % var) + \
                                                ("Are you missing the '%setc/make.profile' symlink? " % \
index deea8940b65993c6b8f8332ea2967e1538d994b7..5cb88b385861d074302bb45185c6693083a7032d 100644 (file)
@@ -29,9 +29,6 @@ elif ostype == "Darwin":
 elif ostype.endswith("BSD") or ostype =="DragonFly":
        userland="BSD"
        os.environ["XARGS"]="xargs"
-else:
-       writemsg(red("Operating system")+" \""+ostype+"\" "+red("currently unsupported. Exiting.")+"\n")
-       sys.exit(1)
 
 if not lchown:
        if "lchown" in dir(os):
@@ -47,8 +44,6 @@ if not lchown:
                                        " exist.  Please rebuild python.\n", noiselevel=-1)
                        lchown()
 
-os.environ["USERLAND"]=userland
-
 def portage_group_warning():
        warn_prefix = bad("*** WARNING ***  ")
        mylines = [