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

Collapse All | Expand All

(-)emerge.old (-1 / +26 lines)
Lines 6-12 Link Here
6
import os
6
import os
7
os.environ["PORTAGE_CALLER"]="emerge"
7
os.environ["PORTAGE_CALLER"]="emerge"
8
8
9
import sys,portage,emergehelp,xpak,string,re,commands,time,threading,shutil,traceback,atexit
9
import sys,portage,emergehelp,xpak,string,re,commands,time,threading,shutil,traceback,atexit,tempfile
10
from stat import *
10
from stat import *
11
from output import *
11
from output import *
12
if (not sys.stdout.isatty()) or (portage.settings["NOCOLOR"] in ["yes","true"]):
12
if (not sys.stdout.isatty()) or (portage.settings["NOCOLOR"] in ["yes","true"]):
Lines 180-185 Link Here
180
	portage.settings["PORTAGE_DEBUG"]="1"
180
	portage.settings["PORTAGE_DEBUG"]="1"
181
	portage.debug=1
181
	portage.debug=1
182
182
183
if ("--verbose" in myopts) and myaction in [None, "unmerge", "system", "world"]:
184
	portage.settings["MSG_FILE"] = tempfile.mktemp()
183
185
184
def emergelog(mystr):
186
def emergelog(mystr):
185
	if "notitles" not in portage.features:
187
	if "notitles" not in portage.features:
Lines 194-199 Link Here
194
			print "emergelog():",e
196
			print "emergelog():",e
195
		pass
197
		pass
196
198
199
def msglog(mystr):
200
	if portage.settings.has_key("MSG_FILE"):
201
		try:
202
			mylogfile=open(portage.settings['MSG_FILE'], "a")
203
			mylogfile.write(">>> " + mystr + "\n")
204
			mylogfile.flush()
205
			mylogfile.close()
206
		except Exception, e:
207
			if edebug:
208
				print "msglog():",e
209
			pass
210
197
def emergeexit():
211
def emergeexit():
198
	"""This gets out final log message in before we quit. As it overrides
212
	"""This gets out final log message in before we quit. As it overrides
199
	any other atexit's we have setup, we need to call them ourself."""
213
	any other atexit's we have setup, we need to call them ourself."""
Lines 1164-1169 Link Here
1164
			if not "--pretend" in myopts:
1178
			if not "--pretend" in myopts:
1165
				print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1]
1179
				print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1]
1166
				emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1])
1180
				emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1])
1181
				msglog(x[pkgindex])
1167
			if x[0] in ["ebuild","blocks"]:
1182
			if x[0] in ["ebuild","blocks"]:
1168
				if ("--fetchonly" in myopts) or (x[0]=="blocks"):
1183
				if ("--fetchonly" in myopts) or (x[0]=="blocks"):
1169
					retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1)
1184
					retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1)
Lines 1443-1448 Link Here
1443
			mysplit=string.split(y,"/")
1458
			mysplit=string.split(y,"/")
1444
			#unmerge...
1459
			#unmerge...
1445
			retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,unmerge_action not in ["clean","prune"])
1460
			retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,unmerge_action not in ["clean","prune"])
1461
			msglog(y)
1446
			if retval:
1462
			if retval:
1447
				emergelog(" !!! unmerge FAILURE: "+y)
1463
				emergelog(" !!! unmerge FAILURE: "+y)
1448
			else:
1464
			else:
Lines 1553-1558 Link Here
1553
			#print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files."
1569
			#print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files."
1554
			print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files."
1570
			print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files."
1555
		print
1571
		print
1572
1573
	if portage.settings.has_key("MSG_FILE"):
1574
		if os.path.exists(portage.settings['MSG_FILE']):
1575
			print ">>> These messages were found during the emerge action."
1576
			msg_file=open(portage.settings['MSG_FILE'], "r")
1577
			print msg_file.read()
1578
			msg_file.close();
1579
			os.remove(portage.settings["MSG_FILE"]);
1580
1556
	sys.exit(retval)
1581
	sys.exit(retval)
1557
1582
1558
# general options that should be taken into account before any action
1583
# general options that should be taken into account before any action

Return to bug 22471