diff -ru portage-prefix-2.1.14.orig/pym/portage.py portage-prefix-2.1.14/pym/portage.py --- portage-prefix-2.1.14.orig/pym/portage.py 2006-06-01 10:57:49.000000000 +0200 +++ portage-prefix-2.1.14/pym/portage.py 2006-06-01 11:05:52.000000000 +0200 @@ -539,6 +539,7 @@ "PYTHONPATH" :{"separator":':', "value":[],"from":""}, "ADA_INCLUDE_PATH" :{"separator":':', "value":[],"from":""}, "ADA_OBJECTS_PATH" :{"separator":':', "value":[],"from":""}, + "PORTAGE_ENVDUP" :{"separator":' ', "value":[],"from":""}, } env={} @@ -552,6 +553,22 @@ writemsg("!!! Parsing error in "+str(root)+portage_const.EPREFIX+"/etc/env.d/"+str(x)+"\n") #parse error continue + + # process PORTAGE_ENVDUP + if myconfig.has_key("PORTAGE_ENVDUP"): + for ed in myconfig["PORTAGE_ENVDUP"].split(" "): + if not ed: + continue + if not myconfig.has_key("PORTAGE_ENVDUP_" + ed): + continue + if specials.has_key("PORTAGE_ENVDUP_" + ed): + continue + if myconfig.has_key("PORTAGE_ENVEXT"): + myconfig["PORTAGE_ENVEXT"] = myconfig["PORTAGE_ENVEXT"] \ + + " " + "PORTAGE_ENVDUP_" + ed + else: + myconfig["PORTAGE_ENVEXT"] = "PORTAGE_ENVDUP_" + ed + # process PORTAGE_ENVEXT if myconfig.has_key("PORTAGE_ENVEXT"): for ee in myconfig["PORTAGE_ENVEXT"].split(" "): @@ -585,6 +602,41 @@ for myenv in myconfig.keys(): env[myenv]=myconfig[myenv] + # process PORTAGE_ENVDUP + if specials.has_key("PORTAGE_ENVDUP"): + for dupvar in specials["PORTAGE_ENVDUP"]["value"]: + if not dupvar: + continue + dupenvvalue = None + dupspecvalue = None + if env.has_key(dupvar): + dupenvvalue=env["PORTAGE_ENVDUP_" + dupvar] + del env[dupvar] + elif specials.has_key(dupvar): + dupspecvalue=specials[dupvar] + if dupvar != "LDPATH": + del specials[dupvar] + else: + continue + + for dupto in specials["PORTAGE_ENVDUP_" + dupvar]["value"]: + if not dupto: + continue + if dupenvvalue: + if env.has_key(dupto): + writemsg("!!! Cannot dup '"+dupvar+"' to '"+dupto + + "', '"+dupto+"' is defined separately.\n"); + continue + env[dupto] = dupenvvalue + elif specials.has_key(dupto): + specials[dupto] = dupspecvalue + else: + specials[dupto] = {"separator": sep, "value":[], "from": x} + specials[dupto]["separator"] = dupspecvalue["separator"] + specials[dupto]["value"].extend(dupspecvalue["value"]) + del specials["PORTAGE_ENVDUP_" + dupvar] + del specials["PORTAGE_ENVDUP"] + if os.path.exists(root+portage_const.EPREFIX+"/etc/ld.so.conf"): myld=open(root+portage_const.EPREFIX+"/etc/ld.so.conf") myldlines=myld.readlines()