Lines 895-900
Link Here
|
895 |
sys.exit(1) |
895 |
sys.exit(1) |
896 |
self.configlist.append(self.mygcfg) |
896 |
self.configlist.append(self.mygcfg) |
897 |
self.configdict["conf"]=self.configlist[-1] |
897 |
self.configdict["conf"]=self.configlist[-1] |
|
|
898 |
self.configdict["conf"]["PKGUSE"]=grabdict("/etc/portage/package.use") |
898 |
|
899 |
|
899 |
for x in incrementals: |
900 |
for x in incrementals: |
900 |
if os.environ.has_key(x): |
901 |
if os.environ.has_key(x): |
Lines 923-929
Link Here
|
923 |
self.regenerate() |
924 |
self.regenerate() |
924 |
|
925 |
|
925 |
def regenerate(self,useonly=0): |
926 |
def regenerate(self,useonly=0): |
926 |
global incrementals,usesplit,profiledir |
927 |
global incrementals,usesplit,pkgusesplit,profiledir |
|
|
928 |
|
929 |
# initialize per-package use variables to an empty dictionary |
930 |
pkgusesplit={} |
931 |
|
927 |
if useonly: |
932 |
if useonly: |
928 |
myincrementals=["USE"] |
933 |
myincrementals=["USE"] |
929 |
else: |
934 |
else: |
Lines 966-971
Link Here
|
966 |
#now append our new setting |
971 |
#now append our new setting |
967 |
if add: |
972 |
if add: |
968 |
mysetting.append(add) |
973 |
mysetting.append(add) |
|
|
974 |
#override per-package use flags |
975 |
if mykey=="USE" and pkgusesplit!={}: |
976 |
for y in pkgusesplit: |
977 |
if add in pkgusesplit[y]: |
978 |
pkgusesplit[y].remove(add) |
979 |
if add[0]=="-" and add[1:] in pkgusesplit[y]: |
980 |
pkgusesplit[y].remove(add[1:]) |
981 |
if add[0]!="-" and "-"+add in pkgusesplit[y]: |
982 |
pkgusesplit[y].remove("-"+add) |
983 |
|
984 |
# initialize per-package use flags |
985 |
if mykey=="USE" and curdb.has_key("PKGUSE"): |
986 |
for x in curdb["PKGUSE"]: |
987 |
mypkgusesplit=[] |
988 |
for y in curdb["PKGUSE"][x]: |
989 |
if y=="-*" or y=="*": |
990 |
continue |
991 |
if y[0]=="-": |
992 |
z=y[1:] |
993 |
else: |
994 |
z="-"+y |
995 |
if y not in mysetting and y not in mypkgusesplit and z not in mypkgusesplit: |
996 |
mypkgusesplit.append(y) |
997 |
if mypkgusesplit: |
998 |
pkgusesplit[x]=mypkgusesplit |
999 |
|
969 |
#store setting in last element of configlist, the original environment: |
1000 |
#store setting in last element of configlist, the original environment: |
970 |
self.configlist[-1][mykey]=string.join(mysetting," ") |
1001 |
self.configlist[-1][mykey]=string.join(mysetting," ") |
971 |
#cache split-up USE var in a global |
1002 |
#cache split-up USE var in a global |
Lines 991-996
Link Here
|
991 |
usesplit.insert(0,self.configdict["defaults"]["ARCH"]) |
1022 |
usesplit.insert(0,self.configdict["defaults"]["ARCH"]) |
992 |
self.configlist[-1]["USE"]=string.join(usesplit," ") |
1023 |
self.configlist[-1]["USE"]=string.join(usesplit," ") |
993 |
|
1024 |
|
|
|
1025 |
# Store per-package setting in configlist for display in emerge --info |
1026 |
self.configlist[-1]["PKGUSE"]="" |
1027 |
mypkgusesplit=pkgusesplit.copy() |
1028 |
for x in mypkgusesplit: |
1029 |
if pkgusesplit[x]==[]: |
1030 |
del(pkgusesplit[x]) |
1031 |
else: |
1032 |
self.configlist[-1]["PKGUSE"]=self.configlist[-1]["PKGUSE"]+"( "+x+" => "+string.join(pkgusesplit[x]," ")+" )" |
1033 |
|
994 |
def __getitem__(self,mykey): |
1034 |
def __getitem__(self,mykey): |
995 |
if mykey=="CONFIG_PROTECT_MASK": |
1035 |
if mykey=="CONFIG_PROTECT_MASK": |
996 |
suffix=" /etc/env.d" |
1036 |
suffix=" /etc/env.d" |
Lines 1501-1507
Link Here
|
1501 |
actionmap[mydo]["args"][1]) |
1541 |
actionmap[mydo]["args"][1]) |
1502 |
|
1542 |
|
1503 |
def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0): |
1543 |
def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0): |
1504 |
global settings |
1544 |
global settings,pkgusesplit |
1505 |
|
1545 |
|
1506 |
if mydo not in ["help","clean","prerm","postrm","preinst","postinst", |
1546 |
if mydo not in ["help","clean","prerm","postrm","preinst","postinst", |
1507 |
"config","touch","setup","depend","fetch","digest", |
1547 |
"config","touch","setup","depend","fetch","digest", |
Lines 1545-1550
Link Here
|
1545 |
settings["PVR"]=mysplit[1] |
1585 |
settings["PVR"]=mysplit[1] |
1546 |
else: |
1586 |
else: |
1547 |
settings["PVR"]=mysplit[1]+"-"+mysplit[2] |
1587 |
settings["PVR"]=mysplit[1]+"-"+mysplit[2] |
|
|
1588 |
|
1589 |
if pkgusesplit.has_key(category+"/"+mysplit[0]): |
1590 |
settings["PUSE"]=string.join(pkgusesplit[category+"/"+mysplit[0]], ' ') |
1591 |
else: |
1592 |
settings["PUSE"]="" |
1593 |
|
1548 |
settings["SLOT"]="" |
1594 |
settings["SLOT"]="" |
1549 |
if settings.has_key("PATH"): |
1595 |
if settings.has_key("PATH"): |
1550 |
mysplit=string.split(settings["PATH"],":") |
1596 |
mysplit=string.split(settings["PATH"],":") |
Lines 2564-2578
Link Here
|
2564 |
mydep=mydep[1:] |
2610 |
mydep=mydep[1:] |
2565 |
return prefix+cpv_expand(mydep,mydb)+postfix |
2611 |
return prefix+cpv_expand(mydep,mydb)+postfix |
2566 |
|
2612 |
|
2567 |
def dep_check(depstring,mydbapi,use="yes",mode=None): |
2613 |
def dep_check(depstring,mydbapi,use="yes",mode=None,parent=None): |
2568 |
"""Takes a depend string and parses the condition.""" |
2614 |
"""Takes a depend string and parses the condition.""" |
2569 |
global usesplit |
2615 |
global usesplit,pkgusesplit |
2570 |
if use=="all": |
2616 |
if use=="all": |
2571 |
#enable everything (for repoman) |
2617 |
#enable everything (for repoman) |
2572 |
myusesplit=["*"] |
2618 |
myusesplit=["*"] |
2573 |
elif use=="yes": |
2619 |
elif use=="yes": |
2574 |
#default behavior |
2620 |
#default behavior |
2575 |
myusesplit=usesplit |
2621 |
myusesplit=usesplit[:] |
|
|
2622 |
if parent and (pkgusesplit!={}): |
2623 |
myparent=pkgsplit(parent.split()[2])[0] |
2624 |
if pkgusesplit.has_key(myparent): |
2625 |
for x in pkgusesplit[myparent]: |
2626 |
if x[0]=="-": |
2627 |
y=x[1:] |
2628 |
else: |
2629 |
y="-"+x |
2630 |
if y in myusesplit: |
2631 |
myusesplit.remove(y) |
2632 |
if x not in myusesplit: |
2633 |
myusesplit.append(x) |
2576 |
else: |
2634 |
else: |
2577 |
#we are being run by autouse(), don't consult USE vars yet. |
2635 |
#we are being run by autouse(), don't consult USE vars yet. |
2578 |
myusesplit=[] |
2636 |
myusesplit=[] |