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 52-57 Link Here
52
"--quiet",        "--resume",
52
"--quiet",        "--resume",
53
"--searchdesc",   "--selective",
53
"--searchdesc",   "--selective",
54
"--skipfirst",
54
"--skipfirst",
55
"--tree",
55
"--update",       "--upgradeonly",
56
"--update",       "--upgradeonly",
56
"--usepkg",       "--usepkgonly",
57
"--usepkg",       "--usepkgonly",
57
"--verbose",      "--version"
58
"--verbose",      "--version"
Lines 73-78 Link Here
73
"p":"--pretend",   "P":"--prune",
74
"p":"--pretend",   "P":"--prune",
74
"q":"--quiet",
75
"q":"--quiet",
75
"s":"--search",    "S":"--searchdesc",
76
"s":"--search",    "S":"--searchdesc",
77
't':"--tree",
76
"u":"--update",    "U":"--upgradeonly",
78
"u":"--update",    "U":"--upgradeonly",
77
"v":"--verbose",   "V":"--version"
79
"v":"--verbose",   "V":"--version"
78
}
80
}
Lines 152-157 Link Here
152
	print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both."
154
	print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both."
153
	sys.exit(1)
155
	sys.exit(1)
154
156
157
if ("--tree" in myopts) and ("--columns" in myopts):
158
	print "emerge: can't specify both of \"--tree\" and \"--columns\"."
159
	sys.exit(1)
160
155
# Always create packages if FEATURES=buildpkg
161
# Always create packages if FEATURES=buildpkg
156
# Imply --buildpkg if --buildpkgonly
162
# Imply --buildpkg if --buildpkgonly
157
if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts):
163
if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts):
Lines 1000-1005 Link Here
1000
	
1006
	
1001
	def display(self,mylist):
1007
	def display(self,mylist):
1002
		changelogs=[]
1008
		changelogs=[]
1009
		p=[]
1010
		intree=False
1011
		
1003
		for x in mylist:
1012
		for x in mylist:
1004
			#print x
1013
			#print x
1005
			fetch=" "
1014
			fetch=" "
Lines 1020-1026 Link Here
1020
						print
1029
						print
1021
			else:
1030
			else:
1022
				if x[3]=="nomerge":
1031
				if x[3]=="nomerge":
1023
					continue
1032
					if ("--tree" in myopts):
1033
						if (not intree):
1034
							continue
1035
					else:
1036
						continue
1024
1037
1025
				if ("fetch" in string.split(portage.portdb.aux_get(x[2],["RESTRICT"])[0])):
1038
				if ("fetch" in string.split(portage.portdb.aux_get(x[2],["RESTRICT"])[0])):
1026
					fetch = red("F")
1039
					fetch = red("F")
Lines 1085-1093 Link Here
1085
				oldlp=mywidth-30
1098
				oldlp=mywidth-30
1086
				newlp=oldlp-30
1099
				newlp=oldlp-30
1087
				
1100
				
1101
				mygraph = self.digraph.copy()
1102
				indent=""
1103
				if ("--tree" in myopts):
1104
					indent=" "*mygraph.depth(string.join(x))
1105
					if indent=="":
1106
						intree=False
1107
					else:
1108
						intree=True
1109
						
1110
1088
				if x[1]!="/":
1111
				if x[1]!="/":
1089
					if "--columns" in myopts:
1112
					if "--columns" in myopts:
1090
						myprint="["+x[0]+" "+addl+"] "+darkgreen(xs[0])
1113
						myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0])
1091
						if (newlp-len(myprint)) > 0:
1114
						if (newlp-len(myprint)) > 0:
1092
							myprint=myprint+(" "*(newlp-len(myprint)))
1115
							myprint=myprint+(" "*(newlp-len(myprint)))
1093
						myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] "
1116
						myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] "
Lines 1099-1105 Link Here
1099
						myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+iuse
1122
						myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+iuse
1100
				else:
1123
				else:
1101
					if "--columns" in myopts:
1124
					if "--columns" in myopts:
1102
						myprint="["+x[0]+" "+addl+"] "+darkgreen(xs[0])
1125
						myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0])
1103
						if (newlp-len(myprint)) > 0:
