Author: jkupec Date: Mon Apr 28 16:12:49 2008 New Revision: 9866 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9866&view=rev Log: - fix status of patters/patches/products Modified: trunk/zypper/src/zypper-info.cc trunk/zypper/src/zypper-search.cc trunk/zypper/src/zypper.cc Modified: trunk/zypper/src/zypper-info.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-info.cc?rev=9866&r1=9865&r2=9866&view=diff ============================================================================== --- trunk/zypper/src/zypper-info.cc (original) +++ trunk/zypper/src/zypper-info.cc Mon Apr 28 16:12:49 2008 @@ -15,6 +15,8 @@ #include "zypper-tabulator.h" #include "zypper-info.h" #include "zypper-richtext.h" +#include "zypper-search.h" + using namespace std; using namespace zypp; @@ -205,14 +207,9 @@ void printPatchInfo(const Zypper & zypper, const ui::Selectable & s ) { const PoolItem & pool_item = s.theObj(); - const PoolItem & ins_pool_item = s.installedObj(); printNVA(pool_item.resolvable()); - cout << _("Status: "); // TODO debug - bool i = bool(ins_pool_item); - if (pool_item.isBroken ()) - cout << (i ? _("broken"): _("satisfied")); - cout << endl; + cout << _("Status: ") << string_ppp_status(pool_item) << endl; Patch::constPtr patch = asKind<Patch>(pool_item.resolvable()); cout << _("Category: ") << patch->category() << endl; @@ -274,7 +271,6 @@ void printPatternInfo(const Zypper & zypper, const ui::Selectable & s) { const PoolItem & pool_item = s.theObj(); - const PoolItem & ins_pool_item = s.installedObj(); cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: ")) << pool_item.resolvable()->repository().info().name() << endl; @@ -336,8 +332,7 @@ */ void printProductInfo(const Zypper & zypper, const ui::Selectable & s) { - const PoolItem & pool_item = s.theObj(); - const PoolItem & ins_pool_item = s.installedObj(); + const PoolItem & pool_item = s.theObj(); // should be the only one cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: ")) << pool_item.resolvable()->repository().info().name() << endl; @@ -346,7 +341,7 @@ Product::constPtr product = asKind<Product>(pool_item.resolvable()); cout << _("Category: ") << product->type() << endl; - cout << _("Installed: ") << (!ins_pool_item ? "No" : "Yes") << endl; + cout << _("Installed: ") << (pool_item.status().isSatisfied() ? "Yes" : "No") << endl; cout << _("Short Name: ") << product->shortName() << endl; cout << _("Long Name: ") << product->longName() << endl; Modified: trunk/zypper/src/zypper-search.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.cc?rev=9866&r1=9865&r2=9866&view=diff ============================================================================== --- trunk/zypper/src/zypper-search.cc (original) +++ trunk/zypper/src/zypper-search.cc Mon Apr 28 16:12:49 2008 @@ -42,17 +42,21 @@ string string_ppp_status(const PoolItem & pi) { + // make sure this will not happen + if (pi.isUndetermined()) + return _("Unknown"); + if (pi.isRelevant()) { if (pi.isSatisfied()) - return _("Installed"); + return _("Installed"); //! \todo make this "Applied" instead? if (pi.isBroken()) return _("Needed"); // can this ever happen? return ""; } - return _("Not Applicable"); + return _("Not Applicable"); //! \todo make this "Not Needed" after 11.0 } Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=9866&r1=9865&r2=9866&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Mon Apr 28 16:12:49 2008 @@ -2954,7 +2954,8 @@ if (exitCode() != ZYPPER_EXIT_OK) return; load_resolvables(*this); - resolve(*this); // needed to compute status of PPP? + // needed to compute status of PPP + resolve(*this); printInfo(*this, kind); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org