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

Collapse All | Expand All

(-)/usr/bin/equery (-5 / +15 lines)
Lines 872-878 Link Here
872
	"""Display the filename of the ebuild for a given package
872
	"""Display the filename of the ebuild for a given package
873
	   that would be used by Portage with the current configuration."""
873
	   that would be used by Portage with the current configuration."""
874
	def __init__(self):
874
	def __init__(self):
875
		self.default_opts = {}
875
		self.default_opts = {
876
			"includeMasked": True
877
			}
876
878
877
	def parseArgs(self, args):
879
	def parseArgs(self, args):
878
880
Lines 891-896 Link Here
891
			if x in ["-h","--help"]:
893
			if x in ["-h","--help"]:
892
				need_help = 1
894
				need_help = 1
893
				break
895
				break
896
			elif x in ["-m","--exclude-masked"]:
897
				opts["includeMasked"] = False
894
			else:
898
			else:
895
				query = x
899
				query = x
896
900
Lines 903-923 Link Here
903
	def perform(self, args):
907
	def perform(self, args):
904
		(query, opts) = self.parseArgs(args)
908
		(query, opts) = self.parseArgs(args)
905
909
906
		matches = gentoolkit.find_packages(query, True)
910
		matches = gentoolkit.find_packages(query, opts["includeMasked"])
907
		matches = gentoolkit.sort_package_list(matches)
911
		matches = gentoolkit.sort_package_list(matches)
908
912
909
		if matches:
913
		if matches:
910
			print_info(0, os.path.normpath(matches[-1].get_ebuild_path()))
914
			print_info(0, os.path.normpath(matches[-1].get_ebuild_path()))
911
		else:
915
		else:
912
			print_error("No masked or unmasked packages found for " + pp.pkgquery(query))
916
			if opts["includeMasked"]:
917
				print_error("No masked or unmasked packages found for " + pp.pkgquery(query))
918
			else:
919
				print_error("No unmasked packages found for " + pp.pkgquery(query))
913
					
920
					
914
	def shortHelp(self):
921
	def shortHelp(self):
915
		return pp.pkgquery("pkgspec") + " - print full path to ebuild for package " + pp.pkgquery("pkgspec")
922
		return pp.localoption("<local-opts> ") + pp.pkgquery("pkgspec") + " - print full path to ebuild for package " + pp.pkgquery("pkgspec")
916
	def longHelp(self):
923
	def longHelp(self):
917
		return "Print full path to ebuild for a given package" + \
924
		return "Print full path to ebuild for a given package" + \
918
			"\n" + \
925
			"\n" + \
919
			"Syntax:\n" + \
926
			"Syntax:\n" + \
920
			"  " + pp.command("which ") + pp.pkgquery("pkgspec")
927
			"  " + pp.command("which") + pp.localoption(" <local-opts> ") + pp.pkgquery("pkgspec") + \
928
			"\n" + \
929
			pp.localoption("<local-opts>") + " is either of: \n" + \
930
			"  " + pp.localoption("-m, --nomasked") + " - exclude masked packages\n"
921
931
922
class CmdListGLSAs(Command):
932
class CmdListGLSAs(Command):
923
	"""List outstanding GLSAs."""
933
	"""List outstanding GLSAs."""

Return to bug 91757