Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 151653
Collapse All | Expand All

(-)bin/emerge (-2 / +25 lines)
Lines 4073-4081 Link Here
4073
						if y not in pkgmap[mykey]["selected"]:
4073
						if y not in pkgmap[mykey]["selected"]:
4074
							pkgmap[mykey]["selected"].append(y)
4074
							pkgmap[mykey]["selected"].append(y)
4075
							numselected=numselected+len(mymatch)
4075
							numselected=numselected+len(mymatch)
4076
	
4076
			elif unmerge_action == "prune":
4077
				if len(mymatch) == 1:
4078
					continue
4079
				best_version = mymatch[0]
4080
				best_slot = vartree.getslot(best_version)
4081
				best_counter = vartree.dbapi.cpv_counter(best_version)
4082
				for mypkg in mymatch[1:]:
4083
					myslot = vartree.getslot(mypkg)
4084
					mycounter = vartree.dbapi.cpv_counter(mypkg)
4085
					if (myslot == best_slot and mycounter > best_counter) or \
4086
						mypkg == portage.best([mypkg, best_version]):
4087
						if myslot == best_slot:
4088
							if mycounter < best_counter:
4089
								# On slot collision, keep the one with the
4090
								# highest counter since it is the most
4091
								# recently installed.
4092
								continue
4093
						best_version = mypkg
4094
						best_slot = myslot
4095
						best_counter = mycounter
4096
				pkgmap[mykey]["protected"].append(best_version)
4097
				pkgmap[mykey]["selected"] = [mypkg for mypkg in mymatch \
4098
					if mypkg != best_version]
4099
				numselected = numselected + len(pkgmap[mykey]["selected"])
4077
			else:
4100
			else:
4078
				#unmerge_action in ["prune", clean"]
4101
				# unmerge_action == "clean"
4079
				slotmap={}
4102
				slotmap={}
4080
				for mypkg in mymatch:
4103
				for mypkg in mymatch:
4081
					if unmerge_action=="clean":
4104
					if unmerge_action=="clean":

Return to bug 151653