Mailinglist Archive: zypp-commit (500 mails)

< Previous Next >
[zypp-commit] r6080 - in /trunk/zypper: doc/zypper.8 src/zypper-misc.cc src/zypper-rpm-callbacks.h src/zypper-source-callbacks.h src/zypper.cc src/zypper.h
  • From: jkupec@xxxxxxxxxxxxxxxx
  • Date: Wed, 18 Jul 2007 18:50:55 -0000
  • Message-id: <20070718185055.5CF32C8590@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Wed Jul 18 20:50:54 2007
New Revision: 6080

URL: http://svn.opensuse.org/viewcvs/zypp?rev=6080&view=rev
Log:
- --auto-agree-with-licenses added

Modified:
    trunk/zypper/doc/zypper.8
    trunk/zypper/src/zypper-misc.cc
    trunk/zypper/src/zypper-rpm-callbacks.h
    trunk/zypper/src/zypper-source-callbacks.h
    trunk/zypper/src/zypper.cc
    trunk/zypper/src/zypper.h

Modified: trunk/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=6080&r1=6079&r2=6080&view=diff
==============================================================================
--- trunk/zypper/doc/zypper.8 (original)
+++ trunk/zypper/doc/zypper.8 Wed Jul 18 20:50:54 2007
@@ -58,8 +58,11 @@
 \fI\-t, \-\-type\fR <resolvable_type>
 Type of resolvable (default: package)
 .TP
-.I \-y, \-\-no-confirm
-Don't require user confirmation.
+.I \-y, \-\-no\-confirm
+Don't require user confirmation to proceed with installation.
+.TP
+.I \-l, \-\-auto\-agree\-with\-licenses
+Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
 
 .TP
 .B list-updates (lu) [options]
@@ -91,10 +94,13 @@
 .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,
+.I     \-\-skip\-interactive
+This will skip interactive patches, that is, those that need reboot,
 contain a message, or update a package whose license needs to be
 confirmed.
+.TP
+.I \-l, \-\-auto\-agree\-with\-licenses
+Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
 
 .B NOTE:
 Zypper prefers to update only those packages for which a patch
@@ -191,6 +197,8 @@
 .TP
 \fI\-n, \-\-no\-refresh\fR 
 Add the repository with auto-refresh disabled.
+.TP
+NOTE: This command does not automatically refresh the newly added repositories. You have to use the \fBrefresh\fR command after finishing your modifications to repositories with \fB*repo\fR commands.
 
 .TP
 .B removerepo (rr) [options] <alias|URI>
@@ -234,7 +242,7 @@
 .B refresh (ref)
 Refresh all installation sources found in system.
 .IP
-This means downloading resolvables' metadata from source media and storing it in local cache, typically under /var/lib/zypp/cache.
+This means downloading resolvables' metadata from source media (if needed), storing it in local cache (typically under /var/lib/zypp/cache/raw directory) and preparsing the metadata into an sqlite database (/var/lib/zypp/cache/zypp.db).
 
 .SH "GLOBAL OPTIONS"
 .TP 
@@ -248,7 +256,7 @@
 Increase verbosity. For debugging output specify this option twice.
 .TP
 .I \-q, \-\-quiet
-Suppress normal output. Brief error messages will still be printed on standard error output. If used together with conflicting --verbose option, the --verbose option takes preference.
+Suppress normal output. Brief messages will still be printed though. If used together with conflicting --verbose option, the --verbose option takes preference.
 .TP
 .I \-t, \-\-terse
 Terse output for machine consumption.
@@ -260,7 +268,7 @@
 Turns on rug compatibility. See compatibility notes next to affected commands.
 .TP
 .I      \-\-non\-interactive
-Switches to non-interactive mode. In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically. (Under development, use only with install, update, and remove commands for other than debugging purposes)
+Switches to non-interactive mode. In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
 .TP
 .I      \-\-no\-gpg\-checks
 Ignore gpg check failures and continue.
@@ -270,8 +278,14 @@
 
 .SH "FILES"
 .TP
-.B /var/lib/zypp/cache
-Directory for storing metadata contained in installation sources.
+.B /etc/zypp/repos.d
+Directory containing repository configuration (*.repo) files. You can use the \fBrepo\fR commands to manipulate these files, or you can edit them yourself. In either case, after doing the modifications, executing \fBzypper refresh\fR is strongly recommended.
+.TP
+.B /var/lib/zypp/cache/raw
+Directory for storing raw metadata contained in repositories.
+.TP
+.B /var/lib/zypp/cache/zypp.db
+Sqlite database file containing pre-parsed metadata of all repositories.
 .TP
 .B ~/.zypper_history
 Command history for the shell.

Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=6080&r1=6079&r2=6080&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Wed Jul 18 20:50:54 2007
@@ -975,6 +975,20 @@
     if (it->status().isToBeInstalled() &&
         !it->resolvable()->licenseToConfirm().empty())
     {
+      if (gSettings.license_auto_agree)
+      {
+        // TranslatorExplanation The first %s is name of the resolvable, the second is its kind (e.g. 'zypper package')
+        cout << format(_("Automatically agreeing with %s %s license."))
+            % it->resolvable()->name() % it->resolvable()->kind().asString()
+            << endl;
+
+        MIL << format("Automatically agreeing with %s %s license.")
+            % it->resolvable()->name() % it->resolvable()->kind().asString()
+            << endl;
+
+        continue;
+      }
+
       cout << it->resolvable()->name() << " " <<
         it->resolvable()->kind().asString() <<
         " " << _("license") << ": " <<

Modified: trunk/zypper/src/zypper-rpm-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-rpm-callbacks.h?rev=6080&r1=6079&r2=6080&view=diff
==============================================================================
--- trunk/zypper/src/zypper-rpm-callbacks.h (original)
+++ trunk/zypper/src/zypper-rpm-callbacks.h Wed Jul 18 20:50:54 2007
@@ -144,7 +144,7 @@
   {
     cerr << resolvable << endl;
     display_error (error, description);
-    return (Action) read_action_ari ();
+    return (Action) read_action_ari (ABORT);
   }
 
   virtual void finish( zypp::Resolvable::constPtr /*resolvable*/, Error error, const std::string & reason )
@@ -193,7 +193,7 @@
       cerr_v << "Will retry more aggressively" << endl;
       return ABORT;
     }
