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

Collapse All | Expand All

(-)portage.newgraph/bin/emerge (-9 / +17 lines)
Lines 673-679 Link Here
673
					"--getbinpkg" in self.myopts,
673
					"--getbinpkg" in self.myopts,
674
					"--getbinpkgonly" in self.myopts)
674
					"--getbinpkgonly" in self.myopts)
675
675
676
	def create(self,mybigkey,myparent=None,addme=1,myuse=None,soft_dep=False,arg=None):
676
	def create(self,mybigkey,myparent=None,addme=1,myuse=None,soft_dep=False,rev_dep=False,arg=None):
677
		"""
677
		"""
678
		Fills the digraph with nodes comprised of packages to merge.
678
		Fills the digraph with nodes comprised of packages to merge.
679
		mybigkey is the package spec of the package to merge.
679
		mybigkey is the package spec of the package to merge.
Lines 685-701 Link Here
685
		#IUSE-aware emerge -> USE DEP aware depgraph
685
		#IUSE-aware emerge -> USE DEP aware depgraph
686
		#"no downgrade" emerge
686
		#"no downgrade" emerge
687
		"""
687
		"""
688
689
		jbigkey = " ".join(mybigkey) + " merge"
688
		jbigkey = " ".join(mybigkey) + " merge"
690
		if self.digraph.hasnode(jbigkey):
689
		if self.digraph.hasnode(jbigkey):
691
			if addme and jbigkey != myparent:
690
			if addme and jbigkey != myparent:
692
				# Refuse to make a node depend on itself so that the we don't
691
				# Refuse to make a node depend on itself so that the we don't
693
				# don't create a bogus circular dependency in self.altlist().
692
				# don't create a bogus circular dependency in self.altlist().
694
				self.digraph.addnode(jbigkey, myparent, soft_dep=soft_dep)
693
				if rev_dep and myparent:
694
					self.digraph.addnode(myparent, jbigkey, soft_dep=soft_dep)
695
				else:
696
					self.digraph.addnode(jbigkey, myparent, soft_dep=soft_dep)
695
			return 1
697
			return 1
696
		jbigkey = " ".join(mybigkey) + " nomerge"
698
		jbigkey = " ".join(mybigkey) + " nomerge"
697
		if self.digraph.hasnode(jbigkey):
699
		if self.digraph.hasnode(jbigkey):
698
			self.digraph.addnode(jbigkey, myparent, soft_dep=soft_dep)
700
			if rev_dep and myparent:
701
				self.digraph.addnode(myparent, jbigkey, soft_dep=soft_dep)
702
			else:
703
				self.digraph.addnode(jbigkey, myparent, soft_dep=soft_dep)
699
			return 1
704
			return 1
700
		
705
		
701
		self.spinner.update()
706
		self.spinner.update()
Lines 777-783 Link Here
777
		""" At this point, we have either hit a blocker and returned, found the package in the
782
		""" At this point, we have either hit a blocker and returned, found the package in the
778
		    depgraph already and returned, or we are here.  Whether we are merging or not; we must
783
		    depgraph already and returned, or we are here.  Whether we are merging or not; we must
779
		    add the package to the depgraph; so we do that here. """
784
		    add the package to the depgraph; so we do that here. """
780
		self.digraph.addnode(string.join(mybigkey),myparent,soft_dep=soft_dep)
785
		if rev_dep and myparent:
786
			self.digraph.addnode(myparent,string.join(mybigkey),soft_dep=soft_dep)
787
		else:
788
			self.digraph.addnode(string.join(mybigkey),myparent,soft_dep=soft_dep)
781
		
789
		
782
		""" This section determines whether we go deeper into dependencies or not.
790
		""" This section determines whether we go deeper into dependencies or not.
783
		    We want to go deeper on a few occasions:
791
		    We want to go deeper on a few occasions:
Lines 820-826 Link Here
820
			if edepend.has_key("PDEPEND") and edepend["PDEPEND"]:
828
			if edepend.has_key("PDEPEND") and edepend["PDEPEND"]:
821
				# Post Depend -- Add to the list without a parent, as it depends
829
				# Post Depend -- Add to the list without a parent, as it depends
822
				# on a package being present AND must be built after that package.
830
				# on a package being present AND must be built after that package.
823
				if not self.select_dep(myroot,edepend["PDEPEND"],myuse=myuse,soft_deps=True):
831
				if not self.select_dep(myroot,edepend["PDEPEND"],myparent=mp,myuse=myuse,soft_deps=True,rev_deps=True):
824
					return 0
832
					return 0
825
		except ValueError, e:
833
		except ValueError, e:
826
			pkgs = e.args[0]
834
			pkgs = e.args[0]
Lines 983-989 Link Here
983
					if curslot == myslot:
991
					if curslot == myslot:
984
						return match
992
						return match
985
993
986
	def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None,raise_on_missing=False,soft_deps=False):
994
	def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None,raise_on_missing=False,soft_deps=False,rev_deps=False):
987
		""" Given a depstring, create the depgraph such that all dependencies are satisfied.
995
		""" Given a depstring, create the depgraph such that all dependencies are satisfied.
988
		    myroot = $ROOT from environment, where {R,P}DEPENDs are merged to.
996
		    myroot = $ROOT from environment, where {R,P}DEPENDs are merged to.
989
		    myparent = the node whose depstring is being passed in
997
		    myparent = the node whose depstring is being passed in
Lines 1174-1187 Link Here
1174
				#we are a dependency, so we want to be unconditionally added
1182
				#we are a dependency, so we want to be unconditionally added
1175
				soft_dep = soft_deps or vardb.match(x)
1183
				soft_dep = soft_deps or vardb.match(x)
1176
				if not self.create(selected_pkg[0:3], myparent,
1184
				if not self.create(selected_pkg[0:3], myparent,
1177
					myuse=selected_pkg[-1], soft_dep=soft_dep, arg=arg):
1185
					myuse=selected_pkg[-1], soft_dep=soft_dep, rev_dep=rev_deps, arg=arg):
1178
					return 0
1186
					return 0
1179
			else:
1187
			else:
1180
				#if mysource is not set, then we are a command-line dependency and should not be added
1188
				#if mysource is not set, then we are a command-line dependency and should not be added
1181
				#if --onlydeps is specified.
1189
				#if --onlydeps is specified.
1182
				if not self.create(selected_pkg[0:3], myparent,
1190
				if not self.create(selected_pkg[0:3], myparent,
1183
					addme=("--onlydeps" not in self.myopts),
1191
					addme=("--onlydeps" not in self.myopts),
1184
					myuse=selected_pkg[-1], arg=arg):
1192
					myuse=selected_pkg[-1], rev_dep=rev_deps, arg=arg):
1185
					return 0
1193
					return 0
1186
1194
1187
		if "--debug" in self.myopts:
1195
		if "--debug" in self.myopts:

Return to bug 147766