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: |