-    return (Action) read_action_ari ();
+    return (Action) read_action_ari (ABORT);
   }
 
   virtual void finish( zypp::Resolvable::constPtr /*resolvable*/, Error error, const std::string & reason, RpmLevel level )

Modified: trunk/zypper/src/zypper-source-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-source-callbacks.h?rev=6080&r1=6079&r2=6080&view=diff
==============================================================================
--- trunk/zypper/src/zypper-source-callbacks.h (original)
+++ trunk/zypper/src/zypper-source-callbacks.h Wed Jul 18 20:50:54 2007
@@ -275,7 +275,7 @@
   {
     display_done ();
     display_error (error, description);
-    return (Action) read_action_ari ();
+    return (Action) read_action_ari (ABORT);
   }
 
   virtual void finish( zypp::Repository /*repo*/, const std::string & task, Error error, const std::string & reason )

Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=6080&r1=6079&r2=6080&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Wed Jul 18 20:50:54 2007
@@ -257,10 +257,11 @@
   }
   else if (command == ZypperCommand::INSTALL) {
     static struct option install_options[] = {
-      {"catalog",       required_argument, 0, 'c'},
-      {"type",            required_argument, 0, 't'},
-      {"no-confirm", no_argument,       0, 'y'},
-      {"help",       no_argument,       0, 'h'},
+      {"catalog",                required_argument, 0, 'c'},
+      {"type",                           required_argument, 0, 't'},
+      {"no-confirm",                no_argument,       0, 'y'},
+      {"auto-agree-with-licenses",  no_argument,       0, 'l'},
+      {"help",                      no_argument,       0, 'h'},
       {0, 0, 0, 0}
     };
     specific_options = install_options;
@@ -272,7 +273,9 @@
       "  Command options:\n"
       "\t--catalog,-c\t\t\tOnly from this catalog (under development)\n"
       "\t--type,-t <resolvable_type>\tType of resolvable (default: package)\n"
-      "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
+      "\t--no-confirm,-y\t\t\tDo not require user confirmation to proceed with installation\n"
+      "\t--auto-agree-with-licenses,-l\tAutomatically say 'yes' to third party license confirmation prompt.\n"
+      "\t\t\t\t\tSee man zypper for more details.\n"
       );
   }
   else if (command == ZypperCommand::REMOVE) {
@@ -415,9 +418,10 @@
   }
   else if (command == ZypperCommand::UPDATE) {
     static struct option update_options[] = {
-      {"type",                  required_argument, 0, 't'},
-      {"no-confirm", no_argument,       0, 'y'},
-      {"skip-interactive", no_argument, 0, 0},
+      {"type",                           required_argument, 0, 't'},
+      {"no-confirm",                no_argument,       0, 'y'},
+      {"skip-interactive",          no_argument,       0, 0},
+      {"auto-agree-with-licenses",  no_argument,       0, 'l'},
       {"help", no_argument, 0, 'h'},
       {0, 0, 0, 0}
     };
@@ -430,6 +434,8 @@
       "\t--type,-t <resolvable_type>\tType of resolvable (default: patch)\n"
       "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
       "\t--skip-interactive\t\tSkip interactive updates\n"
+      "\t--auto-agree-with-licenses,-l\tAutomatically say 'yes' to third party license confirmation prompt.\n"
+      "\t\t\t\t\tSee man zypper for more details.\n"
       );
   }
   else if (command == ZypperCommand::SEARCH) {
@@ -873,6 +879,9 @@
       }
 
       gData.packages_to_install = arguments;
+
+      if (copts.count("auto-agree-with-licenses"))
+        gSettings.license_auto_agree = true;
     }
 
     if (command == ZypperCommand::REMOVE) {
@@ -1091,6 +1100,9 @@
       return ZYPPER_EXIT_ERR_PRIVILEGES;
     }
 
+    if (copts.count("auto-agree-with-licenses"))
+      gSettings.license_auto_agree = true;
+
     string skind = copts.count("type")?  copts["type"].front() :
       gSettings.is_rug_compatible? "package" : "patch";
     kind = string_to_kind (skind);

Modified: trunk/zypper/src/zypper.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.h?rev=6080&r1=6079&r2=6080&view=diff
==============================================================================
--- trunk/zypper/src/zypper.h (original)
+++ trunk/zypper/src/zypper.h Wed Jul 18 20:50:54 2007
@@ -50,6 +50,7 @@
   is_rug_compatible(false),
   non_interactive(false),
   no_gpg_checks(false),
+  license_auto_agree(false),
   root_dir("/")
   {}
 
@@ -74,6 +75,7 @@
   bool is_rug_compatible;
   bool non_interactive;
   bool no_gpg_checks;
+  bool license_auto_agree;
   std::string root_dir;
 };
 

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages