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 (-3 / +31 lines)
Lines 16-26 Link Here
16
params=["selective", "deep", "self", "recurse", "empty"]
16
params=["selective", "deep", "self", "recurse", "empty"]
17
actions=["clean", "config", "help", "info", "prune", "rsync", "search", "sync", "system", "unmerge", "world", "inject", "regen", "depclean"]
17
actions=["clean", "config", "help", "info", "prune", "rsync", "search", "sync", "system", "unmerge", "world", "inject", "regen", "depclean"]
18
options=["--autoclean", "--deep", "--selective", "--buildpkg", "--buildpkgonly", "--debug", "--nodeps", "--emptytree", "--fetchonly", "--changelog",
18
options=["--autoclean", "--deep", "--selective", "--buildpkg", "--buildpkgonly", "--debug", "--nodeps", "--emptytree", "--fetchonly", "--changelog",
19
"--noreplace", "--onlydeps", "--pretend", "--usepkg", "--usepkgonly", "--searchdesc", "--verbose", "--update", "--help", "--oneshot", "--version"]
19
"--noreplace", "--onlydeps", "--pretend", "--usepkg", "--usepkgonly", "--searchdesc", "--verbose", "--update", "--help", "--oneshot", "--version", "--nodowngrade"]
20
20
21
shortmapping={"a":"--autoclean", "b":"--buildpkg", "B":"--buildpkgonly", "c":"clean", "C":"unmerge", "e":"--emptytree", "d":"--debug", "f":"--fetchonly",
21
shortmapping={"a":"--autoclean", "b":"--buildpkg", "B":"--buildpkgonly", "c":"clean", "C":"unmerge", "e":"--emptytree", "d":"--debug", "f":"--fetchonly",
22
	"h":"--help", "i":"inject", "k":"--usepkg", "K":"--usepkgonly", "l":"--changelog", "n":"--noreplace", "o":"--onlydeps", "O":"--nodeps",
22
	"g":"--nodowngrade", "h":"--help", "i":"inject", "k":"--usepkg", "K":"--usepkgonly", "l":"--changelog", "n":"--noreplace", "o":"--onlydeps",
23
	"p":"--pretend", "P":"prune", "s":"search", "S":"--searchdesc", "u":"--update", "v":"--verbose", "V":"--version"}
23
	"O":"--nodeps", "p":"--pretend", "P":"prune", "s":"search", "S":"--searchdesc", "u":"--update", "v":"--verbose", "V":"--version"}
24
24
25
def emergelog(mystr):
25
def emergelog(mystr):
26
	try:
26
	try:
Lines 576-581 Link Here
576
		# We're true here unless we are missing binaries.
576
		# We're true here unless we are missing binaries.
577
		return (not self.missingbins,myfavorites)
577
		return (not self.missingbins,myfavorites)
578
578
579
	def is_newer_ver_installed(self,myroot,pkg,pkgver):
580
		"if there is a version of pkg installed newer than pkgver, return it"
581
		vardbapi=portage.db[myroot]["vartree"].dbapi
582
583
		alleb=portage.portdb.xmatch("match-all",pkg)
584
		while alleb:
585
			cand=portage.portdb.xmatch("bestmatch-list",pkg,mylist=alleb)
586
			if not cand:
587
				break
588
			if vardbapi.cpv_exists(cand):
589
				# installed, is this package newer?
590
				if portage.pkgcmp(portage.catpkgsplit(pkgver)[1:], portage.catpkgsplit(cand)[1:]) < 0:
591
					return cand
592
				break
593
			alleb.remove(cand)
594
579
	def select_dep(self,myroot,depstring,myparent=None,arg=None):
595
	def select_dep(self,myroot,depstring,myparent=None,arg=None):
580
		"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure"
596
		"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure"
581
		if not arg:
597
		if not arg:
Lines 616-621 Link Here
616
					else:
632
					else:
617
						print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"."
633
						print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"."
618
					return 0
634
					return 0
635
636
				if "--nodowngrade" in myopts:
637
					# Check that there isn't a newer version of this package already installed
638
					cand=self.is_newer_ver_installed(myroot,x,myeb)
639
					if cand:
640
						myeb=cand
619
				
641
				
620
				if "--usepkg" in myopts:
642
				if "--usepkg" in myopts:
621
					#If we want to use packages, see if we have a pre-built one...
643
					#If we want to use packages, see if we have a pre-built one...
Lines 702-707 Link Here
702
			if not myeb:
724
			if not myeb:
703
				#this is an unavailable world entry; just continue
725
				#this is an unavailable world entry; just continue
704
				continue
726
				continue
727
728
			if "--nodowngrade" in myopts:
729
				cand=self.is_newer_ver_installed(portage.root,mydep,myeb)
730
				if cand:
731
					myeb=cand
732
705
			#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
733
			#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
706
			#if mydep2[0]=="!":, etc.
734
			#if mydep2[0]=="!":, etc.
707
			if "--usepkg" in myopts:
735
			if "--usepkg" in myopts:
(-)bin/emergehelp.py (-1 / +5 lines)
Lines 14-20 Link Here
14
	print "   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("system")+" | "+turquoise("world")+" >"
14
	print "   "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("system")+" | "+turquoise("world")+" >"
15
	print "   "+turquoise("emerge")+" < "+turquoise("sync")+" | "+turquoise("rsync")+" | "+turquoise("info")+" >"
15
	print "   "+turquoise("emerge")+" < "+turquoise("sync")+" | "+turquoise("rsync")+" | "+turquoise("info")+" >"
16
	print "   "+turquoise("emerge")+" "+green("--help")+" "+green("-h")+" [ "+turquoise("system")+" | "+turquoise("config")+" ] "
16
	print "   "+turquoise("emerge")+" "+green("--help")+" "+green("-h")+" [ "+turquoise("system")+" | "+turquoise("config")+" ] "
17
	print bold("Options:")+" "+green("-")+"["+green("abcCdefhikKlnoOpPsSuvV")+"] ["+green("--deep")+"] ["+green("--oneshot")+"]"
17
	print bold("Options:")+" "+green("-")+"["+green("abcCdefghikKlnoOpPsSuvV")+"] ["+green("--deep")+"] ["+green("--oneshot")+"]"
18
	print bold("Actions:")+" [ clean | depclean | inject | prune | regen | search | unmerge ]"
18
	print bold("Actions:")+" [ clean | depclean | inject | prune | regen | search | unmerge ]"
19
	print
19
	print
20
20
Lines 144-149 Link Here
144
		print "              all packages (main package as well as all dependencies.) When"
144
		print "              all packages (main package as well as all dependencies.) When"
145
		print "              used in combination with --pretend all the SRC_URIs will be"
145
		print "              used in combination with --pretend all the SRC_URIs will be"
146
		print "              displayed multiple mirrors per line, one line per file."
146
		print "              displayed multiple mirrors per line, one line per file."
147
		print
148
		print "       "+green("--nodowngrade")+" ("+green("-g")+" short option)"
149
		print "              If an installed package becomes masked, do not downgrade to"
150
		print "              a lower, unmasked version."
147
		print
151
		print
148
		print "       "+green("--nodeps")+" ("+green("-O")+" short option)"
152
		print "       "+green("--nodeps")+" ("+green("-O")+" short option)"
149
		print "              Merge specified packages, but don't merge any dependencies."
153
		print "              Merge specified packages, but don't merge any dependencies."

Return to bug 12069