From: Stefan Schubert Date: Wed, 2 Apr 2008 11:51:58 +0000 (+0000) Subject: - Moved calls like poolItem.status().isSatisfied(),.... to poolItem.isSatisfied() X-Git-Tag: BASE-SuSE-Linux-11_0-Branch~269 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8db527918d3d6d7d438061bd57e8aa7fcd19d498;p=platform%2Fupstream%2Fzypper.git - Moved calls like poolItem.status().isSatisfied(),.... to poolItem.isSatisfied() --- diff --git a/src/zypper-info.cc b/src/zypper-info.cc index 90e208f..77a101d 100644 --- a/src/zypper-info.cc +++ b/src/zypper-info.cc @@ -165,14 +165,8 @@ void printPatchInfo(const Zypper & zypper, const PoolItem & pool_item, const Poo cout << _("Status: "); // TODO debug bool i = ins_pool_item ? true : false; - if (pool_item.status().isUndetermined ()) - cout << (i ? _("Installed"): _("Uninstalled")); - else if (pool_item.status().isEstablishedUneeded ()) - cout << (i ? _("No Longer Applicable"): _("Not Applicable")); - else if (pool_item.status().isEstablishedSatisfied ()) - cout << (i ? _("Applied"): _("Not Needed")); - else if (pool_item.status().isEstablishedIncomplete ()) - cout << (i ? _("Broken"): _("Needed")); + if (pool_item.isBroken ()) + cout << (i ? _("broken"): _("satisfied")); cout << endl; Patch::constPtr patch = asKind(pool_item.resolvable()); diff --git a/src/zypper-misc.cc b/src/zypper-misc.cc index 84bf202..ab55a53 100644 --- a/src/zypper-misc.cc +++ b/src/zypper-misc.cc @@ -269,8 +269,8 @@ static void mark_for_install(Zypper & zypper, installer.installed_item.resolvable()->arch() == installer.item.resolvable()->arch() && ( ! copts.count("force") ) ) { - // if it is needed install anyway, even if it is installed - if ( installer.item.status().isNeeded() ) + // if it is broken install anyway, even if it is installed + if ( installer.item.isBroken() ) { installer.item.status().setTransact( true, zypp::ResStatus::USER ); } @@ -1024,7 +1024,7 @@ static void dump_pool () if (!full_pool_shown // show item if not shown all before || it->status().transacts() // or transacts - || !it->status().isUndetermined()) // or established status + || !it->isBroken()) // or broken status { _XDEBUG( count << ": " << *it ); } @@ -1155,7 +1155,7 @@ void patch_check () ResObject::constPtr res = it->resolvable(); Patch::constPtr patch = asKind(res); - if ( it->status().isNeeded() ) + if ( it->isBroken() ) { gData.patches_count++; if (patch->category() == "security") @@ -1177,17 +1177,7 @@ void patch_check () static string string_status (const ResStatus& rs) { - bool i = rs.isInstalled (); - if (rs.isUndetermined ()) - return i? _("Installed"): _("Uninstalled"); - else if (rs.isEstablishedUneeded ()) - return i? _("No Longer Applicable"): _("Not Applicable"); - else if (rs.isEstablishedSatisfied ()) - return i? _("Applied"): _("Not Needed"); - else if (rs.isEstablishedIncomplete ()) - return i? _("Broken"): _("Needed"); - // if ResStatus interface changes - return _("error"); + return rs.isInstalled () ? _("Installed"): _("Uninstalled"); } // patches @@ -1207,11 +1197,6 @@ void show_patches(Zypper & zypper) for (; it != e; ++it ) { ResObject::constPtr res = it->resolvable(); - if ( it->status().isUndetermined() ) { -#warning is this a library bug? - // these are duplicates of those that are determined - continue; - } Patch::constPtr patch = asKind(res); TableRow tr; @@ -1219,6 +1204,8 @@ void show_patches(Zypper & zypper) tr << res->name () << res->edition ().asString(); tr << patch->category(); tr << string_status (it->status ()); + if (it->isBroken()) + tr << _("Broken"); tbl << tr; } tbl.sort (1); // Name @@ -1248,7 +1235,7 @@ bool xml_list_patches () for (; it != e; ++it ) { ResObject::constPtr res = it->resolvable(); - if ( it->status().isNeeded() ) + if ( it->isBroken() ) { Patch::constPtr patch = asKind(res); @@ -1268,7 +1255,7 @@ bool xml_list_patches () patchcount++; - if ( it->status().isNeeded()) + if ( it->isBroken()) { Patch::constPtr patch = asKind(res); if ((pkg_mgr_available && patch->affects_pkg_manager()) || @@ -1330,7 +1317,7 @@ static void list_patch_updates(Zypper & zypper, bool best_effort) for (; it != e; ++it ) { ResObject::constPtr res = it->resolvable(); - if ( it->status().isNeeded() ) + if ( it->isBroken() ) { Patch::constPtr patch = asKind(res); @@ -1340,6 +1327,8 @@ static void list_patch_updates(Zypper & zypper, bool best_effort) tr << res->name () << res->edition ().asString(); tr << patch->category(); tr << string_status (it->status ()); + if (it->isBroken()) + tr << _("Broken"); if (patch->affects_pkg_manager ()) pm_tbl << tr; @@ -1688,7 +1677,7 @@ void mark_patch_updates( bool skip_interactive ) { ResObject::constPtr res = it->resolvable(); - if ( it->status().isNeeded() ) { + if ( it->isBroken() ) { Patch::constPtr patch = asKind(res); if (attempt == 1 || patch->affects_pkg_manager ()) { // #221476 diff --git a/src/zypper-updates.cc b/src/zypper-updates.cc index e6cdfe8..93fafe3 100644 --- a/src/zypper-updates.cc +++ b/src/zypper-updates.cc @@ -121,8 +121,8 @@ void render_result( const Edition &version, std::ostream &out, const zypp::ResPo { Resolvable::constPtr res = it->resolvable(); Patch::constPtr patch = asKind(res); - MIL << patch->name() << " " << patch->edition() << " " << "[" << patch->category() << "]" << ( it->status().isNeeded() ? " [needed]" : " [unneeded]" )<< std::endl; - if ( it->status().isNeeded() ) + MIL << patch->name() << " " << patch->edition() << " " << "[" << patch->category() << "]" << ( it->isBroken() ? " [broken]" : " [satisfied]" )<< std::endl; + if ( it->isBroken() ) { out << " category() << "\" name=\"" << patch->name() << "\" edition=\"" << patch->edition() << "\"" << ">" << std::endl; out << " " << xml_escape(patch->summary()) << "" << endl;