]> git.saurik.com Git - apt.git/commitdiff
cmdline/apt-cache.cc: Change behavior of showsrc to match the one of show (Closes...
authorJulian Andres Klode <jak@debian.org>
Sun, 21 Mar 2010 17:11:46 +0000 (18:11 +0100)
committerJulian Andres Klode <jak@debian.org>
Sun, 21 Mar 2010 17:11:46 +0000 (18:11 +0100)
cmdline/apt-cache.cc
debian/changelog

index 286f306cdbc79f2a94e802a5e5eb6779c63f1726..3f68579cc0386b933dc8700dc3ae748490cda212 100644 (file)
@@ -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                   /*{{{*/
index cc5b03a6314b712c850793f11250762f530ffcdf..fc5d0f90c9ec6087c5fa83de054608a4acdcd6ba 100644 (file)
@@ -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: