From 8641bfd1ea9b6ecd8539d94d7ecaf03ff5280682 Mon Sep 17 00:00:00 2001 From: Thomas Goettlicher Date: Fri, 3 Aug 2007 08:21:07 +0000 Subject: [PATCH] added xml output for some messages --- src/zypper-misc.cc | 19 ++++++++++++++++--- src/zypper.cc | 16 ++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) 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; } -- 2.7.4