Lines 552-557
Link Here
|
552 |
mykey=portage.dep_expand(x,portage.portdb) |
552 |
mykey=portage.dep_expand(x,portage.portdb) |
553 |
#select needs to return 0 on dep_check failure |
553 |
#select needs to return 0 on dep_check failure |
554 |
try: |
554 |
try: |
|
|
555 |
mybackup=self.digraph.copy() |
555 |
self.mysd=self.select_dep(portage.root,mykey,arg=x) |
556 |
self.mysd=self.select_dep(portage.root,mykey,arg=x) |
556 |
except Exception, e: |
557 |
except Exception, e: |
557 |
print "\n!!! Problem in",mykey,"dependancies." |
558 |
print "\n!!! Problem in",mykey,"dependancies." |
Lines 559-565
Link Here
|
559 |
sys.exit(1) |
560 |
sys.exit(1) |
560 |
|
561 |
|
561 |
if not self.mysd: |
562 |
if not self.mysd: |
562 |
return (0,myfavorites) |
563 |
# ignore the uninstallable package and keep going |
|
|
564 |
self.digraph=mybackup |
563 |
elif not "--oneshot" in myopts: |
565 |
elif not "--oneshot" in myopts: |
564 |
myfavorites.append(mykey) |
566 |
myfavorites.append(mykey) |
565 |
|
567 |
|
Lines 588-641
Link Here
|
588 |
#we're processing a command-line argument; unconditionally merge it even if it's already merged |
590 |
#we're processing a command-line argument; unconditionally merge it even if it's already merged |
589 |
mymerge=[depstring] |
591 |
mymerge=[depstring] |
590 |
for x in mymerge: |
592 |
for x in mymerge: |
591 |
if x[0]=="!": |
593 |
|
592 |
#add our blocker; it will be ignored later if necessary (if we are remerging the same pkg, for example) |
594 |
if x[0]!="!": |
593 |
myk=["blocks",myroot,x[1:]] |
595 |
viseb=portage.portdb.xmatch("match-visible",x) |
594 |
else: |
596 |
|
595 |
#We are not processing a blocker but a normal dependency |
597 |
retry=1 |
596 |
if "--usepkgonly" in myopts: |
598 |
while retry: |
597 |
myeb=portage.db[portage.root]["bintree"].dep_bestmatch(x) |
599 |
retry=0 |
|
|
600 |
|
601 |
if x[0]=="!": |
602 |
#add our blocker; it will be ignored later if necessary (if we are remerging the same pkg, for example) |
603 |
myk=["blocks",myroot,x[1:]] |
598 |
else: |
604 |
else: |
599 |
myeb=portage.portdb.xmatch("bestmatch-visible",x) |
605 |
#We are not processing a blocker but a normal dependency |
600 |
if not myeb: |
606 |
if "--usepkgonly" in myopts: |
601 |
if not arg: |
607 |
myeb=portage.db[portage.root]["bintree"].dep_bestmatch(x) |
602 |
xinfo='"'+x+'"' |
|
|
603 |
else: |
608 |
else: |
604 |
xinfo='"'+arg+'"' |
609 |
myeb=portage.portdb.xmatch("bestmatch-list",x,mylist=viseb) |
605 |
if myparent: |
610 |
if not myeb: |
606 |
xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])") |
611 |
if not arg: |
607 |
alleb=portage.portdb.xmatch("match-all",x) |
612 |
xinfo='"'+x+'"' |
608 |
if alleb: |
|
|
609 |
if "--usepkgonly" not in myopts: |
610 |
print "\n!!! "+red("all ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") |
611 |
if myparent: |
612 |
print "!!! "+red(xfrom) |
613 |
else: |
613 |
else: |
614 |
print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) |
614 |
xinfo='"'+arg+'"' |
615 |
print "!!! Either add a suitable binary package or compile from an ebuild." |
615 |
if myparent: |
616 |
else: |
616 |
xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])") |
617 |
print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"." |
617 |
alleb=portage.portdb.xmatch("match-all",x) |
618 |
return 0 |
618 |
if alleb: |
619 |
|
619 |
if "--usepkgonly" not in myopts: |
620 |
if "--usepkg" in myopts: |
620 |
print "\n!!! "+red("all ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") |
621 |
#If we want to use packages, see if we have a pre-built one... |
621 |
if myparent: |
622 |
mypk=portage.db["/"]["bintree"].dbapi.match(x) |
622 |
print "!!! "+red(xfrom) |
623 |
if myeb in mypk: |
623 |
else: |
624 |
#Use it only if it's exactly the version we want. |
624 |
print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) |
625 |
myk=["binary",myroot,myeb] |
625 |
print "!!! Either add a suitable binary package or compile from an ebuild." |
|
|
626 |
else: |
627 |
print "\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"." |
628 |
return 0 |
629 |
|
630 |
if "--usepkg" in myopts: |
631 |
#If we want to use packages, see if we have a pre-built one... |
632 |
mypk=portage.db["/"]["bintree"].dbapi.match(x) |
633 |
if myeb in mypk: |
634 |
#Use it only if it's exactly the version we want. |
635 |
myk=["binary",myroot,myeb] |
636 |
else: |
637 |
myk=["ebuild",myroot,myeb] |
626 |
else: |
638 |
else: |
627 |
myk=["ebuild",myroot,myeb] |
639 |
myk=["ebuild",myroot,myeb] |
|
|
640 |
mybackup=self.digraph.copy() |
641 |
if myparent: |
642 |
#we are a dependency, so we want to be unconditionally added |
643 |
if not self.create(myk,myparent): |
644 |
if myeb in viseb: |
645 |
viseb.remove(myeb) |
646 |
self.digraph=mybackup |
647 |
retry=1 |
648 |
else: |
649 |
return 0 |
628 |
else: |
650 |
else: |
629 |
myk=["ebuild",myroot,myeb] |
651 |
#if mysource is not set, then we are a command-line dependency and should not be added |
630 |
if myparent: |
652 |
#if --onlydeps is specified. |
631 |
#we are a dependency, so we want to be unconditionally added |
653 |
if not self.create(myk,myparent,"--onlydeps" not in myopts): |
632 |
if not self.create(myk,myparent): |
654 |
if myeb in viseb: |
633 |
return 0 |
655 |
viseb.remove(myeb) |
634 |
else: |
656 |
self.digraph=mybackup |
635 |
#if mysource is not set, then we are a command-line dependency and should not be added |
657 |
retry=1 |
636 |
#if --onlydeps is specified. |
658 |
else: |
637 |
if not self.create(myk,myparent,"--onlydeps" not in myopts): |
659 |
return 0 |
638 |
return 0 |
|
|
639 |
return 1 |
660 |
return 1 |
640 |
|
661 |
|
641 |
|
662 |
|
Lines 698-719
Link Here
|
698 |
mylist.append(sysdict[x]) |
719 |
mylist.append(sysdict[x]) |
699 |
|
720 |
|
700 |
for mydep in mylist: |
721 |
for mydep in mylist: |
701 |
myeb=portage.portdb.xmatch("bestmatch-visible",mydep) |
722 |
viseb=portage.portdb.xmatch("match-visible",mydep) |
702 |
if not myeb: |
723 |
if not viseb: |
703 |
#this is an unavailable world entry; just continue |
724 |
#this is an unavailable world entry; just continue |
704 |
continue |
725 |
continue |
705 |
#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS |
726 |
|
706 |
#if mydep2[0]=="!":, etc. |
727 |
while viseb: |
707 |
if "--usepkg" in myopts: |
728 |
# keep trying for a 'create'able version of this package |
708 |
mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) |
729 |
myeb=portage.portdb.xmatch("bestmatch-list",mydep,mylist=viseb) |
709 |
if myeb==mypk: |
730 |
|
710 |
myk=["binary",portage.root,mypk] |
731 |
#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS |
|
|
732 |
#if mydep2[0]=="!":, etc. |
733 |
if "--usepkg" in myopts: |
734 |
mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) |
735 |
if myeb==mypk: |
736 |
myk=["binary",portage.root,mypk] |
737 |
else: |
738 |
myk=["ebuild",portage.root,myeb] |
711 |
else: |
739 |
else: |
712 |
myk=["ebuild",portage.root,myeb] |
740 |
myk=["ebuild",portage.root,myeb] |
713 |
else: |
741 |
mybackup=self.digraph.copy() |
714 |
myk=["ebuild",portage.root,myeb] |
742 |
if not self.create(myk): |
715 |
if not self.create(myk): |
743 |
# retry, excluding myeb |
716 |
return 0 |
744 |
viseb.remove(myeb) |
|
|
745 |
self.digraph=mybackup |
746 |
if not viseb: |
747 |
# no version of this package can be installed, but |
748 |
# why give up altogether? |
749 |
break |
750 |
else: |
751 |
break |
717 |
return 1 |
752 |
return 1 |
718 |
|
753 |
|
719 |
def match(self,mydep,myroot=portage.root,mykey=None): |
754 |
def match(self,mydep,myroot=portage.root,mykey=None): |