]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cdrom.cc
print all messages if the application is in an interactive run
[apt.git] / cmdline / apt-cdrom.cc
index 0c9aab28cb99915265ffec7a471625c099034ac7..da2ffa3901ef53cdf557344b4d9c24e367fcb737 100644 (file)
@@ -147,7 +147,7 @@ bool DoAdd(CommandLine &)
    pkgCdrom cdrom;
    bool res = true;
 
-   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
+   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
    unsigned int count = 0;
    
    if (AutoDetect && UdevCdroms.Dlopen())
@@ -273,13 +273,11 @@ int main(int argc,const char *argv[])                                     /*{{{*/
    CmdL.DispatchArg(Cmds);
 
    // Print any errors or warnings found during parsing
-   if (_error->empty() == false)
-   {
-      bool Errors = _error->PendingError();
+   bool const Errors = _error->PendingError();
+   if (_config->FindI("quiet",0) > 0)
       _error->DumpErrors();
-      return Errors == true?100:0;
-   }
-   
-   return 0;
+   else
+      _error->DumpErrors(GlobalError::DEBUG);
+   return Errors == true ? 100 : 0;
 }
                                                                        /*}}}*/