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

Collapse All | Expand All

(-)bin/emerge (-1 / +30 lines)
Lines 25-31 Link Here
25
"--oneshot",    "--onlydeps",     "--pretend",   "--quiet",
25
"--oneshot",    "--onlydeps",     "--pretend",   "--quiet",
26
"--resume",     "--searchdesc",   "--selective", "--update",
26
"--resume",     "--searchdesc",   "--selective", "--update",
27
"--usepkg",     "--usepkgonly",   "--verbose",   "--version",
27
"--usepkg",     "--usepkgonly",   "--verbose",   "--version",
28
"--columns"
28
"--columns",	"--nodowngrade"
29
]
29
]
30
shortmapping={
30
shortmapping={
31
"b":"--buildpkg",  "B":"--buildpkgonly",
31
"b":"--buildpkg",  "B":"--buildpkgonly",
Lines 33-38 Link Here
33
"d":"--debug",
33
"d":"--debug",
34
"e":"--emptytree",
34
"e":"--emptytree",
35
"f":"--fetchonly",
35
"f":"--fetchonly",
36
"g":"--nodowngrade",
36
"h":"--help",
37
"h":"--help",
37
"i":"inject",
38
"i":"inject",
38
"k":"--usepkg",    "K":"--usepkgonly",
39
"k":"--usepkg",    "K":"--usepkgonly",
Lines 614-619 Link Here
614
		# We're true here unless we are missing binaries.
615
		# We're true here unless we are missing binaries.
615
		return (not self.missingbins,myfavorites)
616
		return (not self.missingbins,myfavorites)
616
617
618
	def is_newer_ver_installed(self,myroot,pkg,pkgver):
619
		"if there is a version of pkg installed newer than pkgver, return it"
620
		vardbapi=portage.db[myroot]["vartree"].dbapi
621
622
		alleb=portage.portdb.xmatch("match-all",pkg)
623
		while alleb:
624
			cand=portage.portdb.xmatch("bestmatch-list",pkg,mylist=alleb)
625
			if not cand:
626
				break
627
			if vardbapi.cpv_exists(cand):
628
				# installed, is this package newer?
629
				if portage.pkgcmp(portage.catpkgsplit(pkgver)[1:], portage.catpkgsplit(cand)[1:]) < 0:
630
					return cand
631
				break
632
			alleb.remove(cand)
633
617
	def select_dep(self,myroot,depstring,myparent=None,arg=None):
634
	def select_dep(self,myroot,depstring,myparent=None,arg=None):
618
		"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure"
635
		"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure"
619
		if not arg:
636
		if not arg:
Lines 654-659 Link Here
654
					else:
671
					else:
655
						print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"."
672
						print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"."
656
					return 0
673
					return 0
674
675
				if "--nodowngrade" in myopts:
676
					# Check that there isn't a newer version of this package already installed
677
					cand=self.is_newer_ver_installed(myroot,x,myeb)
678
					if cand:
679
						myeb=cand
657
				
680
				
658
				if "--usepkg" in myopts:
681
				if "--usepkg" in myopts:
659
					#If we want to use packages, see if we have a pre-built one...
682
					#If we want to use packages, see if we have a pre-built one...
Lines 740-745 Link Here
740
			if not myeb:
763
			if not myeb:
741
				#this is an unavailable world entry; just continue
764
				#this is an unavailable world entry; just continue
742
				continue
765
				continue
766
767
			if "--nodowngrade" in myopts:
768
				cand=self.is_newer_ver_installed(portage.root,mydep,myeb)
769
				if cand:
770
					myeb=cand
771
743
			#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
772
			#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
744
			#if mydep2[0]=="!":, etc.
773
			#if mydep2[0]=="!":, etc.
745
			if "--usepkg" in myopts:
774
			if "--usepkg" in myopts:
(-)bin/emergehelp.py (-1 / +5 lines)
Lines 15-21 Link Here
15
	print "   "+turquoise("emerge")+" < "+turquoise("sync")+" | "+turquoise("rsync")+" | "+turquoise("info")+" >"
15
	print "   "+turquoise("emerge")+" < "+turquoise("sync")+" | "+turquoise("rsync")+" | "+turquoise("info")+" >"
16
	print "   "+turquoise("emerge")+" "+turquoise("--resume")+" ["+green("--pretend")+"]"
16
	print "   "+turquoise("emerge")+" "+turquoise("--resume")+" ["+green("--pretend")+"]"
17
	print "   "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("system")+" | "+green("config")+" | "+green("rsync")+" ] "
17
	print "   "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("system")+" | "+green("config")+" | "+green("rsync")+" ] "
18
	print bold("Options:")+" "+green("-")+"["+green("bcCdefhikKlnoOpPsSuvV")+"] ["+green("--deep")+"] ["+green("--oneshot")+"] ["+green("--noconfmem")+"]"
18
	print bold("Options:")+" "+green("-")+"["+green("bcCdefghikKlnoOpPsSuvV")+"] ["+green("--deep")+"] ["+green("--oneshot")+"] ["+green("--noconfmem")+"]"
19
	print bold("Actions:")+" [ clean | depclean | inject | prune | regen | search | unmerge ]"
19
	print bold("Actions:")+" [ clean | depclean | inject | prune | regen | search | unmerge ]"
20
	print
20
	print
21
21
Lines 163-168 Link Here
163
		print "              used in combination with --pretend all the SRC_URIs will be"
163
		print "              used in combination with --pretend all the SRC_URIs will be"
164
		print "              displayed multiple mirrors per line, one line per file."
164
		print "              displayed multiple mirrors per line, one line per file."
165
		print
165
		print
166
		print "       "+green("--nodowngrade")+" ("+green("-g")+" short option)"
167
		print "              If an installed package becomes masked, do not downgrade to"
168
		print "              a lower, unmasked version."
169
		print
166
		print "       "+green("--noconfmem")
170
		print "       "+green("--noconfmem")
167
		print "              Portage keeps track of files that have been placed into"
171
		print "              Portage keeps track of files that have been placed into"
168
		print "              CONFIG_PROTECT directories, and normally it will not merge the"
172
		print "              CONFIG_PROTECT directories, and normally it will not merge the"

Return to bug 12069