From a8275acf87cf15992e6b89694d6276e0a5e529b9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 18 Aug 2015 20:39:59 +0200 Subject: Add support for "apt-cache showsrc --only-source srcpkgname" Thanks: Steve Slangasek for the suggestion Closes: 695633 --- cmdline/apt-cache.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index f7abb823d..050508663 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1607,6 +1607,10 @@ static bool ShowSrcPackage(CommandLine &CmdL) pkgSrcRecords::Parser *Parse; unsigned found_this = 0; while ((Parse = SrcRecs.Find(*I,false)) != 0) { + // SrcRecs.Find() will find both binary and source names + if (_config->FindB("APT::Cache::Only-Source", false) == true) + if (Parse->Package() != *I) + continue; cout << Parse->AsStr() << endl;; found++; found_this++; -- cgit v1.2.3