Stack /etc/profile.env inside portage.config so that it doesn't stop variables in...
authorZac Medico <zmedico@gentoo.org>
Sat, 29 Jul 2006 18:20:13 +0000 (18:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 29 Jul 2006 18:20:13 +0000 (18:20 -0000)
svn path=/main/trunk/; revision=4048

bin/ebuild.sh
pym/portage.py
pym/portage_util.py

index f657dddce0567ca7506397367db911e2427fdf75..fdd7da0e0ab683b202f64e0a31a653a289ba9e97 100755 (executable)
@@ -45,8 +45,6 @@ alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then IFS="${old_IFS}";
 OCC="$CC"
 OCXX="$CXX"
 
-source /etc/profile.env &>/dev/null
-
 export PATH="/usr/local/sbin:/sbin:/usr/sbin:${PORTAGE_BIN_PATH}:/usr/local/bin:/bin:/usr/bin:${ROOTPATH}"
 [ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH"
 
index c32cb62b2d1ad77bfa51584a2c42b18a772b2838..b0c6b1102c681fe74a77030e407e1d8d790c67bb 100644 (file)
@@ -810,8 +810,9 @@ class config:
                                            "conf":      self.configlist[2],
                                            "pkg":       self.configlist[3],
                                            "auto":      self.configlist[4],
-                                           "backupenv": self.configlist[5],
-                                           "env":       self.configlist[6] }
+                                           "env.d":     self.configlist[5],
+                                           "backupenv": self.configlist[6],
+                                           "env":       self.configlist[7] }
                        self.profiles = copy.deepcopy(clone.profiles)
                        self.backupenv  = self.configdict["backupenv"]
                        self.pusedict   = copy.deepcopy(clone.pusedict)
@@ -994,6 +995,9 @@ class config:
                        self.configlist.append({})
                        self.configdict["auto"]=self.configlist[-1]
 
+                       self.configlist.append({})
+                       self.configdict["env.d"] = self.configlist[-1]
+
                        self.configlist.append(self.backupenv) # XXX Why though?
                        self.configdict["backupenv"]=self.configlist[-1]
 
@@ -1383,6 +1387,14 @@ class config:
                else:
                        self.already_in_regenerate = 1
 
+               # We grab the latest profile.env here since it changes frequently.
+               self.configdict["env.d"].clear()
+               env_d = getconfig(
+                       os.path.join(self["PORTAGE_CONFIGROOT"], "etc", "profile.env"))
+               if env_d:
+                       # env_d will be None if profile.env doesn't exist.
+                       self.configdict["env.d"].update(env_d)
+
                if useonly:
                        myincrementals=["USE"]
                else:
index a0385323d52c0960a25d6966975e0e7de2bfaa88..7a37d980d1fd3e17fff412e6e24d7c5e522dae8e 100644 (file)
@@ -241,6 +241,8 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
                        lex.source="source"
                while 1:
                        key=lex.get_token()
+                       if key == "export":
+                               key = lex.get_token()
                        if (key==''):
                                #normal end of file
                                break;