Lines 574-600
Link Here
|
574 |
for mtype in self.matches.keys(): |
574 |
for mtype in self.matches.keys(): |
575 |
for match,masked in self.matches[mtype]: |
575 |
for match,masked in self.matches[mtype]: |
576 |
if mtype=="pkg": |
576 |
if mtype=="pkg": |
577 |
catpack=match |
|
|
578 |
full_package = portage.portdb.xmatch("bestmatch-visible",match) |
577 |
full_package = portage.portdb.xmatch("bestmatch-visible",match) |
579 |
if not full_package: |
578 |
pkg_versions = portage.portdb.xmatch("match-all",match) |
580 |
#no match found; we don't want to query description |
579 |
stable_pkg = "~" |
581 |
masked=1 |
580 |
# Get the stable version of the package |
582 |
full_package=portage.best(portage.portdb.xmatch("match-all",match)) |
581 |
for pv in pkg_versions: |
|
|
582 |
pkg_keywords = portage.portdb.aux_get(pv,["KEYWORDS"])[0].split() |
583 |
for pk in pkg_keywords: |
584 |
if pk == portage.settings["ARCH"]: |
585 |
stable_pkg = pv |
586 |
break |
587 |
if stable_pkg != "~": |
588 |
break |
589 |
# Get the unstable version of the package |
590 |
unstable_pkg = portage.best(portage.portdb.xmatch("match-all",match)) |
591 |
if stable_pkg != "~" and unstable_pkg == stable_pkg: |
592 |
unstable_pkg = "~" |
593 |
if stable_pkg == "~": |
594 |
full_package = unstable_pkg |
595 |
if unstable_pkg == "~": |
596 |
full_package = stable_pkg |
583 |
else: |
597 |
else: |
584 |
full_package = match |
598 |
full_package = match |
585 |
match = portage.pkgsplit(match)[0] |
599 |
match = portage.pkgsplit(match)[0] |
586 |
|
600 |
|
587 |
if full_package: |
601 |
if full_package: |
588 |
try: |
602 |
try: |
589 |
desc, homepage, license = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE","LICENSE"]) |
603 |
if stable_pkg != "~": |
|
|
604 |
keywords_stable = portage.portdb.aux_get(stable_pkg,["KEYWORDS"])[0] |
605 |
if unstable_pkg != "~": |
606 |
keywords_unstable = portage.portdb.aux_get(unstable_pkg,["KEYWORDS"])[0] |
607 |
|
608 |
desc, homepage, license = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE","LICENSE"]) |
590 |
except KeyError: |
609 |
except KeyError: |
591 |
print "emerge: search: aux_get() failed, skipping" |
610 |
print "emerge: search: aux_get() failed, skipping" |
592 |
continue |
611 |
continue |
593 |
if masked: |
612 |
print green("*")+" "+white(match) |
594 |
print green("*")+" "+white(match)+" "+red("[ Masked ]") |
|
|
595 |
else: |
596 |
print green("*")+" "+white(match) |
597 |
myversion = self.getVersion(full_package, search.VERSION_RELEASE) |
613 |
myversion = self.getVersion(full_package, search.VERSION_RELEASE) |
|
|
614 |
myversion_stable = self.getVersion(stable_pkg, search.VERSION_RELEASE) |
615 |
myversion_unstable = self.getVersion(unstable_pkg, search.VERSION_RELEASE) |
598 |
|
616 |
|
599 |
mysum = [0,0] |
617 |
mysum = [0,0] |
600 |
mycat = match.split("/")[0] |
618 |
mycat = match.split("/")[0] |
Lines 617-632
Link Here
|
617 |
if edebug: |
635 |
if edebug: |
618 |
print "!!! Exception:",e |
636 |
print "!!! Exception:",e |
619 |
mysum[0]=" [no/bad digest]" |
637 |
mysum[0]=" [no/bad digest]" |
620 |
|
638 |
|
621 |
if "--quiet" not in myopts: |
639 |
if "--quiet" not in myopts: |
622 |
print " ", darkgreen("Latest version available:"),myversion |
640 |
if stable_pkg != "~": |
|
|
641 |
if myversion != myversion_unstable: |
642 |
print " ", darkgreen("Latest stable version available:"),myversion_stable, yellow("*") |
643 |
else: |
644 |
print " ", darkgreen("Latest stable version available:"),myversion_stable |
645 |
print " ", darkgreen("Stable Accepted Keywords: "),keywords_stable |
646 |
# iuse verbose |
647 |
if "--verbose" in myopts: |
648 |
try: |
649 |
iuse_split = string.split(portage.portdb.aux_get(stable_pkg,["IUSE"])[0], " ") |
650 |
except: |
651 |
portage.writemsg("!!! Error getting IUSE (report this to bugs.gentoo.org)\n") |
652 |
portage.writemsg("!!! %s\n" % x) |
653 |
iuse_split = [] |
654 |
iuse_split.sort() |
655 |
iuse="" |
656 |
for ebuild_iuse in iuse_split: |
657 |
if not ebuild_iuse: |
658 |
continue |
659 |
if ebuild_iuse in portage.settings["USE"]: |
660 |
iuse=iuse+red("+"+ebuild_iuse)+" " |
661 |
elif ebuild_iuse in portage.settings.usemask: |
662 |
iuse=iuse+blue("-("+ebuild_iuse+")")+" " |
663 |
else: |
664 |
iuse=iuse+blue("-"+ebuild_iuse)+" " |
665 |
if len(iuse) > 0: |
666 |
print " ", darkgreen("Stable USE flags: "), iuse |
667 |
else: |
668 |
print " ", darkgreen("Stable USE flags: "), "N/A" |
669 |
else: |
670 |
print " ", darkgreen("Latest stable version available:"),"N/A" |
671 |
print " ", darkgreen("Stable Accepted Keywords: "),"N/A" |
672 |
if unstable_pkg != "~": |
673 |
if myversion == myversion_unstable: |
674 |
print " ", darkgreen("Latest unstable version available:"),myversion_unstable, yellow("*") |
675 |
else: |
676 |
print " ", darkgreen("Latest unstable version available:"),myversion_unstable |
677 |
print " ", darkgreen("Unstable Accepted Keywords: "),keywords_unstable |
678 |
# iuse verbose |
679 |
if "--verbose" in myopts: |
680 |
try: |
681 |
iuse_split = string.split(portage.portdb.aux_get(unstable_pkg,["IUSE"])[0], " ") |
682 |
except: |
683 |
portage.writemsg("!!! Error getting IUSE (report this to bugs.gentoo.org)\n") |
684 |
portage.writemsg("!!! %s\n" % x) |
685 |
iuse_split = [] |
686 |
iuse_split.sort() |
687 |
iuse="" |
688 |
for ebuild_iuse in iuse_split: |
689 |
if not ebuild_iuse: |
690 |
continue |
691 |
if ebuild_iuse in portage.settings["USE"]: |
692 |
iuse=iuse+red("+"+ebuild_iuse)+" " |
693 |
elif ebuild_iuse in portage.settings.usemask: |
694 |
iuse=iuse+blue("-("+ebuild_iuse+")")+" " |
695 |
else: |
696 |
iuse=iuse+blue("-"+ebuild_iuse)+" " |
697 |
if len(iuse) > 0: |
698 |
print " ", darkgreen("Unstable USE flags: "), iuse |
699 |
else: |
700 |
print " ", darkgreen("Unstable USE flags: "), "N/A" |
701 |
|
702 |
else: |
703 |
print " ", darkgreen("Latest unstable version available:"),"N/A" |
704 |
print " ", darkgreen("Unstable Accepted Keywords: "),"N/A" |
623 |
print " ", self.getInstallationStatus(mycat+'/'+mypkg) |
705 |
print " ", self.getInstallationStatus(mycat+'/'+mypkg) |
624 |
print " ", darkgreen("Size of downloaded files:"),mysum[0] |
706 |
print " ", darkgreen("Size of downloaded files:"),mysum[0] |
625 |
print " ", darkgreen("Homepage:")+" ",homepage |
707 |
print " ", darkgreen("Homepage:")+" ",homepage |
626 |
print " ", darkgreen("Description:"),desc |
708 |
print " ", darkgreen("Description:"),desc |
627 |
print " ", darkgreen("License:")+" ",license |
709 |
print " ", darkgreen("License:")+" ",license |
628 |
print |
710 |
print |
629 |
print |
711 |
print |
630 |
# |
712 |
# |
631 |
# private interface |
713 |
# private interface |
632 |
# |
714 |
# |