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

Collapse All | Expand All

(-)emerge.org (-25 / +59 lines)
Lines 53-58 Link Here
53
"--quiet",        "--resume",
53
"--quiet",        "--resume",
54
"--searchdesc",   "--selective",
54
"--searchdesc",   "--selective",
55
"--skipfirst",
55
"--skipfirst",
56
"--tree",
56
"--update",       "--upgradeonly",
57
"--update",       "--upgradeonly",
57
"--usepkg",       "--usepkgonly",
58
"--usepkg",       "--usepkgonly",
58
"--verbose",      "--version"
59
"--verbose",      "--version"
Lines 74-79 Link Here
74
"p":"--pretend",   "P":"--prune",
75
"p":"--pretend",   "P":"--prune",
75
"q":"--quiet",
76
"q":"--quiet",
76
"s":"--search",    "S":"--searchdesc",
77
"s":"--search",    "S":"--searchdesc",
78
't':"--tree",
77
"u":"--update",    "U":"--upgradeonly",
79
"u":"--update",    "U":"--upgradeonly",
78
"v":"--verbose",   "V":"--version"
80
"v":"--verbose",   "V":"--version"
79
}
81
}
Lines 153-158 Link Here
153
	print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both."
155
	print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both."
154
	sys.exit(1)
156
	sys.exit(1)
155
157
158
if ("--tree" in myopts) and ("--columns" in myopts):
159
	print "emerge: can't specify both of \"--tree\" and \"--columns\"."
160
	sys.exit(1)
161
156
# Always create packages if FEATURES=buildpkg
162
# Always create packages if FEATURES=buildpkg
157
# Imply --buildpkg if --buildpkgonly
163
# Imply --buildpkg if --buildpkgonly
158
if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts):
164
if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts):
Lines 1071-1076 Link Here
1071
	
1077
	
1072
	def display(self,mylist):
1078
	def display(self,mylist):
1073
		changelogs=[]
1079
		changelogs=[]
1080
		p=[]
1081
		intree=False
1082
		
1074
		for x in mylist:
1083
		for x in mylist:
1075
			fetch=" "
1084
			fetch=" "
1076
			
1085
			
Lines 1090-1096 Link Here
1090
						print
1099
						print
1091
			else:
1100
			else:
1092
				if x[-1]=="nomerge":
1101
				if x[-1]=="nomerge":
1093
					continue
1102
	 				if ("--tree" in myopts):
1103
	 					if (not intree):
1104
 							continue
1105
 					else:
1106
 						continue
1094
1107
1095
				if (x[0]!="binary") and ("fetch" in string.split(portage.portdb.aux_get(x[2],["RESTRICT"])[0])):
1108
				if (x[0]!="binary") and ("fetch" in string.split(portage.portdb.aux_get(x[2],["RESTRICT"])[0])):
1096
					fetch = red("F")
1109
					fetch = red("F")
Lines 1154-1162 Link Here
1154
				oldlp=mywidth-30
1167
				oldlp=mywidth-30
1155
				newlp=oldlp-30
1168
				newlp=oldlp-30
1156
				
1169
				
1170
				mygraph = self.digraph.copy()
1171
				indent=""
1172
				if ("--tree" in myopts):
1173
					indent=" "*mygraph.depth(string.join(x))
1174
					if indent=="":
1175
						intree=False
1176
					else:
1177
						intree=True
1178
						
1179
1157
				if x[1]!="/":
1180
				if x[1]!="/":
1158
					if "--columns" in myopts:
1181
					if "--columns" in myopts:
1159
						myprint="["+x[0]+" "+addl+"] "+darkgreen(xs[0])
1182
						myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0])
1160
						if (newlp-len(myprint)) > 0:
1183
						if (newlp-len(myprint)) > 0:
1161
							myprint=myprint+(" "*(newlp-len(myprint)))
1184
							myprint=myprint+(" "*(newlp-len(myprint)))
1162
						myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] "
1185
						myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] "
Lines 1168-1174 Link Here
1168
						myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+iuse
1191
						myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+iuse
1169
				else:
1192
				else:
1170
					if "--columns" in myopts:
1193
					if "--columns" in myopts:
1171
						myprint="["+x[0]+" "+addl+"] "+darkgreen(xs[0])
