From 5eb0b560e16528581e9374a44d2ee84c21264497 Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Fri, 3 Nov 2006 16:48:21 +0000 Subject: [PATCH] Added dump_pool in "zypper patches" --- package/zypper.changes | 3 ++- src/zmart-misc.cc | 22 +++++++++++++++++++++- src/zmart-misc.h | 2 +- src/zypper.cc | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/package/zypper.changes b/package/zypper.changes index a83bad3..f35966c 100644 --- a/package/zypper.changes +++ b/package/zypper.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- -Fri Nov 3 16:33:12 CET 2006 - mvidner@suse.cz +Fri Nov 3 17:48:09 CET 2006 - mvidner@suse.cz - log to /var/log/YaST2/zypper.log (for save_y2logs too). +- Added dump_pool in "zypper patches" ------------------------------------------------------------------- Thu Nov 2 18:24:09 CET 2006 - mvidner@suse.cz diff --git a/src/zmart-misc.cc b/src/zmart-misc.cc index 1d7f06d..597131a 100644 --- a/src/zmart-misc.cc +++ b/src/zmart-misc.cc @@ -369,10 +369,30 @@ string string_status (const ResStatus& rs) return "error"; } +static void dump_pool () +{ + int count = 1; + static bool full_pool_shown = false; + + _XDEBUG( "---------------------------------------" ); + for (ResPool::const_iterator it = God->pool().begin(); it != God->pool().end(); ++it, ++count) { + + if (!full_pool_shown // show item if not shown all before + || it->status().transacts() // or transacts + || !it->status().isUndetermined()) // or established status + { + _DEBUG( count << ": " << *it ); + } + } + _XDEBUG( "---------------------------------------" ); + full_pool_shown = true; +} + // patches -void show_pool() +void show_patches() { MIL << "Pool contains " << God->pool().size() << " items. Checking whether available patches are needed." << std::endl; + dump_pool (); Table tbl; TableHeader th; diff --git a/src/zmart-misc.h b/src/zmart-misc.h index ae8dcaa..c63b262 100644 --- a/src/zmart-misc.h +++ b/src/zmart-misc.h @@ -33,7 +33,7 @@ void load_target(); void load_sources(); void establish (); void resolve(); -void show_pool(); +void show_patches(); void patch_check(); void list_updates( const zypp::ResObject::Kind &kind ); void mark_updates( const zypp::ResObject::Kind &kind ); diff --git a/src/zypper.cc b/src/zypper.cc index d52632c..4b5bcc4 100644 --- a/src/zypper.cc +++ b/src/zypper.cc @@ -687,7 +687,7 @@ int one_command(const string& command, int argc, char **argv) cond_init_system_sources (); cond_load_resolvables (); establish (); - show_pool (); + show_patches (); return 0; } -- 2.7.4