ref: refs/heads/master
commit 9429e1097e75365577a5e1b92b0775ce5a22e164
Author: Ján Kupec
Date: Thu Jul 9 14:58:37 2009 +0200
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<PoolItem> 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 << " <summary>" << xml_encode(res->summary()) << " </summary>" << endl;
+ cout << " <description>" << xml_encode(res->description()) << "</description>" << endl;
+ cout << " <license>" << xml_encode(res->licenseToConfirm()) << "</license>" << endl;
+
+ if ( !res->repoInfo().alias().empty() )
+ {
+ cout << "