Lines 81-87
Link Here
|
81 |
MOVE_BINARY, PRELINK_BINARY, WORLD_FILE, MAKE_CONF_FILE, MAKE_DEFAULTS_FILE, \ |
81 |
MOVE_BINARY, PRELINK_BINARY, WORLD_FILE, MAKE_CONF_FILE, MAKE_DEFAULTS_FILE, \ |
82 |
DEPRECATED_PROFILE_FILE, USER_VIRTUALS_FILE, EBUILD_SH_ENV_FILE, \ |
82 |
DEPRECATED_PROFILE_FILE, USER_VIRTUALS_FILE, EBUILD_SH_ENV_FILE, \ |
83 |
INVALID_ENV_FILE, CUSTOM_MIRRORS_FILE, SANDBOX_PIDS_FILE, CONFIG_MEMORY_FILE,\ |
83 |
INVALID_ENV_FILE, CUSTOM_MIRRORS_FILE, SANDBOX_PIDS_FILE, CONFIG_MEMORY_FILE,\ |
84 |
INCREMENTALS, STICKIES |
84 |
INCREMENTALS, STICKIES, SANDBOX_LIB |
85 |
|
85 |
|
86 |
from portage_data import ostype, lchown, userland, secpass, uid, wheelgid, \ |
86 |
from portage_data import ostype, lchown, userland, secpass, uid, wheelgid, \ |
87 |
portage_uid, portage_gid |
87 |
portage_uid, portage_gid |
Lines 2314-2320
Link Here
|
2314 |
droppriv=actionmap[mydo]["args"][1],logfile=logfile) |
2314 |
droppriv=actionmap[mydo]["args"][1],logfile=logfile) |
2315 |
return retval |
2315 |
return retval |
2316 |
|
2316 |
|
2317 |
def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1,fetchall=0,tree="porttree"): |
2317 |
def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1,fetchall=0,tree="porttree",sbnotify_log=None): |
2318 |
global db |
2318 |
global db |
2319 |
|
2319 |
|
2320 |
ebuild_path = os.path.abspath(myebuild) |
2320 |
ebuild_path = os.path.abspath(myebuild) |
Lines 2595-2600
Link Here
|
2595 |
return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile) |
2595 |
return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile) |
2596 |
elif mydo in ["prerm","postrm","preinst","postinst","config"]: |
2596 |
elif mydo in ["prerm","postrm","preinst","postinst","config"]: |
2597 |
mysettings.load_infodir(pkg_dir) |
2597 |
mysettings.load_infodir(pkg_dir) |
|
|
2598 |
if sbnotify_log: |
2599 |
mysettings["LD_PRELOAD"]=SANDBOX_LIB |
2600 |
mysettings["SBNOTIFY_LOG"]=sbnotify_log |
2598 |
return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile) |
2601 |
return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile) |
2599 |
|
2602 |
|
2600 |
try: |
2603 |
try: |
Lines 6428-6439
Link Here
|
6428 |
print ">>> Merging",self.mycpv,"to",destroot |
6431 |
print ">>> Merging",self.mycpv,"to",destroot |
6429 |
|
6432 |
|
6430 |
# run preinst script |
6433 |
# run preinst script |
|
|
6434 |
sbnotify_log=None |
6435 |
if "sbnotify" in features: |
6436 |
sbnotify_log=self.dbtmpdir+"/PREINST" |
6431 |
if myebuild: |
6437 |
if myebuild: |
6432 |
# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg |
6438 |
# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg |
6433 |
# (if any). |
6439 |
# (if any). |
6434 |
a=doebuild(myebuild,"preinst",root,self.settings,cleanup=cleanup,use_cache=0) |
6440 |
a=doebuild(myebuild,"preinst",root,self.settings,cleanup=cleanup,use_cache=0,sbnotify_log=sbnotify_log) |
6435 |
else: |
6441 |
else: |
6436 |
a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root,self.settings,cleanup=cleanup,use_cache=0) |
6442 |
a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root,self.settings,cleanup=cleanup,use_cache=0,sbnotify_log=sbnotify_log) |
6437 |
|
6443 |
|
6438 |
# XXX: Decide how to handle failures here. |
6444 |
# XXX: Decide how to handle failures here. |
6439 |
if a != 0: |
6445 |
if a != 0: |
Lines 6514-6526
Link Here
|
6514 |
self.dbdir = self.dbtmpdir |
6520 |
self.dbdir = self.dbtmpdir |
6515 |
print ">>> original instance of package unmerged safely." |
6521 |
print ">>> original instance of package unmerged safely." |
6516 |
|
6522 |
|
6517 |
# We hold both directory locks. |
|
|
6518 |
self.dbdir = self.dbpkgdir |
6519 |
self.delete() |
6520 |
movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) |
6521 |
|
6522 |
self.unlockdb() |
6523 |
|
6524 |
#write out our collection of md5sums |
6523 |
#write out our collection of md5sums |
6525 |
if cfgfiledict.has_key("IGNORE"): |
6524 |
if cfgfiledict.has_key("IGNORE"): |
6526 |
del cfgfiledict["IGNORE"] |
6525 |
del cfgfiledict["IGNORE"] |
Lines 6545-6556
Link Here
|
6545 |
portage_locks.unlockfile(mylock) |
6544 |
portage_locks.unlockfile(mylock) |
6546 |
|
6545 |
|
6547 |
#do postinst script |
6546 |
#do postinst script |
|
|
6547 |
sbnotify_log=None |
6548 |
if "sbnotify" in features: |
6549 |
sbnotify_log=self.dbtmpdir+"/POSTINST" |
6548 |
if myebuild: |
6550 |
if myebuild: |
6549 |
# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg |
6551 |
# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg |
6550 |
# (if any). |
6552 |
# (if any). |
6551 |
a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0) |
6553 |
a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0,sbnotify_log=sbnotify_log) |
6552 |
else: |
6554 |
else: |
6553 |
a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0) |
6555 |
a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0,sbnotify_log=sbnotify_log) |
|
|
6556 |
|
6557 |
# We hold both directory locks. |
6558 |
self.dbdir = self.dbpkgdir |
6559 |
self.delete() |
6560 |
movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) |
6561 |
|
6562 |
self.unlockdb() |
6554 |
|
6563 |
|
6555 |
# XXX: Decide how to handle failures here. |
6564 |
# XXX: Decide how to handle failures here. |
6556 |
if a != 0: |
6565 |
if a != 0: |