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

(-)pym/_emerge/__init__.py (-3 / +47 lines)
Lines 6536-6541 Link Here
6536
	global_unmerge=0
6536
	global_unmerge=0
6537
	xterm_titles = "notitles" not in settings.features
6537
	xterm_titles = "notitles" not in settings.features
6538
6538
6539
	pkg_cache = {}
6540
6541
	def _pkg(cpv):
6542
		pkg = pkg_cache.get(cpv)
6543
		if pkg is None:
6544
			pkg = Package(cpv=cpv, installed=True,
6545
				metadata=izip(Package.metadata_keys,
6546
					vartree.dbapi.aux_get(cpv, Package.metadata_keys)),
6547
				root_config=root_config,
6548
				type_name="installed")
6549
			pkg_cache[cpv] = pkg
6550
		return pkg
6551
6539
	vdb_path = os.path.join(settings["ROOT"], portage.VDB_PATH)
6552
	vdb_path = os.path.join(settings["ROOT"], portage.VDB_PATH)
6540
	try:
6553
	try:
6541
		# At least the parent needs to exist for the lock file.
6554
		# At least the parent needs to exist for the lock file.
Lines 6778-6783 Link Here
6778
	# relevant package sets.
6791
	# relevant package sets.
6779
	for cp in xrange(len(pkgmap)):
6792
	for cp in xrange(len(pkgmap)):
6780
		for cpv in pkgmap[cp]["selected"].copy():
6793
		for cpv in pkgmap[cp]["selected"].copy():
6794
			try:
6795
				pkg = _pkg(cpv)
6796
			except KeyError:
6797
				# It could have been uninstalled
6798
				# by a concurrent process.
6799
				continue
6781
			parents = []
6800
			parents = []
6782
			for s in installed_sets:
6801
			for s in installed_sets:
6783
				# skip sets that the user requested to unmerge, and skip world 
6802
				# skip sets that the user requested to unmerge, and skip world 
Lines 6788-6796 Link Here
6788
				# only check instances of EditablePackageSet as other classes are generally used for
6807
				# only check instances of EditablePackageSet as other classes are generally used for
6789
				# special purposes and can be ignored here (and are usually generated dynamically, so the
6808
				# special purposes and can be ignored here (and are usually generated dynamically, so the
6790
				# user can't do much about them anyway)
6809
				# user can't do much about them anyway)
6791
				elif sets[s].containsCPV(cpv) \
6810
				if isinstance(sets[s], EditablePackageSet):
6792
					and isinstance(sets[s], EditablePackageSet):
6811
6793
					parents.append(s)
6812
					# This is derived from a snippet of code in the
6813
					# depgraph._iter_atoms_for_pkg() method.
6814
					for atom in sets[s].iterAtomsForPackage(pkg):
6815
						inst_matches = vartree.dbapi.match(atom)
6816
						inst_matches.reverse() # descending order
6817
						higher_slot = None
6818
						for inst_cpv in inst_matches:
6819
							try:
6820
								inst_pkg = _pkg(inst_cpv)
6821
							except KeyError:
6822
								# It could have been uninstalled
6823
								# by a concurrent process.
6824
								continue
6825
6826
							if inst_pkg.cp != atom.cp:
6827
								continue
6828
							if pkg >= inst_pkg:
6829
								# This is descending order, and we're not
6830
								# interested in any versions <= pkg given.
6831
								break
6832
							if pkg.slot_atom != inst_pkg.slot_atom:
6833
								higher_slot = inst_pkg
6834
								break
6835
						if higher_slot is None:
6836
							parents.append(s)
6837
							break
6794
			if parents:
6838
			if parents:
6795
				#print colorize("WARN", "Package %s is going to be unmerged," % cpv)
6839
				#print colorize("WARN", "Package %s is going to be unmerged," % cpv)
6796
				#print colorize("WARN", "but still listed in the following package sets:")
6840
				#print colorize("WARN", "but still listed in the following package sets:")

Return to bug 226307