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

Collapse All | Expand All

(-)a/pym/_emerge/depgraph.py (+24 lines)
Lines 527-532 class depgraph(object): Link Here
527
		self._event_loop = (portage._internal_caller and
527
		self._event_loop = (portage._internal_caller and
528
			global_event_loop() or EventLoop(main=False))
528
			global_event_loop() or EventLoop(main=False))
529
529
530
		self._select_atoms_parent = None
531
530
		self.query = UserQuery(myopts).query
532
		self.query = UserQuery(myopts).query
531
533
532
	def _load_vdb(self):
534
	def _load_vdb(self):
Lines 4062-4072 class depgraph(object): Link Here
4062
			self._dynamic_config._autounmask = False
4064
			self._dynamic_config._autounmask = False
4063
			# backup state for restoration, in case of recursive
4065
			# backup state for restoration, in case of recursive
4064
			# calls to this method
4066
			# calls to this method
4067
			backup_parent = self._select_atoms_parent
4065
			backup_state = mytrees.copy()
4068
			backup_state = mytrees.copy()
4066
			try:
4069
			try:
4067
				# clear state from previous call, in case this
4070
				# clear state from previous call, in case this
4068
				# call is recursive (we have a backup, that we
4071
				# call is recursive (we have a backup, that we
4069
				# will use to restore it later)
4072
				# will use to restore it later)
4073
				self._select_atoms_parent = None
4070
				mytrees.pop("pkg_use_enabled", None)
4074
				mytrees.pop("pkg_use_enabled", None)
4071
				mytrees.pop("parent", None)
4075
				mytrees.pop("parent", None)
4072
				mytrees.pop("atom_graph", None)
4076
				mytrees.pop("atom_graph", None)
Lines 4074-4079 class depgraph(object): Link Here
4074
4078
4075
				mytrees["pkg_use_enabled"] = self._pkg_use_enabled
4079
				mytrees["pkg_use_enabled"] = self._pkg_use_enabled
4076
				if parent is not None:
4080
				if parent is not None:
4081
					self._select_atoms_parent = parent
4077
					mytrees["parent"] = parent
4082
					mytrees["parent"] = parent
4078
					mytrees["atom_graph"] = atom_graph
4083
					mytrees["atom_graph"] = atom_graph
4079
				if priority is not None:
4084
				if priority is not None:
Lines 4085-4090 class depgraph(object): Link Here
4085
			finally:
4090
			finally:
4086
				# restore state
4091
				# restore state
4087
				self._dynamic_config._autounmask = _autounmask_backup
4092
				self._dynamic_config._autounmask = _autounmask_backup
4093
				self._select_atoms_parent = backup_parent
4088
				mytrees.pop("pkg_use_enabled", None)
4094
				mytrees.pop("pkg_use_enabled", None)
4089
				mytrees.pop("parent", None)
4095
				mytrees.pop("parent", None)
4090
				mytrees.pop("atom_graph", None)
4096
				mytrees.pop("atom_graph", None)
Lines 8529-8534 class _dep_check_composite_db(dbapi): Link Here
8529
				elif not self._depgraph._equiv_ebuild_visible(pkg):
8535
				elif not self._depgraph._equiv_ebuild_visible(pkg):
8530
					return False
8536
					return False
8531
8537
8538
		if pkg.cp.startswith("virtual/"):
8539
			# Force virtual updates to be pulled in when appropriate
8540
			# for bug #526160.
8541
			want_update = False
8542
			if self._depgraph._select_atoms_parent is not None:
8543
				want_update = \
8544
					self._depgraph._want_update_pkg(
8545
					self._depgraph._select_atoms_parent, pkg)
8546
8547
			if want_update:
8548
				for new_child in self._depgraph._iter_similar_available(
8549
					pkg, next(iter(atom_set))):
8550
					if not self._depgraph._virt_deps_visible(
8551
						new_child, ignore_use=True):
8552
						continue
8553
					if pkg < new_child:
8554
						return False
8555
8532
		in_graph = next(self._depgraph._dynamic_config._package_tracker.match(
8556
		in_graph = next(self._depgraph._dynamic_config._package_tracker.match(
8533
			self._root, pkg.slot_atom, installed=False), None)
8557
			self._root, pkg.slot_atom, installed=False), None)
8534
8558
(-)a/pym/portage/tests/resolver/test_virtual_slot.py (-1 / +66 lines)
Lines 92-97 class VirtualSlotResolverTestCase(TestCase): Link Here
92
		finally:
92
		finally:
93
			playground.cleanup()
93
			playground.cleanup()
94
94
95
	def testVirtualSubslotUpdate(self):
96
97
		ebuilds = {
98
			"virtual/pypy-2.3.1" : {
99
				"EAPI": "5",
100
				"SLOT": "0/2.3",
101
				"RDEPEND": "|| ( >=dev-python/pypy-2.3.1:0/2.3 >=dev-python/pypy-bin-2.3.1:0/2.3 ) "
102
			},
103
			"virtual/pypy-2.4.0" : {
104
				"EAPI": "5",
105
				"SLOT": "0/2.4",
106
				"RDEPEND": "|| ( >=dev-python/pypy-2.4.0:0/2.4 >=dev-python/pypy-bin-2.4.0:0/2.4 ) "
107
			},
108
			"dev-python/pypy-2.3.1": {
109
				"EAPI": "5",
110
				"SLOT": "0/2.3"
111
			},
112
			"dev-python/pypy-2.4.0": {
113
				"EAPI": "5",
114
				"SLOT": "0/2.4"
115
			},
116
			"dev-python/pygments-1.6_p20140324-r1": {
117
				"EAPI": "5",
118
				"DEPEND": "virtual/pypy:="
119
			}
120
		}
121
122
		installed = {
123
			"virtual/pypy-2.3.1" : {
124
				"EAPI": "5",
125
				"SLOT": "0/2.3",
126
				"RDEPEND": "|| ( >=dev-python/pypy-2.3.1:0/2.3 >=dev-python/pypy-bin-2.3.1:0/2.3 ) "
127
			},
128
			"dev-python/pypy-2.3.1": {
129
				"EAPI": "5",
130
				"SLOT": "0/2.3"
131
			},
132
			"dev-python/pygments-1.6_p20140324-r1": {
133
				"EAPI": "5",
134
				"DEPEND": "virtual/pypy:0/2.3=",
135
				"RDEPEND": "virtual/pypy:0/2.3=",
136
			}
137
		}
138
139
		world = ["dev-python/pygments"]
140
141
		test_cases = (
142
			# bug 526160 - test for missed pypy sub-slot update
143
			ResolverPlaygroundTestCase(
144
				["@world"],
145
				options = {"--update": True, "--deep": True},
146
				success=True,
147
				mergelist = ['dev-python/pypy-2.4.0',
148
					'virtual/pypy-2.4.0',
149
					'dev-python/pygments-1.6_p20140324-r1']),
150
		)
151
152
		playground = ResolverPlayground(debug=False, ebuilds=ebuilds,
153
			installed=installed, world=world)
154
		try:
155
			for test_case in test_cases:
156
				playground.run_TestCase(test_case)
157
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
158
		finally:
159
			playground.cleanup()
160
95
	def testVirtualSlotDepclean(self):
161
	def testVirtualSlotDepclean(self):
96
162
97
		ebuilds = {
163
		ebuilds = {
98
- 

Return to bug 526160