-r, --rug-compatible global option added
authorJan Kupec <jkupec@suse.cz>
Tue, 31 Oct 2006 16:30:20 +0000 (16:30 +0000)
committerJan Kupec <jkupec@suse.cz>
Tue, 31 Oct 2006 16:30:20 +0000 (16:30 +0000)
please use this wherever you want to differ from rug's functionality to provide rug's original behavior

src/zmart.h
src/zypper.cc

index bf7dcb7..0b3c533 100644 (file)
@@ -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<zypp::Url> 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
index de3fce5..f9e4a52 100644 (file)
@@ -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);