Lines 923-929
Link Here
|
923 |
self.regenerate() |
923 |
self.regenerate() |
924 |
|
924 |
|
925 |
def regenerate(self,useonly=0): |
925 |
def regenerate(self,useonly=0): |
926 |
global incrementals,usesplit,profiledir |
926 |
global incrementals,usesplit,pkgusesplit,profiledir |
927 |
if useonly: |
927 |
if useonly: |
928 |
myincrementals=["USE"] |
928 |
myincrementals=["USE"] |
929 |
else: |
929 |
else: |
Lines 991-996
Link Here
|
991 |
usesplit.insert(0,self.configdict["defaults"]["ARCH"]) |
991 |
usesplit.insert(0,self.configdict["defaults"]["ARCH"]) |
992 |
self.configlist[-1]["USE"]=string.join(usesplit," ") |
992 |
self.configlist[-1]["USE"]=string.join(usesplit," ") |
993 |
|
993 |
|
|
|
994 |
pkgusesplit={} |
995 |
self.configlist[-1]["PKGUSE"]="" |
996 |
mylines=grabdict("/etc/portage/package.use") |
997 |
for x in mylines: |
998 |
mypkgusesplit=[] |
999 |
for y in mylines[x]: |
1000 |
if y=="-*" or y=="*": |
1001 |
continue |
1002 |
if y[0]=="-": |
1003 |
z=y[1:] |
1004 |
else: |
1005 |
z="-"+y |
1006 |
if y not in usesplit and y not in mypkgusesplit and z not in mypkgusesplit: |
1007 |
mypkgusesplit.append(y) |
1008 |
if mypkgusesplit: |
1009 |
pkgusesplit[x]=mypkgusesplit |
1010 |
self.configlist[-1]["PKGUSE"] = self.configlist[-1]["PKGUSE"]+"( "+x+" => "+string.join(mypkgusesplit," ")+" )" |
1011 |
|
994 |
def __getitem__(self,mykey): |
1012 |
def __getitem__(self,mykey): |
995 |
if mykey=="CONFIG_PROTECT_MASK": |
1013 |
if mykey=="CONFIG_PROTECT_MASK": |
996 |
suffix=" /etc/env.d" |
1014 |
suffix=" /etc/env.d" |
Lines 1501-1507
Link Here
|
1501 |
actionmap[mydo]["args"][1]) |
1519 |
actionmap[mydo]["args"][1]) |
1502 |
|
1520 |
|
1503 |
def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0): |
1521 |
def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0): |
1504 |
global settings |
1522 |
global settings,pkgusesplit |
1505 |
|
1523 |
|
1506 |
if mydo not in ["help","clean","prerm","postrm","preinst","postinst", |
1524 |
if mydo not in ["help","clean","prerm","postrm","preinst","postinst", |
1507 |
"config","touch","setup","depend","fetch","digest", |
1525 |
"config","touch","setup","depend","fetch","digest", |
Lines 1545-1550
Link Here
|
1545 |
settings["PVR"]=mysplit[1] |
1563 |
settings["PVR"]=mysplit[1] |
1546 |
else: |
1564 |
else: |
1547 |
settings["PVR"]=mysplit[1]+"-"+mysplit[2] |
1565 |
settings["PVR"]=mysplit[1]+"-"+mysplit[2] |
|
|
1566 |
|
1567 |
if pkgusesplit.has_key(category+"/"+mysplit[0]): |
1568 |
settings["PUSE"]=string.join(pkgusesplit[category+"/"+mysplit[0]], ' ') |
1569 |
else: |
1570 |
settings["PUSE"]="" |
1571 |
|
1548 |
settings["SLOT"]="" |
1572 |
settings["SLOT"]="" |
1549 |
if settings.has_key("PATH"): |
1573 |
if settings.has_key("PATH"): |
1550 |
mysplit=string.split(settings["PATH"],":") |
1574 |
mysplit=string.split(settings["PATH"],":") |
Lines 2564-2578
Link Here
|
2564 |
mydep=mydep[1:] |
2588 |
mydep=mydep[1:] |
2565 |
return prefix+cpv_expand(mydep,mydb)+postfix |
2589 |
return prefix+cpv_expand(mydep,mydb)+postfix |
2566 |
|
2590 |
|
2567 |
def dep_check(depstring,mydbapi,use="yes",mode=None): |
2591 |
def dep_check(depstring,mydbapi,use="yes",mode=None,parent=None): |
2568 |
"""Takes a depend string and parses the condition.""" |
2592 |
"""Takes a depend string and parses the condition.""" |
2569 |
global usesplit |
2593 |
global usesplit,pkgusesplit |
2570 |
if use=="all": |
2594 |
if use=="all": |
2571 |
#enable everything (for repoman) |
2595 |
#enable everything (for repoman) |
2572 |
myusesplit=["*"] |
2596 |
myusesplit=["*"] |
2573 |
elif use=="yes": |
2597 |
elif use=="yes": |
2574 |
#default behavior |
2598 |
#default behavior |
2575 |
myusesplit=usesplit |
2599 |
myusesplit=usesplit[:] |
|
|
2600 |
if parent and (pkgusesplit!={}): |
2601 |
myparent=pkgsplit(parent.split()[2])[0] |
2602 |
if pkgusesplit.has_key(myparent): |
2603 |
for x in pkgusesplit[myparent]: |
2604 |
if x[0]=="-": |
2605 |
y=x[1:] |
2606 |
else: |
2607 |
y="-"+x |
2608 |
if y in myusesplit: |
2609 |
myusesplit.remove(y) |
2610 |
if x not in myusesplit: |
2611 |
myusesplit.append(x) |
2576 |
else: |
2612 |
else: |
2577 |
#we are being run by autouse(), don't consult USE vars yet. |
2613 |
#we are being run by autouse(), don't consult USE vars yet. |
2578 |
myusesplit=[] |
2614 |
myusesplit=[] |