From a70c0a773a6801360404e28acc61a7a849d8dc73 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Tue, 31 Oct 2006 16:30:20 +0000 Subject: [PATCH] -r, --rug-compatible global option added please use this wherever you want to differ from rug's functionality to provide rug's original behavior --- src/zmart.h | 4 +++- src/zypper.cc | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/zmart.h b/src/zmart.h index bf7dcb7..0b3c533 100644 --- a/src/zmart.h +++ b/src/zmart.h @@ -35,7 +35,8 @@ struct Settings verbose(0), previous_code(-1), disable_system_sources(false), - disable_system_resolvables(false) + disable_system_resolvables(false), + is_rug_compatible(false) {} std::list additional_sources; @@ -45,6 +46,7 @@ struct Settings std::string command; bool disable_system_sources; bool disable_system_resolvables; + bool is_rug_compatible; }; struct RuntimeData diff --git a/src/zypper.cc b/src/zypper.cc index de3fce5..f9e4a52 100644 --- a/src/zypper.cc +++ b/src/zypper.cc @@ -119,6 +119,7 @@ static struct option global_options[] = { {"version", no_argument, 0, 'V'}, {"terse", no_argument, 0, 't'}, {"table-style", required_argument, 0, 's'}, + {"rug-compatible", no_argument, 0, 'r'}, {"opt", optional_argument, 0, 'o'}, {0, 0, 0, 0} }; @@ -151,12 +152,15 @@ int main(int argc, char **argv) if (logfile == NULL) logfile = ZYPP_CHECKPATCHES_LOG; zypp::base::LogControl::instance().logfile( logfile ); - + bool help = false; parsed_opts gopts = parse_options (argc, argv, global_options); if (gopts.count("_unknown")) return 1; + if (gopts.count("rug-compatible")) + gSettings.is_rug_compatible = true; + // Help is parsed by setting the help flag for a command, which may be empty // $0 -h,--help // $0 command -h,--help @@ -172,6 +176,7 @@ int main(int argc, char **argv) "\t--verbose, -v\t\tIncrease verbosity\n" "\t--terse, -t\t\tTerse output for machine consumption\n" "\t--table-style, -s\tTable style (integer)\n" + "\t--rug-compatible, -r\tTurn on rug compatibility" ; if (gopts.count("version")) { @@ -712,6 +717,8 @@ int main(int argc, char **argv) return 0; } + // --------------------------( patches )------------------------------------ + if (command == "patches" || command == "pch") { if (help) { cerr << "patches\n" @@ -795,6 +802,7 @@ int main(int argc, char **argv) cond_init_target (); cond_init_system_sources (); cond_load_resolvables (); + establish (); printInfo(command,arguments); -- 2.7.4