]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cache.cc
regex for package names executed on Grp- not PkgIterator
[apt.git] / cmdline / apt-cache.cc
index 355e9aefb7eb38a04b2315c769c8602bcd5b7377..07b95e3ca81bc90ca9c25cba4ce52ae658c39752 100644 (file)
@@ -1505,15 +1505,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                   /*{{{*/