summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-03-21 18:11:46 +0100
committerJulian Andres Klode <jak@debian.org>2010-03-21 18:11:46 +0100
commit0458a81120b78339a49febde73934e08f37c03f7 (patch)
treeabcf79f6c4dd6cf0532ceae88cfef1f05e030c53
parent6520109c98500cc1ca6d6b581cc0980531ef8f83 (diff)
cmdline/apt-cache.cc: Change behavior of showsrc to match the one of show (Closes: #512046).
-rw-r--r--cmdline/apt-cache.cc17
-rw-r--r--debian/changelog2
2 files changed, 16 insertions, 3 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 286f306cd..3f68579cc 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1498,15 +1498,26 @@ bool ShowSrcPackage(CommandLine &CmdL)
if (_error->PendingError() == true)
return false;
+ unsigned found = 0;
for (const char **I = CmdL.FileList + 1; *I != 0; I++)
{
SrcRecs.Restart();
pkgSrcRecords::Parser *Parse;
- while ((Parse = SrcRecs.Find(*I,false)) != 0)
- cout << Parse->AsStr() << endl;;
+ unsigned found_this = 0;
+ while ((Parse = SrcRecs.Find(*I,false)) != 0) {
+ cout << Parse->AsStr() << endl;;
+ found++;
+ found_this++;
+ }
+ if (found_this == 0) {
+ _error->Warning(_("Unable to locate package %s"),*I);
+ continue;
+ }
}
- return true;
+ if (found > 0)
+ return true;
+ return _error->Error(_("No packages found"));
}
/*}}}*/
// Policy - Show the results of the preferences file /*{{{*/
diff --git a/debian/changelog b/debian/changelog
index cc5b03a63..fc5d0f90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ apt (0.7.26~exp3) UNRELEASED; urgency=low
that package that was providing some manpages for APT utilities.
[ Julian Andres Klode ]
+ * cmdline/apt-cache.cc:
+ - Change behavior of showsrc to match the one of show (Closes: #512046).
* cmdline/apt-key:
- Honor Apt::GPGV::TrustedKeyring (Closes: #316390)
* cmdline/apt-mark: