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