From b246be029797c7d51a004385ce0a9f066ed2a348 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Mon, 29 Jun 2009 13:49:51 +0200 Subject: [PATCH] Show all updates, not only sw-mgmt (bnc #503068) - now 'list-patches' does not hide other updates if software management updates (which are to be installed before any other) are available. --- src/update.cc | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/update.cc b/src/update.cc index 985e977..9600831 100755 --- a/src/update.cc +++ b/src/update.cc @@ -187,22 +187,31 @@ static bool list_patch_updates(Zypper & zypper) // those that affect the package manager go first // (TODO: user option for this?) bool affectpm = false; - if (!pm_tbl.empty ()) + if (!pm_tbl.empty()) { affectpm = true; - if (!tbl.empty ()) - zypper.out().warning( - _("These are only the updates affecting the updater itself.\n" - "Other updates are available too.\n")); - tbl = pm_tbl; + if (!tbl.empty()) + { + zypper.out().info(_("The following software management updates will be installed first:")); + cout << endl; + } + pm_tbl.sort(1); // Name + cout << pm_tbl; } - tbl.sort (1); // Name - - if (tbl.empty()) + tbl.sort(1); // Name + if (tbl.empty() && !affectpm) zypper.out().info(_("No updates found.")); - else + else if (!tbl.empty()) + { + if (affectpm) + { + cout << endl; + zypper.out().info(_("The following updates are also available:")); + cout << endl; + } cout << tbl; + } return affectpm; } @@ -439,7 +448,8 @@ void list_updates(Zypper & zypper, const ResKindSet & kinds, bool best_effort) affects_pkgmgr = xml_list_patches(); else { - zypper.out().info(i18n_kind_updates(*it), Out::QUIET, Out::TYPE_NORMAL); + if (kinds.size() > 1) + zypper.out().info(i18n_kind_updates(*it), Out::QUIET, Out::TYPE_NORMAL); zypper.out().info("", Out::QUIET, Out::TYPE_NORMAL); // visual separator affects_pkgmgr = list_patch_updates(zypper); } @@ -633,7 +643,7 @@ mark_patch_update(ui::Selectable & s, bool skip_interactive, bool ignore_affects_pm) { Patch::constPtr patch = asKind(s.candidateObj()); - if (s.isBroken()) + if (s.isBroken()) // bnc #506860 { DBG << "candidate patch " << patch->name() << " " << ignore_affects_pm << ", " << patch->restartSuggested() << endl; -- 2.7.4