1126
						if (newlp-len(myprint)) > 0:
1104
							myprint=myprint+(" "*(newlp-len(myprint)))
1127
							myprint=myprint+(" "*(newlp-len(myprint)))
1105
						myprint=myprint+green(" ["+xs[1]+xs[2]+"] ")
1128
						myprint=myprint+green(" ["+xs[1]+xs[2]+"] ")
Lines 1107-1135 Link Here
1107
							myprint=myprint+(" "*(oldlp-len(myprint)))
1130
							myprint=myprint+(" "*(oldlp-len(myprint)))
1108
						myprint=myprint+myoldbest+"  "+iuse
1131
						myprint=myprint+myoldbest+"  "+iuse
1109
					else:
1132
					else:
1110
						myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+iuse
1133
						if x[3]=="nomerge":
1111
				print myprint
1134
							myprint=darkblue("[nomerge      ] "+indent+x[2]+" "+myoldbest+" ")+iuse
1135
						else:
1136
							myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+iuse
1137
				p.append(myprint)
1112
1138
1113
			mysplit=portage.pkgsplit(x[2])
1139
			if ("--tree" not in myopts):
1114
			# XXX mysplit _can_ be None.... Why?
1140
				mysplit=portage.pkgsplit(x[2])
1115
			if mysplit and (len(mysplit)==3):
1141
	
1116
				if "--emptytree" not in myopts:
1142
				# XXX mysplit _can_ be None.... Why?
1117
					if mysplit[0]=="sys-apps/portage":
1143
				if mysplit and (len(mysplit)==3):
1118
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1144
					if "--emptytree" not in myopts:
1119
							if mylist.index(x)<len(mylist)-1:
1145
						if mysplit[0]=="sys-apps/portage":
1120
								print red("*** Portage will stop merging at this point and reload itself,")
1146
							if mysplit[1]+mysplit[2]!=portage.VERSION:
1121
								print red("    recalculate dependencies, and complete the merge.")
1147
								if mylist.index(x)<len(mylist)-1:
1122
								if "--update" not in myopts:
1148
									p.append(red("*** Portage will stop merging at this point and reload itself,"))
1123
									print darkgreen("    You may avoid the remerging of packages by updating portage on its own.")
1149
									p.append(red("    recalculate dependencies, and complete the merge."))
1124
								print
1150
									if "--update" not in myopts:
1125
				else:
1151
										p.append(darkgreen("    You may avoid the remerging of packages by updating portage on its own."))
1126
					if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts):
1152
									print
1127
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1153
					else:
1128
							print red("***")+" Please update portage to the above version before proceeding."
1154
						if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts):
1129
							print "    Failure to do so may result in failed or improper merges."
1155
							if mysplit[1]+mysplit[2]!=portage.VERSION:
1130
							print "    A simple '"+green("emerge -u portage")+"' is sufficient."
1156
								p.append(red("***")+" Please update portage to the above version before proceeding.")
1131
							print
1157
								p.append("    Failure to do so may result in failed or improper merges.")
1132
			del mysplit
1158
								p.append("    A simple '"+green("emerge -u portage")+"' is sufficient.")
1159
								p.append("")
1160
				del mysplit
1161
1162
		if ("--tree" in myopts):
1163
			p.reverse()
1164
1165
		for x in p:
1166
			print x
1133
1167
1134
 		if "--changelog" in myopts:
1168
 		if "--changelog" in myopts:
1135
 			print
1169
 			print
(-)portage.py.org (-1 / +8 lines)
Lines 370-376 Link Here
370
		for x in self.okeys:
370
		for x in self.okeys:
371
			if self.dict[x][0]==0:
371
			if self.dict[x][0]==0:
372
				return x
372
				return x
373
		return None 
373
		return None
374
375
	def depth(self, mykey):
376
		depth=0
377
		while (self.dict[mykey][1]):
378
			depth=depth+1
379
			mykey=self.dict[mykey][1][0]
380
		return depth
374
381
375
	def allzeros(self):
382
	def allzeros(self):
376
		"returns all nodes with zero references, or NULL if no such node exists"
383
		"returns all nodes with zero references, or NULL if no such node exists"

Return to bug 4229