minor changes in machine_readable option
authorThomas Goettlicher <tgoettlicher@suse.de>
Wed, 25 Jul 2007 11:32:26 +0000 (11:32 +0000)
committerThomas Goettlicher <tgoettlicher@suse.de>
Wed, 25 Jul 2007 11:32:26 +0000 (11:32 +0000)
src/zypper-misc.cc
src/zypper-rpm-callbacks.h
src/zypper.cc

index 2a0745a..bb7421b 100644 (file)
@@ -1022,9 +1022,10 @@ bool confirm_licenses(bool non_interactive)
       if (gSettings.license_auto_agree)
       {
         // TranslatorExplanation The first %s is name of the resolvable, the second is its kind (e.g. 'zypper package')
-        cout << format(_("Automatically agreeing with %s %s license."))
-            % it->resolvable()->name() % it->resolvable()->kind().asString()
-            << endl;
+                         if (!gSettings.machine_readable)
+               cout << format(_("Automatically agreeing with %s %s license."))
+                   % it->resolvable()->name() % it->resolvable()->kind().asString()
+                   << endl;
 
         MIL << format("Automatically agreeing with %s %s license.")
             % it->resolvable()->name() % it->resolvable()->kind().asString()
index d974d86..8784c37 100644 (file)
@@ -176,7 +176,7 @@ struct InstallResolvableReportReceiver : public zypp::callback::ReceiveReport<zy
   {
     _resolvable = resolvable;
          if (gSettings.machine_readable)
-                       cout << "Installing: " + to_string (resolvable) << endl;
+                       cout << "Installing: " + resolvable->name() << endl;
                else
            cerr << "Installing: " + to_string (resolvable) << endl;
   }
index 52faa2b..f90d77c 100644 (file)
@@ -1207,9 +1207,18 @@ int safe_one_command(const ZypperCommand & command, int argc, char **argv)
   }
   catch (const Exception & ex) {
     ZYPP_CAUGHT(ex);
-    cerr << _("Unexpected exception.") << endl;
-    cerr << ex.asUserString() << endl;
-    report_a_bug(cerr);
+
+               if (gSettings.machine_readable)
+               {
+               cerr << "ERROR:" << _("Unexpected exception.") << endl;
+           cerr << "ERROR:" << ex.asUserString() << endl;
+               }
+               else
+               {
+               cerr << _("Unexpected exception.") << endl;
+           cerr << ex.asUserString() << endl;
+       report_a_bug(cerr);
+               }
   }
   return ret;
 }