Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 83613 | Differences between
and this patch

Collapse All | Expand All

(-)portage.py.orig (-32 / +50 lines)
Lines 915-920 Link Here
915
			self.configdict={}
915
			self.configdict={}
916
			# configlist will contain: [ globals, defaults, conf, pkg, auto, backupenv (incrementals), origenv ]
916
			# configlist will contain: [ globals, defaults, conf, pkg, auto, backupenv (incrementals), origenv ]
917
917
918
			# Read /etc/make.globals first, because we may need $PORTDIR to stack profiles
919
			try:
920
				self.mygcfg = getconfig("/etc/make.globals")
921
				if self.mygcfg == None:
922
					self.mygcfg = {}
923
			except SystemExit, e:
924
				raise
925
			except Exception, e:
926
				writemsg("!!! %s\n" % (e))
927
				writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n")
928
				writemsg("!!! Errors in this file should be reported on bugs.gentoo.org.\n")
929
				sys.exit(1)
930
			self.configlist.append(self.mygcfg)
931
			self.configdict["globals"]=self.configlist[-1]
932
933
			# Read /etc/make.conf second, in case user has redefined $PORTDIR
934
			try:
935
				# XXX: Should depend on root?
936
				self.mygcfg=getconfig("/"+MAKE_CONF_FILE,allow_sourcing=True)
937
				if self.mygcfg == None:
938
					self.mygcfg = {}
939
			except SystemExit, e:
940
				raise
941
			except Exception, e:
942
				writemsg("!!! %s\n" % (e))
943
				writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n")
944
				sys.exit(1)
945
			self.configdict["conf"]=self.mygcfg
946
			# Note: do not add it to self.configlist yet, it must come third.
947
948
			# Build a temporary config dict with only $PORTDIR (if available)
949
			# This is for varexpansion of the "parent" paths during profiles stacking
950
			self.mygcfg={}
951
			if self.configdict["conf"]["PORTDIR"]:
952
				self.mygcfg["PORTDIR"]=self.configdict["conf"]["PORTDIR"]
953
			elif self.configdict["globals"]["PORTDIR"]:
954
				self.mygcfg["PORTDIR"]=self.configdict["globals"]["PORTDIR"]
955
918
			# The symlink might not exist or might not be a symlink.
956
			# The symlink might not exist or might not be a symlink.
919
			try:
957
			try:
920
				self.profiles=[abssymlink(self.profile_path)]
958
				self.profiles=[abssymlink(self.profile_path)]
Lines 925-933 Link Here
925
963
926
			mypath = self.profiles[0]
964
			mypath = self.profiles[0]
927
			while os.path.exists(mypath+"/parent"):
965
			while os.path.exists(mypath+"/parent"):
928
				mypath = os.path.normpath(mypath+"///"+grabfile(mypath+"/parent")[0])
966
				mypath = os.path.normpath(os.path.join(mypath,varexpand(grabfile(mypath+"/parent")[0],self.mygcfg)))
967
				if mypath in self.profiles:
968
					writemsg("!!! The following cascading profiles form a loop:\n")
969
					for myindex in range(self.profiles.index(mypath), -1, -1):
970
							writemsg("!!!    "+self.profiles[myindex]+" --parent--> "+([mypath]+self.profiles)[myindex]+"\n")
971
					writemsg("!!! Ignoring.\n")
972
					break
929
				if os.path.exists(mypath):
973
				if os.path.exists(mypath):
930
					self.profiles.insert(0,mypath)
974
					self.profiles.insert(0,mypath)
975
				else:
976
					writemsg("!!! Parent profile does not exists: "+mypath+"\n")
977
					writemsg("!!! Ignoring.\n")
931
978
932
			if os.environ.has_key("PORTAGE_CALLER") and os.environ["PORTAGE_CALLER"] == "repoman":
979
			if os.environ.has_key("PORTAGE_CALLER") and os.environ["PORTAGE_CALLER"] == "repoman":
933
				pass
980
				pass
Lines 959-980 Link Here
959
			self.use_defs  = stack_dictlist(use_defs_lists, incremental=True)
1006
			self.use_defs  = stack_dictlist(use_defs_lists, incremental=True)
960
			del use_defs_lists
1007
			del use_defs_lists
961
1008
962
			try:
963
				mygcfg_dlists = grab_multiple("make.globals", self.profiles+["/etc"], getconfig)
964
				self.mygcfg   = stack_dicts(mygcfg_dlists, incrementals=portage_const.INCREMENTALS, ignore_none=1)
965
966
				if self.mygcfg == None:
967
					self.mygcfg = {}
968
			except SystemExit, e:
969
				raise
970
			except Exception, e:
971
				writemsg("!!! %s\n" % (e))
972
				writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n")
973
				writemsg("!!! Errors in this file should be reported on bugs.gentoo.org.\n")
974
				sys.exit(1)
975
			self.configlist.append(self.mygcfg)
976
			self.configdict["globals"]=self.configlist[-1]
977
978
			self.mygcfg = {}
1009
			self.mygcfg = {}
979
			if self.profiles:
1010
			if self.profiles:
980
				try:
1011
				try:
Lines 994-1014 Link Here
994
			self.configlist.append(self.mygcfg)
1025
			self.configlist.append(self.mygcfg)
995
			self.configdict["defaults"]=self.configlist[-1]
1026
			self.configdict["defaults"]=self.configlist[-1]
996
1027
997
			try:
1028
			# Config from make.conf comes third, but has already been read
998
				# XXX: Should depend on root?
1029
			self.configlist.append(self.configdict["conf"])
999
				self.mygcfg=getconfig("/"+MAKE_CONF_FILE,allow_sourcing=True)
1000
				if self.mygcfg == None:
1001
					self.mygcfg = {}
1002
			except SystemExit, e:
1003
				raise
1004
			except Exception, e:
1005
				writemsg("!!! %s\n" % (e))
1006
				writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n")
1007
				sys.exit(1)
1008
			
1009
1010
			self.configlist.append(self.mygcfg)
1011
			self.configdict["conf"]=self.configlist[-1]
1012
1030
1013
			self.configlist.append({})
1031
			self.configlist.append({})
1014
			self.configdict["pkg"]=self.configlist[-1]
1032
			self.configdict["pkg"]=self.configlist[-1]

Return to bug 83613