From: Thomas Goettlicher Date: Fri, 3 Aug 2007 08:21:07 +0000 (+0000) Subject: added xml output for some messages X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8641bfd1ea9b6ecd8539d94d7ecaf03ff5280682;p=platform%2Fupstream%2Fzypper.git added xml output for some messages --- diff --git a/src/zypper-misc.cc b/src/zypper-misc.cc index 7793001..3ae174c 100644 --- a/src/zypper-misc.cc +++ b/src/zypper-misc.cc @@ -1146,12 +1146,25 @@ int solve_and_commit () { if (retv < 0) retv = ZYPPER_EXIT_OK; else if (retv == ZYPPER_EXIT_INF_REBOOT_NEEDED) - cout << _("WARNING: One of installed patches requires reboot of" - " your machine. Please, do it as soon as possible.") << endl; + { + if (gSettings.machine_readable) + cout << "" << endl; + else + cout << _("WARNING: One of installed patches requires reboot of" + " your machine. Please, do it as soon as possible.") << endl; + } else if (retv == ZYPPER_EXIT_INF_RESTART_NEEDED) - cout << _("WARNING: One of installed patches affects the package" + { + if (gSettings.machine_readable) + cout << "" << endl; + else + cout << _("WARNING: One of installed patches affects the package" " manager itself, thus it requires restart before executing" " next operations.") << endl; + } return retv; } diff --git a/src/zypper.cc b/src/zypper.cc index 3ec6081..59d8bb8 100644 --- a/src/zypper.cc +++ b/src/zypper.cc @@ -699,10 +699,18 @@ int one_command(const ZypperCommand & command, int argc, char **argv) catch (Exception & excpt_r) { ZYPP_CAUGHT (excpt_r); ERR << "A ZYpp transaction is already in progress." << endl; - cerr << _("A ZYpp transaction is already in progress." - "This means, there is another application using libzypp library for" - "package management running. All such applications must be closed before" - "using this command.") << endl; + + if ( gSettings.machine_readable ) + cout << "" << endl; + else + cerr << _("A ZYpp transaction is already in progress." + "This means, there is another application using libzypp library for" + "package management running. All such applications must be closed before" + "using this command.") << endl; + return ZYPPER_EXIT_ERR_ZYPP; }