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

(-)pym/portage/__init__.py (-15 / +13 lines)
Lines 7050-7059 Link Here
7050
	# c) contains masked installed packages
7050
	# c) contains masked installed packages
7051
	# d) is the first item
7051
	# d) is the first item
7052
7052
7053
	preferred = []
7053
	preferred_installed = []
7054
	preferred_not_installed = []
7054
	preferred_in_graph = []
7055
	preferred_any_slot = []
7055
	preferred_any_slot = []
7056
	possible_upgrades = []
7056
	preferred_non_installed = []
7057
	other = []
7057
	other = []
7058
7058
7059
	# Alias the trees we'll be checking availability against
7059
	# Alias the trees we'll be checking availability against
Lines 7067-7081 Link Here
7067
	else:
7067
	else:
7068
		mydbapi = trees[myroot]["porttree"].dbapi
7068
		mydbapi = trees[myroot]["porttree"].dbapi
7069
7069
7070
	# Sort the deps into preferred (installed) and other
7070
	# Sort the deps into installed, not installed but already 
7071
	# with values of [[required_atom], availablility]
7071
	# in the graph and other, not installed and not in the graph
7072
	# and other, with values of [[required_atom], availablility]
7072
	for dep, satisfied in izip(deps, satisfieds):
7073
	for dep, satisfied in izip(deps, satisfieds):
7073
		if isinstance(dep, list):
7074
		if isinstance(dep, list):
7074
			atoms = dep_zapdeps(dep, satisfied, myroot,
7075
			atoms = dep_zapdeps(dep, satisfied, myroot,
7075
				use_binaries=use_binaries, trees=trees)
7076
				use_binaries=use_binaries, trees=trees)
7076
		else:
7077
		else:
7077
			atoms = [dep]
7078
			atoms = [dep]
7078
7079
		if not vardb:
7079
		if not vardb:
7080
			# called by repoman
7080
			# called by repoman
7081
			other.append((atoms, None, False))
7081
			other.append((atoms, None, False))
Lines 7100-7107 Link Here
7100
		this_choice = (atoms, versions, all_available)
7100
		this_choice = (atoms, versions, all_available)
7101
		if all_available:
7101
		if all_available:
7102
			# The "all installed" criterion is not version or slot specific.
7102
			# The "all installed" criterion is not version or slot specific.
7103
			# If any version of a package is installed then we assume that it
7103
			# If any version of a package is already in the graph then we 
7104
			# is preferred over other possible packages choices.
7104
			#assume that it is preferred over other possible packages choices.
7105
			all_installed = True
7105
			all_installed = True
7106
			for atom in set([dep_getkey(atom) for atom in atoms \
7106
			for atom in set([dep_getkey(atom) for atom in atoms \
7107
				if atom[:1] != "!"]):
7107
				if atom[:1] != "!"]):
Lines 7120-7126 Link Here
7120
						break
7120
						break
7121
			if all_installed:
7121
			if all_installed:
7122
				if all_installed_slots:
7122
				if all_installed_slots:
7123
					preferred.append(this_choice)
7123
					preferred_installed.append(this_choice)
7124
				else:
7124
				else:
7125
					preferred_any_slot.append(this_choice)
7125
					preferred_any_slot.append(this_choice)
7126
			elif graph_db is None:
7126
			elif graph_db is None:
Lines 7135-7141 Link Here
7135
						break
7135
						break
7136
				if all_in_graph:
7136
				if all_in_graph:
7137
					if parent is None:
7137
					if parent is None:
7138
						preferred_not_installed.append(this_choice)
7138
						preferred_in_graph.append(this_choice)
7139
					else:
7139
					else:
7140
						# Check if the atom would result in a direct circular
7140
						# Check if the atom would result in a direct circular
7141
						# dependency and try to avoid that if it seems likely
7141
						# dependency and try to avoid that if it seems likely
Lines 7155-7165 Link Here
7155
								circular_atom = atom
7155
								circular_atom = atom
7156
								break
7156
								break
7157
						if circular_atom is None:
7157
						if circular_atom is None:
7158
							preferred_not_installed.append(this_choice)
7158
							preferred_in_graph.append(this_choice)
7159
						else:
7159
						else:
7160
							other.append(this_choice)
7160
							other.append(this_choice)
7161
				else:
7161
				else:
7162
					possible_upgrades.append(this_choice)
7162
					preferred_non_installed.append(this_choice)
7163
		else:
7163
		else:
7164
			other.append(this_choice)
7164
			other.append(this_choice)
7165
7165
Lines 7169-7177 Link Here
7169
	# into || ( highest version ... lowest version ).  We want to prefer the
7169
	# into || ( highest version ... lowest version ).  We want to prefer the
7170
	# highest all_available version of the new-style virtual when there is a
7170
	# highest all_available version of the new-style virtual when there is a
7171
	# lower all_installed version.
7171
	# lower all_installed version.
7172
	preferred.extend(preferred_not_installed)
7172
	preferred = preferred_in_graph + preferred_installed + preferred_any_slot + preferred_non_installed
7173
	preferred.extend(preferred_any_slot)
7174
	preferred.extend(possible_upgrades)
7175
	possible_upgrades = preferred[1:]
7173
	possible_upgrades = preferred[1:]
7176
	for possible_upgrade in possible_upgrades:
7174
	for possible_upgrade in possible_upgrades:
7177
		atoms, versions, all_available = possible_upgrade
7175
		atoms, versions, all_available = possible_upgrade

Return to bug 275796