Lines 2048-2054
Link Here
|
2048 |
actionmap[mydo]["args"][0], |
2048 |
actionmap[mydo]["args"][0], |
2049 |
actionmap[mydo]["args"][1]) |
2049 |
actionmap[mydo]["args"][1]) |
2050 |
|
2050 |
|
2051 |
def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1): |
2051 |
def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1,log_counter=0): |
2052 |
global db |
2052 |
global db |
2053 |
|
2053 |
|
2054 |
ebuild_path = os.path.abspath(myebuild) |
2054 |
ebuild_path = os.path.abspath(myebuild) |
Lines 2232-2245
Link Here
|
2232 |
mysettings["WORKDIR"]=mysettings["BUILDDIR"]+"/work" |
2232 |
mysettings["WORKDIR"]=mysettings["BUILDDIR"]+"/work" |
2233 |
mysettings["D"]=mysettings["BUILDDIR"]+"/image/" |
2233 |
mysettings["D"]=mysettings["BUILDDIR"]+"/image/" |
2234 |
|
2234 |
|
|
|
2235 |
# if we don't get a log_counter from treewalk or unmerge, guess a new one |
2236 |
if log_counter <= 0: |
2237 |
log_counter = db[myroot]["vartree"].dbapi.get_counter_tick_core("/") |
2238 |
|
2235 |
if mysettings.has_key("PORT_LOGDIR"): |
2239 |
if mysettings.has_key("PORT_LOGDIR"): |
2236 |
if os.access(mysettings["PORT_LOGDIR"]+"/",os.W_OK): |
2240 |
if os.access(mysettings["PORT_LOGDIR"]+"/",os.W_OK): |
2237 |
try: |
2241 |
try: |
2238 |
os.chown(mysettings["BUILD_PREFIX"],portage_uid,portage_gid) |
2242 |
os.chown(mysettings["PORT_LOGDIR"],portage_uid,portage_gid) |
2239 |
os.chmod(mysettings["PORT_LOGDIR"],06770) |
2243 |
os.chmod(mysettings["PORT_LOGDIR"],06770) |
2240 |
if not mysettings.has_key("LOG_PF") or (mysettings["LOG_PF"] != mysettings["PF"]): |
2244 |
if not mysettings.has_key("LOG_PF") or (mysettings["LOG_PF"] != mysettings["PF"]): |
2241 |
mysettings["LOG_PF"]=mysettings["PF"] |
2245 |
mysettings["LOG_PF"]=mysettings["PF"] |
2242 |
mysettings["LOG_COUNTER"]=str(db[myroot]["vartree"].dbapi.get_counter_tick_core("/")) |
2246 |
mysettings["LOG_COUNTER"]=str(log_counter) |
2243 |
except ValueError, e: |
2247 |
except ValueError, e: |
2244 |
mysettings["PORT_LOGDIR"]="" |
2248 |
mysettings["PORT_LOGDIR"]="" |
2245 |
print "!!! Unable to chown/chmod PORT_LOGDIR. Disabling logging." |
2249 |
print "!!! Unable to chown/chmod PORT_LOGDIR. Disabling logging." |
Lines 5167-5175
Link Here
|
5167 |
myebuildpath=self.dbdir+"/"+x |
5171 |
myebuildpath=self.dbdir+"/"+x |
5168 |
break |
5172 |
break |
5169 |
|
5173 |
|
|
|
5174 |
# get counter to use it as LOG_COUNTER for prerm/postrm |
5175 |
try: |
5176 |
mycounter = long(self.getstring("COUNTER")) |
5177 |
except ValueError: |
5178 |
mycounter = 0 |
5179 |
|
5170 |
#do prerm script |
5180 |
#do prerm script |
5171 |
if myebuildpath and os.path.exists(myebuildpath): |
5181 |
if myebuildpath and os.path.exists(myebuildpath): |
5172 |
a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,use_cache=0) |
5182 |
a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,use_cache=0,log_counter=mycounter) |
5173 |
# XXX: Decide how to handle failures here. |
5183 |
# XXX: Decide how to handle failures here. |
5174 |
if a != 0: |
5184 |
if a != 0: |
5175 |
writemsg("!!! FAILED prerm: "+str(a)+"\n") |
5185 |
writemsg("!!! FAILED prerm: "+str(a)+"\n") |
Lines 5386-5392
Link Here
|
5386 |
if myebuildpath and os.path.exists(myebuildpath): |
5396 |
if myebuildpath and os.path.exists(myebuildpath): |
5387 |
# XXX: This should be the old config, not the current one. |
5397 |
# XXX: This should be the old config, not the current one. |
5388 |
# XXX: Use vardbapi to load up env vars. |
5398 |
# XXX: Use vardbapi to load up env vars. |
5389 |
a=doebuild(myebuildpath,"postrm",self.myroot,self.settings,use_cache=0) |
5399 |
a=doebuild(myebuildpath,"postrm",self.myroot,self.settings,use_cache=0,log_counter=mycounter) |
5390 |
# XXX: Decide how to handle failures here. |
5400 |
# XXX: Decide how to handle failures here. |
5391 |
if a != 0: |
5401 |
if a != 0: |
5392 |
writemsg("!!! FAILED postrm: "+str(a)+"\n") |
5402 |
writemsg("!!! FAILED postrm: "+str(a)+"\n") |
Lines 5546-5554
Link Here
|
5546 |
if myebuild: |
5556 |
if myebuild: |
5547 |
# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg |
5557 |
# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg |
5548 |
# (if any). |
5558 |
# (if any). |
5549 |
a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0) |
5559 |
a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0,log_counter=counter) |
5550 |
else: |
5560 |
else: |
5551 |
a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0) |
5561 |
a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0,log_counter=counter) |
5552 |
|
5562 |
|
5553 |
# XXX: Decide how to handle failures here. |
5563 |
# XXX: Decide how to handle failures here. |
5554 |
if a != 0: |
5564 |
if a != 0: |