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

(-)a/pym/portage/dep/dep_check.py (-5 / +4 lines)
Lines 429-439 def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): Link Here
429
						all_in_graph = False
429
						all_in_graph = False
430
						break
430
						break
431
				circular_atom = None
431
				circular_atom = None
432
				if all_in_graph:
432
				if not (parent is None or priority is None) and \
433
					if parent is None or priority is None:
433
					(parent.onlydeps or
434
						pass
434
					(all_in_graph and priority.buildtime and \
435
					elif priority.buildtime and \
435
					not (priority.satisfied or priority.optional))):
436
						not (priority.satisfied or priority.optional):
437
						# Check if the atom would result in a direct circular
436
						# Check if the atom would result in a direct circular
438
						# dependency and try to avoid that if it seems likely
437
						# dependency and try to avoid that if it seems likely
439
						# to be unresolvable. This is only relevant for
438
						# to be unresolvable. This is only relevant for
(-)a/pym/portage/tests/resolver/test_onlydeps_circular.py (-1 / +49 lines)
Line 0 Link Here
0
- 
1
# Copyright 2014 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
4
from portage.tests import TestCase
5
from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
6
7
class OnlydepsTestCase(TestCase):
8
9
	def testOnlydeps(self):
10
		ebuilds = {
11
			"app-misc/A-1": {
12
				"EAPI": "5",
13
				"SLOT": "1",
14
				"DEPEND": "|| ( app-misc/B app-misc/A:1 )"
15
			},
16
			"app-misc/A-2": {
17
				"EAPI": "5",
18
				"SLOT": "2",
19
			},
20
			"app-misc/B-0": {
21
				"EAPI": "5",
22
			}
23
		}
24
25
		installed = {
26
			"app-misc/A-2": {
27
				"EAPI": "5",
28
				"SLOT": "2",
29
			}
30
		}
31
32
		test_cases = (
33
			# bug 524916 - direct circular dep should not pull
34
			# in an onlydeps node when possible
35
			ResolverPlaygroundTestCase(
36
				["app-misc/A:1"],
37
				success = True,
38
				options = { "--onlydeps": True },
39
				mergelist = ["app-misc/B-0"]),
40
		)
41
42
		playground = ResolverPlayground(ebuilds=ebuilds,
43
			installed=installed, debug=False)
44
		try:
45
			for test_case in test_cases:
46
				playground.run_TestCase(test_case)
47
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
48
		finally:
49
			playground.cleanup()

Return to bug 524916