Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 90343 | Differences between
and this patch

Collapse All | Expand All

(-)portage-2.0.51.20.orig/bin/ebuild.sh (+4 lines)
Lines 1124-1130 Link Here
1124
	[ "${EMERGE_FROM}" == "binary" ] && IMAGE=${PKG_TMPDIR}/${PF}/bin \
1124
	[ "${EMERGE_FROM}" == "binary" ] && IMAGE=${PKG_TMPDIR}/${PF}/bin \
1125
					|| IMAGE=${D}
1125
					|| IMAGE=${D}
1126
1126
1127
	[ -n "$SBNOTIFY_LOG" ] && export SBNOTIFY_EVENTMASK=2
1127
	pkg_preinst
1128
	pkg_preinst
1129
	[ -n "$SBNOTIFY_LOG" ] && export SBNOTIFY_EVENTMASK=0 && unset SBNOTIFY_LOG
1128
1130
1129
	# hopefully this will someday allow us to get rid of the no* feature flags
1131
	# hopefully this will someday allow us to get rid of the no* feature flags
1130
	# we don't want globbing for initial expansion, but afterwards, we do
1132
	# we don't want globbing for initial expansion, but afterwards, we do
Lines 1749-1754 Link Here
1749
		;;
1751
		;;
1750
	prerm|postrm|postinst|config)
1752
	prerm|postrm|postinst|config)
1751
		export SANDBOX_ON="0"
1753
		export SANDBOX_ON="0"
1754
		[ -n "$SBNOTIFY_LOG" ] && export SBNOTIFY_EVENTMASK=2
1752
		if [ "$PORTAGE_DEBUG" != "1" ]; then
1755
		if [ "$PORTAGE_DEBUG" != "1" ]; then
1753
			pkg_${myarg}
1756
			pkg_${myarg}
1754
			#Allow non-zero return codes since they can be caused by &&
1757
			#Allow non-zero return codes since they can be caused by &&
Lines 1758-1763 Link Here
1758
			#Allow non-zero return codes since they can be caused by &&
1761
			#Allow non-zero return codes since they can be caused by &&
1759
			set +x
1762
			set +x
1760
		fi
1763
		fi
1764
		[ -n "$SBNOTIFY_LOG" ] && export SBNOTIFY_EVENTMASK=0 && unset SBNOTIFY_LOG
1761
		;;
1765
		;;
1762
	unpack|compile|test|clean|install)
1766
	unpack|compile|test|clean|install)
1763
		if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
1767
		if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
(-)portage-2.0.51.20.orig/pym/portage_const.py (+1 lines)
Lines 25-30 Link Here
25
25
26
EBUILD_SH_BINARY        = PORTAGE_BIN_PATH+"/ebuild.sh"
26
EBUILD_SH_BINARY        = PORTAGE_BIN_PATH+"/ebuild.sh"
27
SANDBOX_BINARY          = "/usr/bin/sandbox"
27
SANDBOX_BINARY          = "/usr/bin/sandbox"
28
SANDBOX_LIB             = "/lib/libsandbox.so"
28
DEPSCAN_SH_BINARY       = "/sbin/depscan.sh"
29
DEPSCAN_SH_BINARY       = "/sbin/depscan.sh"
29
BASH_BINARY             = "/bin/bash"
30
BASH_BINARY             = "/bin/bash"
30
MOVE_BINARY             = "/bin/mv"
31
MOVE_BINARY             = "/bin/mv"
(-)portage-2.0.51.20.orig/pym/portage.py (-13 / +22 lines)
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:

Return to bug 90343