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

(-)bin/emerge (-16 / +45 lines)
Lines 629-641 Link Here
629
		levels:
629
		levels:
630
630
631
		MEDIUM   The upper boundary for medium dependencies.
631
		MEDIUM   The upper boundary for medium dependencies.
632
		MEDIUM_SOFT   The upper boundary for medium-soft dependencies.
632
		SOFT     The upper boundary for soft dependencies.
633
		SOFT     The upper boundary for soft dependencies.
633
		MIN      The lower boundary for soft dependencies.
634
		MIN      The lower boundary for soft dependencies.
634
	"""
635
	"""
635
	__slots__ = ("__weakref__", "satisfied", "buildtime", "runtime")
636
	__slots__ = ("__weakref__", "satisfied", "buildtime", "runtime", "runtime_post")
636
	MEDIUM = -1
637
	MEDIUM = -1
637
	SOFT   = -2
638
	MEDIUM_SOFT = -2
638
	MIN    = -4
639
	SOFT   = -3
640
	MIN    = -6
639
	def __init__(self, **kwargs):
641
	def __init__(self, **kwargs):
640
		for myattr in self.__slots__:
642
		for myattr in self.__slots__:
641
			if myattr == "__weakref__":
643
			if myattr == "__weakref__":
Lines 648-658 Link Here
648
				return 0
650
				return 0
649
			if self.runtime:
651
			if self.runtime:
650
				return -1
652
				return -1
653
			if self.runtime_post:
654
				return -2
651
		if self.buildtime:
655
		if self.buildtime:
652
			return -2
656
			return -3
653
		if self.runtime:
657
		if self.runtime:
654
			return -3
658
			return -4
655
		return -4
659
		if self.runtime_post:
660
			return -5
661
		return -6
656
	def __lt__(self, other):
662
	def __lt__(self, other):
657
		return self.__int__() < other
663
		return self.__int__() < other
658
	def __le__(self, other):
664
	def __le__(self, other):
Lines 1303-1309 Link Here
1303
				# Post Depend -- Add to the list without a parent, as it depends
1309
				# Post Depend -- Add to the list without a parent, as it depends
1304
				# on a package being present AND must be built after that package.
1310
				# on a package being present AND must be built after that package.
1305
				if not self.select_dep(myroot, edepend["PDEPEND"], myparent=mp,
1311
				if not self.select_dep(myroot, edepend["PDEPEND"], myparent=mp,
1306
					myuse=myuse, priority=DepPriority(), rev_deps=True,
1312
					myuse=myuse, priority=DepPriority(runtime_post=True),
1307
					parent_arg=arg):
1313
					parent_arg=arg):
1308
					return 0
1314
					return 0
1309
		except ValueError, e:
1315
		except ValueError, e:
Lines 2103-2129 Link Here
2103
					"""Recursively gather a group of nodes that RDEPEND on
2109
					"""Recursively gather a group of nodes that RDEPEND on
2104
					eachother.  This ensures that they are merged as a group
2110
					eachother.  This ensures that they are merged as a group
2105
					and get their RDEPENDs satisfied as soon as possible."""
2111
					and get their RDEPENDs satisfied as soon as possible."""
2106
					def gather_deps(mergeable_nodes, selected_nodes, node):
2112
					def gather_deps(ignore_priority,
2113
						mergeable_nodes, selected_nodes, node):
2107
						if node in selected_nodes:
2114
						if node in selected_nodes:
2108
							return True
2115
							return True
2109
						if node not in mergeable_nodes:
2116
						if node not in mergeable_nodes:
2110
							return False
2117
							return False
2111
						selected_nodes.add(node)
2118
						selected_nodes.add(node)
2112
						for child in mygraph.child_nodes(node,
2119
						for child in mygraph.child_nodes(node,
2113
							ignore_priority=DepPriority.SOFT):
2120
							ignore_priority=ignore_priority):
2114
							if not gather_deps(
2121
							if not gather_deps(ignore_priority,
2115
								mergeable_nodes, selected_nodes, child):
2122
								mergeable_nodes, selected_nodes, child):
2116
								return False
2123
								return False
2117
						return True
2124
						return True
2118
					mergeable_nodes = set(nodes)
2125
					mergeable_nodes = set(nodes)
2119
					for node in nodes:
2126
					for ignore_priority in xrange(DepPriority.SOFT,
2120
						selected_nodes = set()
2127
						DepPriority.MEDIUM_SOFT + 1):
2121
						if gather_deps(
2128
						for node in nodes:
2122
							mergeable_nodes, selected_nodes, node):
2129
							selected_nodes = set()
2130
							if gather_deps(ignore_priority,
2131
								mergeable_nodes, selected_nodes, node):
2132
								break
2133
							else:
2134
								selected_nodes = None
2135
						if selected_nodes:
2123
							break
2136
							break
2124
						else:
2125
							selected_nodes = None
2126
2137
2138
					if selected_nodes and ignore_priority > DepPriority.SOFT:
2139
						# Try to merge ignored medium deps as soon as possible.
2140
						for node in selected_nodes:
2141
							children = set(mygraph.child_nodes(node))
2142
							soft = children.difference(
2143
								mygraph.child_nodes(node,
2144
								ignore_priority=DepPriority.SOFT))
2145
							medium_soft = children.difference(
2146
								mygraph.child_nodes(node,
2147
								ignore_priority=DepPriority.MEDIUM_SOFT))
2148
							medium_soft.difference_update(soft)
2149
							for child in medium_soft:
2150
								if child in selected_nodes:
2151
									continue
2152
								# TODO: Try harder to make these nodes get
2153
								# merged absolutely as soon as possible.
2154
								asap_nodes.append(child)
2155
2127
			if not selected_nodes:
2156
			if not selected_nodes:
2128
				if not myblockers.is_empty():
2157
				if not myblockers.is_empty():
2129
					"""A blocker couldn't be circumnavigated while keeping all
2158
					"""A blocker couldn't be circumnavigated while keeping all

Return to bug 180045