From 9429e1097e75365577a5e1b92b0775ce5a22e164 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Thu, 9 Jul 2009 14:58:37 +0200 Subject: [PATCH] update.h cleanup --- src/update.cc | 71 +++++++++++++++++++++++++++++++---------------------------- src/update.h | 5 ----- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/src/update.cc b/src/update.cc index 9600831..4b95f8c 100755 --- a/src/update.cc +++ b/src/update.cc @@ -18,6 +18,11 @@ using namespace boost; extern ZYpp::Ptr God; +typedef set Candidates; + +static void +find_updates( const ResKindSet & kinds, Candidates & candidates ); + static PoolItem findInstalledItem( PoolItem item ); @@ -77,7 +82,7 @@ void patch_check () // ---------------------------------------------------------------------------- // returns true if restartSuggested() patches are availble -bool xml_list_patches () +static bool xml_list_patches () { const zypp::ResPool& pool = God->pool(); @@ -144,6 +149,36 @@ bool xml_list_patches () // ---------------------------------------------------------------------------- +static void xml_list_updates(const ResKindSet & kinds) +{ + Candidates candidates; + find_updates (kinds, candidates); + + Candidates::iterator cb = candidates.begin (), ce = candidates.end (), ci; + for (ci = cb; ci != ce; ++ci) { + ResObject::constPtr res = ci->resolvable(); + + cout << " name () << "\" " ; + cout << "edition=\"" << res->edition ().asString() << "\" "; + cout << "kind=\"" << res->kind() << "\" "; + cout << ">" << endl; + cout << " " << xml_encode(res->summary()) << " " << endl; + cout << " " << xml_encode(res->description()) << "" << endl; + cout << " " << xml_encode(res->licenseToConfirm()) << "" << endl; + + if ( !res->repoInfo().alias().empty() ) + { + cout << " repoInfo().baseUrlsBegin()->asString()); + cout << "\" alias=\"" << xml_encode(res->repoInfo().alias()) << "\"/>" << endl; + } + + cout << " " << endl; + } +} + +// ---------------------------------------------------------------------------- + static bool list_patch_updates(Zypper & zypper) { Table tbl; @@ -345,8 +380,6 @@ findTheBest( const ResPool & pool, const ui::Selectable & s) // ---------------------------------------------------------------------------- -typedef set Candidates; - /** * Find all available updates of given kind. */ @@ -394,7 +427,7 @@ find_updates( const ResKind & kind, Candidates & candidates ) /** * Find all available updates of given kinds. */ -static void +void find_updates( const ResKindSet & kinds, Candidates & candidates ) { for (ResKindSet::const_iterator kit = kinds.begin(); kit != kinds.end(); ++kit) @@ -608,36 +641,6 @@ static bool require_item_update (const PoolItem& pi) { // ---------------------------------------------------------------------------- -void xml_list_updates(const ResKindSet & kinds) -{ - Candidates candidates; - find_updates (kinds, candidates); - - Candidates::iterator cb = candidates.begin (), ce = candidates.end (), ci; - for (ci = cb; ci != ce; ++ci) { - ResObject::constPtr res = ci->resolvable(); - - cout << " name () << "\" " ; - cout << "edition=\"" << res->edition ().asString() << "\" "; - cout << "kind=\"" << res->kind() << "\" "; - cout << ">" << endl; - cout << " " << xml_encode(res->summary()) << " " << endl; - cout << " " << xml_encode(res->description()) << "" << endl; - cout << " " << xml_encode(res->licenseToConfirm()) << "" << endl; - - if ( !res->repoInfo().alias().empty() ) - { - cout << " repoInfo().baseUrlsBegin()->asString()); - cout << "\" alias=\"" << xml_encode(res->repoInfo().alias()) << "\"/>" << endl; - } - - cout << " " << endl; - } -} - -// ---------------------------------------------------------------------------- - static bool mark_patch_update(ui::Selectable & s, bool skip_interactive, bool ignore_affects_pm) diff --git a/src/update.h b/src/update.h index e980bcb..a7c96c9 100755 --- a/src/update.h +++ b/src/update.h @@ -22,11 +22,6 @@ void list_updates(Zypper & zypper, const ResKindSet & kinds, bool best_effort); -/** \todo remove from this header after xu is dropped */ -bool xml_list_patches(); -/** \todo remove from this header after xu is dropped */ -void xml_list_updates(const ResKindSet & kinds); - /** * \param kind resolvable type * \param skip_interactive whether to skip updates that need user interaction -- 2.7.4