Lines 76-82
Link Here
|
76 |
sys.stderr.write(red("*** Please add this user to the portage group if you wish to use portage.\n")) |
76 |
sys.stderr.write(red("*** Please add this user to the portage group if you wish to use portage.\n")) |
77 |
sys.stderr.write("\n") |
77 |
sys.stderr.write("\n") |
78 |
|
78 |
|
79 |
incrementals=["USE","FEATURES","ACCEPT_KEYWORDS","ACCEPT_LICENSE","CONFIG_PROTECT_MASK","CONFIG_PROTECT","PRELINK_PATH","PRELINK_PATH_MASK"] |
79 |
incrementals=["USE","FEATURES","ACCEPT_KEYWORDS","ACCEPT_LICENSE","CONFIG_PROTECT_MASK","CONFIG_PROTECT","CLEAN_PROTECT_MASK","CLEAN_PROTECT","PRELINK_PATH","PRELINK_PATH_MASK"] |
80 |
stickies=["KEYWORDS_ACCEPT","USE","CFLAGS","CXXFLAGS","MAKEOPTS","EXTRA_ECONF","EXTRA_EMAKE"] |
80 |
stickies=["KEYWORDS_ACCEPT","USE","CFLAGS","CXXFLAGS","MAKEOPTS","EXTRA_ECONF","EXTRA_EMAKE"] |
81 |
|
81 |
|
82 |
def getcwd(): |
82 |
def getcwd(): |
Lines 433-439
Link Here
|
433 |
continue |
433 |
continue |
434 |
pos=pos+1 |
434 |
pos=pos+1 |
435 |
|
435 |
|
436 |
specials={"KDEDIRS":[],"PATH":[],"CLASSPATH":[],"LDPATH":[],"MANPATH":[],"INFODIR":[],"INFOPATH":[],"ROOTPATH":[],"CONFIG_PROTECT":[],"CONFIG_PROTECT_MASK":[],"PRELINK_PATH":[],"PRELINK_PATH_MASK":[]} |
436 |
specials={"KDEDIRS":[],"PATH":[],"CLASSPATH":[],"LDPATH":[],"MANPATH":[],"INFODIR":[],"INFOPATH":[],"ROOTPATH":[],"CONFIG_PROTECT":[],"CONFIG_PROTECT_MASK":[],"CLEAN_PROTECT":[],"CLEAN_PROTECT_MASK":[],"PRELINK_PATH":[],"PRELINK_PATH_MASK":[]} |
437 |
env={} |
437 |
env={} |
438 |
|
438 |
|
439 |
for x in fns: |
439 |
for x in fns: |
Lines 528-534
Link Here
|
528 |
if len(specials[path])==0: |
528 |
if len(specials[path])==0: |
529 |
continue |
529 |
continue |
530 |
outstring="export "+path+"='" |
530 |
outstring="export "+path+"='" |
531 |
if path in ["CONFIG_PROTECT","CONFIG_PROTECT_MASK"]: |
531 |
if path in ["CONFIG_PROTECT","CONFIG_PROTECT_MASK","CLEAN_PROTECT","CLEAN_PROTECT_MASK"]: |
532 |
for x in specials[path][:-1]: |
532 |
for x in specials[path][:-1]: |
533 |
outstring += x+" " |
533 |
outstring += x+" " |
534 |
else: |
534 |
else: |
Lines 4097-4102
Link Here
|
4097 |
if os.path.isdir(ppath): |
4097 |
if os.path.isdir(ppath): |
4098 |
self.protectmask.append(ppath) |
4098 |
self.protectmask.append(ppath) |
4099 |
#if it doesn't exist, silently skip it |
4099 |
#if it doesn't exist, silently skip it |
|
|
4100 |
|
4101 |
self.cleanprotect=[] |
4102 |
for x in string.split(settings["CLEAN_PROTECT"]): |
4103 |
ppath=os.path.normpath(self.myroot+"/"+x)+"/" |
4104 |
if os.path.isdir(ppath): |
4105 |
self.cleanprotect.append(ppath) |
4106 |
#if it doesn't exist, silently skip it |
4107 |
|
4108 |
self.cleanprotectmask=[] |
4109 |
for x in string.split(settings["CLEAN_PROTECT_MASK"]): |
4110 |
ppath=os.path.normpath(self.myroot+"/"+x)+"/" |
4111 |
if os.path.isdir(ppath): |
4112 |
self.cleanprotectmask.append(ppath) |
4113 |
#if it doesn't exist, silently skip it |
4100 |
|
4114 |
|
4101 |
def isprotected(self,obj): |
4115 |
def isprotected(self,obj): |
4102 |
"""Checks if obj is in the current protect/mask directories. Returns |
4116 |
"""Checks if obj is in the current protect/mask directories. Returns |
Lines 4113-4118
Link Here
|
4113 |
masked=len(pmpath) |
4127 |
masked=len(pmpath) |
4114 |
return (protected > masked) |
4128 |
return (protected > masked) |
4115 |
|
4129 |
|
|
|
4130 |
def iscleanprotected(self,obj): |
4131 |
"""Checks if obj is in the current clean protect/mask directories. Returns |
4132 |
0 on unprotected/masked, and 1 on protected.""" |
4133 |
masked=0 |
4134 |
protected=0 |
4135 |
for ppath in self.cleanprotect: |
4136 |
if (len(ppath) > masked) and (obj[0:len(ppath)]==ppath): |
4137 |
protected=len(ppath) |
4138 |
#config file management |
4139 |
for pmpath in self.cleanprotectmask: |
4140 |
if (len(pmpath) >= protected) and (obj[0:len(pmpath)]==pmpath): |
4141 |
#skip, it's in the mask |
4142 |
masked=len(pmpath) |
4143 |
return (protected > masked) |
4144 |
|
4116 |
def unmerge(self,pkgfiles=None,trimworld=1): |
4145 |
def unmerge(self,pkgfiles=None,trimworld=1): |
4117 |
if not pkgfiles: |
4146 |
if not pkgfiles: |
4118 |
print "No package files given... Grabbing a set." |
4147 |
print "No package files given... Grabbing a set." |
Lines 4154-4159
Link Here
|
4154 |
if self.isprotected(obj): |
4183 |
if self.isprotected(obj): |
4155 |
print "--- cfgpro "+str(pkgfiles[obj][0]), obj |
4184 |
print "--- cfgpro "+str(pkgfiles[obj][0]), obj |
4156 |
continue |
4185 |
continue |
|
|
4186 |
|
4187 |
if self.iscleanprotected(obj): |
4188 |
print "--- clnpro "+str(pkgfiles[obj][0]), obj |
4189 |
continue |
4157 |
|
4190 |
|
4158 |
lstatobj=os.lstat(obj) |
4191 |
lstatobj=os.lstat(obj) |
4159 |
lmtime=str(lstatobj[ST_MTIME]) |
4192 |
lmtime=str(lstatobj[ST_MTIME]) |