Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 11739 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/bin/emerge (-13 / +48 lines)
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
						else:
647
							print "     ", darkgreen("Latest stable version available:"),"N/A"
648
							print "     ", darkgreen("Stable Accepted Keywords:       "),"N/A"
649
						if unstable_pkg != "~":
650
							if myversion == myversion_unstable:
651
								print "     ", darkgreen("Latest unstable version available:"),myversion_unstable, yellow("*")
652
							else:
653
								print "     ", darkgreen("Latest unstable version available:"),myversion_unstable
654
							print "     ", darkgreen("Unstable Accepted Keywords:       "),keywords_unstable
655
						else:
656
                                                        print "     ", darkgreen("Latest unstable version available:"),"N/A"
657
                                                        print "     ", darkgreen("Unstable Accepted Keywords:       "),"N/A"
623
						print "     ", self.getInstallationStatus(mycat+'/'+mypkg)
658
						print "     ", self.getInstallationStatus(mycat+'/'+mypkg)
624
						print "     ", darkgreen("Size of downloaded files:"),mysum[0]
659
						print "     ", darkgreen("Size of downloaded files:"),mysum[0]
625
						print "     ", darkgreen("Homepage:")+"   ",homepage
660
						print "     ", darkgreen("Homepage:")+"   ",homepage
626
						print "     ", darkgreen("Description:"),desc
661
						print "     ", darkgreen("Description:"),desc
627
						print "     ", darkgreen("License:")+"    ",license
662
						print "     ", darkgreen("License:")+"    ",license
628
						print
663
						print
629
		print
664
						print
630
	#
665
	#
631
	# private interface
666
	# private interface
632
	#
667
	#

Return to bug 11739