From 5b5eb5937744daa61cb9cb0510bdf5321a279706 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Wed, 1 Nov 2006 09:46:14 +0000 Subject: [PATCH] source-list output table modified to include Enabled and Refresh columns --- src/zmart-sources.cc | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/zmart-sources.cc b/src/zmart-sources.cc index e38ceb9..f3f34db 100644 --- a/src/zmart-sources.cc +++ b/src/zmart-sources.cc @@ -77,6 +77,7 @@ void include_source_by_url( const Url &url ) } +/* static void print_source_list( const std::list &sources ) { for( std::list::const_iterator it = sources.begin() ; @@ -90,13 +91,16 @@ static void print_source_list( const std::list &source else cout << source.url() << endl; } -} +}*/ -static void print_source_list_rug_style( const std::list &sources ) +static void print_source_list(const std::list &sources ) { Table tbl; TableHeader th; - th << "#" << "Status" << "Type" << "Name" << "URI"; + th << "#"; + if (gSettings.is_rug_compatible) th << "Status"; + else th << "Enabled" << "Refresh"; + th << "Type" << "Name" << "URI"; tbl << th; int i = 1; @@ -104,11 +108,22 @@ static void print_source_list_rug_style( const std::list active, disabled <= enabled, disabled) + // this is probably the closest possible compatibility arrangement + if (gSettings.is_rug_compatible) + { + tr << (source.enabled() ? "Active" : "Disabled"); + } + // zypper status (enabled, autorefresh) + else + { + tr << (source.enabled() ? "Yes" : "No"); + tr << (source.autorefresh() ? "Yes" : "No"); + } + tr << source.type(); tr << source.alias(); tr << source.url().asString(); @@ -134,7 +149,7 @@ void list_system_sources() exit(-1); } - print_source_list_rug_style(sources); + print_source_list(sources); } bool parse_repo_file (const string& file, string& url, string& alias) -- 2.7.4