Respect "update --skip-interactive" (#221476).
authorMartin Vidner <mvidner@suse.cz>
Mon, 20 Nov 2006 16:31:28 +0000 (16:31 +0000)
committerMartin Vidner <mvidner@suse.cz>
Mon, 20 Nov 2006 16:31:28 +0000 (16:31 +0000)
VERSION
doc/zypper.8
package/zypper.changes
src/zmart-misc.cc
src/zmart-misc.h
src/zypper.cc

diff --git a/VERSION b/VERSION
index c40a6ff..986cd1d 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -10,5 +10,5 @@ dnl   phase)
 dnl ==================================================
 m4_define([ZYPPER_MAJOR],       [0])
 m4_define([ZYPPER_MINOR],       [6])
-m4_define([ZYPPER_PATCH],       [12])
+m4_define([ZYPPER_PATCH],       [13)
 dnl ==================================================
index 575ef1a..6eb3b59 100644 (file)
@@ -92,6 +92,11 @@ Type of resolvable (default: patch)
 .TP
 .I \-y, \-\-no-confirm
 Don't require user confirmation.
+.TP
+.I \-\-skip\-interactive
+This will skip interactive patches, that is those that need a reboot,
+contain a message, or update a package whose license needs to be
+confirmed.
 
 .B NOTE:
 Zypper prefers to update only those packages for which a patch
index 273728c..ba57875 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Mon Nov 20 17:29:57 CET 2006 - mvidner@suse.cz
+
+- Respect "update --skip-interactive" (#221476).
+- 0.6.13
+
+-------------------------------------------------------------------
 Mon Nov 20 13:55:28 CET 2006 - mvidner@suse.cz
 
 - update -t package: keep the same architecture (#222140).
index 2e0e0f6..9515373 100644 (file)
@@ -616,7 +616,8 @@ bool mark_item_install (const PoolItem& pi) {
   return result;
 }
 
-void mark_patch_updates ()
+static
+void mark_patch_updates (bool skip_interactive)
 {
   if (true) {
     // search twice: if there are none with affects_pkg_manager, retry on all
@@ -633,8 +634,18 @@ void mark_patch_updates ()
        if ( it->status().isNeeded() ) {
          Patch::constPtr patch = asKind<Patch>(res);
          if (attempt == 1 || patch->affects_pkg_manager ()) {
-           nothing_found = false;
-           mark_item_install (*it);
+           // #221476
+           if (skip_interactive && patch->interactive()) {
+             // Skipping a patch because it is interactive and
+             // --skip-interactive is requested. %s is a name of a
+             // patch
+             cerr << format (_("Warning: %s is interactive, skipped."))
+               % res << endl;
+           }
+           else {
+             nothing_found = false;
+             mark_item_install (*it);
+           }
          }
        }
       }
@@ -642,12 +653,12 @@ void mark_patch_updates ()
   }
 }
 
-void mark_updates( const ResObject::Kind &kind )
+void mark_updates( const ResObject::Kind &kind, bool skip_interactive )
 {
   bool k_is_patch = kind == ResTraits<Patch>::kind;
 
   if (k_is_patch) {
-    mark_patch_updates ();
+    mark_patch_updates (skip_interactive);
   }
   else {
     Candidates candidates;
index 8f0df36..d6123ac 100644 (file)
@@ -36,7 +36,7 @@ void dump_pool ();
 void show_patches();
 void patch_check();
 void list_updates( const zypp::ResObject::Kind &kind );
-void mark_updates( const zypp::ResObject::Kind &kind );
+void mark_updates( const zypp::ResObject::Kind &kind, bool skip_interactive );
 void usage(int argc, char **argv);
 int solve_and_commit (bool non_interactive = false);
 bool confirm_licenses(bool non_interactive = false);
index 28dff72..ca98928 100644 (file)
@@ -319,6 +319,7 @@ int one_command(const string& command, int argc, char **argv)
     static struct option update_options[] = {
       {"type",            required_argument, 0, 't'},
       {"no-confirm", no_argument,       0, 'y'},
+      {"skip-interactive", no_argument, 0, 0},
       {"help", no_argument, 0, 'h'},
       {0, 0, 0, 0}
     };
@@ -326,6 +327,7 @@ int one_command(const string& command, int argc, char **argv)
     specific_help = "  Command options:\n"
       "\t--type,-t\t\tType of resolvable (default: patch!)\n"
       "\t--no-confirm,-y\t\tDon't require user confirmation\n"
+      "\t--skip-interactive\t\tSkip interactive updates\n"
       ;
   }
   else if (command == "search" || command == "se") {
@@ -860,7 +862,8 @@ int one_command(const string& command, int argc, char **argv)
     cond_load_resolvables ();
     establish ();
 
-    mark_updates (kind);
+    bool skip_interactive = copts.count("skip-interactive");
+    mark_updates (kind, skip_interactive);
 
     // commit
     // returns ZYPPER_EXIT_OK, ZYPPER_EXIT_ERR_ZYPP,