summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 20:39:59 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 20:39:59 +0200
commita8275acf87cf15992e6b89694d6276e0a5e529b9 (patch)
tree44e4264e28d8a932a1298f71b316fd01359fb39c /cmdline
parent5b1997c095acf183077ec49b2a8cbb1174e3c280 (diff)
Add support for "apt-cache showsrc --only-source srcpkgname"
Thanks: Steve Slangasek for the suggestion Closes: 695633
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc4
1 files changed, 4 insertions, 0 deletions
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++;