1194
						myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0])
1172
						if (newlp-len(myprint)) > 0:
1195
						if (newlp-len(myprint)) > 0:
1173
							myprint=myprint+(" "*(newlp-len(myprint)))
1196
							myprint=myprint+(" "*(newlp-len(myprint)))
1174
						myprint=myprint+green(" ["+xs[1]+xs[2]+"] ")
1197
						myprint=myprint+green(" ["+xs[1]+xs[2]+"] ")
Lines 1176-1204 Link Here
1176
							myprint=myprint+(" "*(oldlp-len(myprint)))
1199
							myprint=myprint+(" "*(oldlp-len(myprint)))
1177
						myprint=myprint+myoldbest+"  "+iuse
1200
						myprint=myprint+myoldbest+"  "+iuse
1178
					else:
1201
					else:
1179
						myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+iuse
1202
						if x[3]=="nomerge":
1180
				print myprint
1203
							myprint=darkblue("[nomerge      ] "+indent+x[2]+" "+myoldbest+" ")+iuse
1204
						else:
1205
							myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+iuse
1206
				p.append(myprint)
1181
1207
1182
			mysplit=portage.pkgsplit(x[2])
1208
			if ("--tree" not in myopts):
1183
			# XXX mysplit _can_ be None.... Why?
1209
				mysplit=portage.pkgsplit(x[2])
1184
			if mysplit and (len(mysplit)==3):
1210
	
1185
				if "--emptytree" not in myopts:
1211
				# XXX mysplit _can_ be None.... Why?
1186
					if mysplit[0]=="sys-apps/portage":
1212
				if mysplit and (len(mysplit)==3):
1187
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1213
					if "--emptytree" not in myopts:
1188
							if mylist.index(x)<len(mylist)-1:
1214
						if mysplit[0]=="sys-apps/portage":
1189
								print red("*** Portage will stop merging at this point and reload itself,")
1215
							if mysplit[1]+mysplit[2]!=portage.VERSION:
1190
								print red("    recalculate dependencies, and complete the merge.")
1216
								if mylist.index(x)<len(mylist)-1:
1191
								if "--update" not in myopts:
1217
									p.append(red("*** Portage will stop merging at this point and reload itself,"))
1192
									print darkgreen("    You may avoid the remerging of packages by updating portage on its own.")
1218
									p.append(red("    recalculate dependencies, and complete the merge."))
1193
								print
1219
									if "--update" not in myopts:
1194
				else:
1220
										p.append(darkgreen("    You may avoid the remerging of packages by updating portage on its own."))
1195
					if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts):
1221
									print
1196
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1222
					else:
1197
							print red("***")+" Please update portage to the above version before proceeding."
1223
						if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts):
1198
							print "    Failure to do so may result in failed or improper merges."
1224
							if mysplit[1]+mysplit[2]!=portage.VERSION:
1199
							print "    A simple '"+green("emerge -u portage")+"' is sufficient."
1225
								p.append(red("***")+" Please update portage to the above version before proceeding.")
1200
							print
1226
								p.append("    Failure to do so may result in failed or improper merges.")
1201
			del mysplit
1227
								p.append("    A simple '"+green("emerge -u portage")+"' is sufficient.")
1228
								p.append("")
1229
				del mysplit
1230
1231
		if ("--tree" in myopts):
1232
			p.reverse()
1233
1234
		for x in p:
1235
			print x
1202
1236
1203
		if "--changelog" in myopts:
1237
		if "--changelog" in myopts:
1204
			print
1238
			print
(-)portage.py.org (-1 / +8 lines)
Lines 395-401 Link Here
395
		for x in self.okeys:
395
		for x in self.okeys:
396
			if self.dict[x][0]==0:
396
			if self.dict[x][0]==0:
397
				return x
397
				return x
398
		return None 
398
		return None
399
400
	def depth(self, mykey):
401
		depth=0
402
		while (self.dict[mykey][1]):
403
			depth=depth+1
404
			mykey=self.dict[mykey][1][0]
405
		return depth
399
406
400
	def allzeros(self):
407
	def allzeros(self):
401
		"returns all nodes with zero references, or NULL if no such node exists"
408
		"returns all nodes with zero references, or NULL if no such node exists"

Return to bug 4229