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

Collapse All | Expand All

(-)file_not_specified_in_diff (-8 / +18 lines)
Line  Link Here
0
-- pym/portage.py.orig
0
++ pym/portage.py
Lines 1820-1826 Link Here
1820
				actionmap[mydo]["args"][0],
1820
				actionmap[mydo]["args"][0],
1821
				actionmap[mydo]["args"][1])
1821
				actionmap[mydo]["args"][1])
1822
1822
1823
def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None):
1823
def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,log_counter=0):
1824
	global db
1824
	global db
1825
	
1825
	
1826
	ebuild_path = os.path.abspath(myebuild)
1826
	ebuild_path = os.path.abspath(myebuild)
Lines 2003-2016 Link Here
2003
		mysettings["WORKDIR"]=mysettings["BUILDDIR"]+"/work"
2003
		mysettings["WORKDIR"]=mysettings["BUILDDIR"]+"/work"
2004
		mysettings["D"]=mysettings["BUILDDIR"]+"/image/"
2004
		mysettings["D"]=mysettings["BUILDDIR"]+"/image/"
2005
2005
2006
		# if we don't get a log_counter from treewalk or unmerge, guess a new one
2007
		if log_counter <= 0:
2008
			log_counter = db[myroot]["vartree"].dbapi.get_counter_tick_core("/")
2009
2006
		if mysettings.has_key("PORT_LOGDIR"):
2010
		if mysettings.has_key("PORT_LOGDIR"):
2007
			if os.access(mysettings["PORT_LOGDIR"]+"/",os.W_OK):
2011
			if os.access(mysettings["PORT_LOGDIR"]+"/",os.W_OK):
2008
				try:
2012
				try:
2009
					os.chown(mysettings["BUILD_PREFIX"],portage_uid,portage_gid)
2013
					os.chown(mysettings["PORT_LOGDIR"],portage_uid,portage_gid)
2010
					os.chmod(mysettings["PORT_LOGDIR"],06770)
2014
					os.chmod(mysettings["PORT_LOGDIR"],06770)
2011
					if not mysettings.has_key("LOG_PF") or (mysettings["LOG_PF"] != mysettings["PF"]):
2015
					if not mysettings.has_key("LOG_PF") or (mysettings["LOG_PF"] != mysettings["PF"]):
2012
						mysettings["LOG_PF"]=mysettings["PF"]
2016
						mysettings["LOG_PF"]=mysettings["PF"]
2013
						mysettings["LOG_COUNTER"]=str(db[myroot]["vartree"].dbapi.get_counter_tick_core("/"))
2017
						mysettings["LOG_COUNTER"]=str(log_counter)
2014
				except ValueError, e:
2018
				except ValueError, e:
2015
					mysettings["PORT_LOGDIR"]=""
2019
					mysettings["PORT_LOGDIR"]=""
2016
					print "!!! Unable to chown/chmod PORT_LOGDIR. Disabling logging."
2020
					print "!!! Unable to chown/chmod PORT_LOGDIR. Disabling logging."
Lines 5133-5141 Link Here
5133
					myebuildpath=self.dbdir+"/"+x
5137
					myebuildpath=self.dbdir+"/"+x
5134
					break
5138
					break
5135
5139
5140
		# get counter to use it as LOG_COUNTER for prerm/postrm
5141
		try:
5142
			mycounter = long(self.getstring("COUNTER"))
5143
		except ValueError:
5144
			mycounter = 0
5145
5136
		#do prerm script
5146
		#do prerm script
5137
		if myebuildpath and os.path.exists(myebuildpath):
5147
		if myebuildpath and os.path.exists(myebuildpath):
5138
			a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup)
5148
			a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,log_counter=mycounter)
5139
			# XXX: Decide how to handle failures here.
5149
			# XXX: Decide how to handle failures here.
5140
			if a != 0:
5150
			if a != 0:
5141
				writemsg("!!! FAILED prerm: "+str(a)+"\n")
5151
				writemsg("!!! FAILED prerm: "+str(a)+"\n")
Lines 5352-5358 Link Here
5352
		if myebuildpath and os.path.exists(myebuildpath):
5362
		if myebuildpath and os.path.exists(myebuildpath):
5353
			# XXX: This should be the old config, not the current one.
5363
			# XXX: This should be the old config, not the current one.
5354
			# XXX: Use vardbapi to load up env vars.
5364
			# XXX: Use vardbapi to load up env vars.
5355
			a=doebuild(myebuildpath,"postrm",self.myroot,self.settings)
5365
			a=doebuild(myebuildpath,"postrm",self.myroot,self.settings,log_counter=mycounter)
5356
			# XXX: Decide how to handle failures here.
5366
			# XXX: Decide how to handle failures here.
5357
			if a != 0:
5367
			if a != 0:
5358
				writemsg("!!! FAILED postrm: "+str(a)+"\n")
5368
				writemsg("!!! FAILED postrm: "+str(a)+"\n")
Lines 5531-5539 Link Here
5531
		if myebuild:
5531
		if myebuild:
5532
			# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg
5532
			# if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg
5533
			# (if any).
5533
			# (if any).
5534
			a=doebuild(myebuild,"postinst",root,self.settings)
5534
			a=doebuild(myebuild,"postinst",root,self.settings,log_counter=counter)
5535
		else:
5535
		else:
5536
			a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings)
5536
			a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,log_counter=counter)
5537
5537
5538
		# XXX: Decide how to handle failures here.
5538
		# XXX: Decide how to handle failures here.
5539
		if a != 0:
5539
		if a != 0:

Return to bug 37498