Author: jkupec
Date: Mon Jul 30 13:36:04 2007
New Revision: 6278
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6278&view=rev
Log:
- Rug's --no-confirm option changed to work as --non-interactive
- moved --no-confirm from help texts and man page to COMPATIBILITY WITH
RUG section of the man page
Modified:
trunk/zypper/doc/zypper.8
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-misc.h
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=6278&r1=6277&r2=6278&view=diff
==============================================================================
--- trunk/zypper/doc/zypper.8 (original)
+++ trunk/zypper/doc/zypper.8 Mon Jul 30 13:36:04 2007
@@ -3,25 +3,23 @@
.LP
zypper [\fI\-\-global\-options\fR] <\fBcommand\fR> [\fI\-\-command\-options\fR] [\fBcommand-arguments\fR]
-zypper \fI\-\-help\fR
+zypper \fI\-\-help\fR [\fBcommand\fR]
.SH "DESCRIPTION"
.LP
-zypper is a command\-line interface to ZYPP system management library. It can be used to install, update, remove software, manage repositories, perform various searches, and more.
+zypper is a command\-line interface to ZYpp system management library. It can be used to install, update, remove software, manage repositories, perform various searches, and more.
.SH "COMMANDS"
.LP
zypper provides a number of \fBcommands\fR. Each command accepts the options listed in the GLOBAL OPTIONS section. In addition, many commands have specific options, which are listed in this section.
-.LP
-.B General Commands
+.SS General Commands
.TP
.B shell (sh)
Starts a shell for entering multiple commands in one session.
End it by "exit", "quit", or Ctrl-D.
-.LP
-.B Package Management Commands
+.SS Package Management Commands
.LP
zypper works with several types of resource objects, called
@@ -69,9 +67,6 @@
.I \-n, \-\-name
Select resolvables by older method, considering just names, not capabilities.
.TP
-.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.
@@ -97,12 +92,8 @@
.TP
.I \-n, \-\-name
Select resolvables by older method, considering just names, not capabilities.
-.TP
-.I \-y, \-\-no-confirm
-Don't require user confirmation.
-Capability is usually a plain name, for details see the install
-command.
+Capability is usually a plain name, for details see the install command.
.TP
.B update (up) [options]
@@ -114,9 +105,6 @@
\fI\--from-repo\fR
Limit to updates available from named repository
.TP
-.I \-y, \-\-no-confirm
-Don't require user confirmation.
-.TP
.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
@@ -181,8 +169,7 @@
\fI \-\-sort\-by\-catalog\fR
Sort resolvables by catalog, not by name.
-.LP
-.B Patch Management
+.SS Patch Management
.TP
.B patch-check (pchk)
@@ -199,9 +186,8 @@
.TP
.B patch-info <name> ...
Displays full info for the specified patches.
-
-.LP
-.B Repository Management
+
+.SS Repository Management
.LP
zypper is able to work with YaST, YUM, and aptrpm
@@ -353,10 +339,10 @@
.SH "COMPATIBILITY WITH RUG"
.LP
-zypper is designed to be compatible with rug, which is a command\-line interface to the ZENworks Linux Management (ZLM) agent. Compared to rug, zypper does not need the ZLM daemon to run, and is intented to provide more and improved functionality. Following is a list of zypper-rug command aliases and compatibility notes. See also compatibility notes in descriptions of zypper commands.
+zypper is designed to be compatible with rug, which is a command\-line interface to the ZENworks Linux Management (ZLM) agent. Compared to rug, zypper does not need the ZLM daemon to run, and is intented to provide more and improved functionality. Following is a list of zypper-rug command aliases, supported rug command line options, and compatibility notes. See also compatibility notes in descriptions of zypper commands.
.LP
-.B Service Management Commands
+.SS Service Management Commands
.LP
ZENworks distinguishes services and catalogs. A service is
added by URI and contains one or more catalogs. Libzypp does not have
@@ -376,6 +362,40 @@
.I rug service-list (sl)
zypper repos (lr)
+.LP
+.SS Package Management Commands
+
+.TP
+.I rug install (in)
+zypper install (in)
+.RS
+.TP
+.I \-y, \-\-no\-confirm
+Don't require user interaction. This option is implemented using zypper's non-interactive mode.
+.TP
+.I \-\-agree\-to\-third\-party\-licenses
+This option is an alias to zypper's --auto-agree-with-licenses option.
+.RE
+
+.TP
+.I rug remove (rm)
+zypper remove (rm)
+.RS
+.TP
+.I \-y, \-\-no\-confirm
+Don't require user interaction. This option is implemented using zypper's non-interactive mode.
+.RE
+
+.TP
+.I rug update (up)
+zypper update (up)
+.RS
+.TP
+.I \-y, \-\-no\-confirm
+Don't require user interaction. This option is implemented using zypper's non-interactive mode.
+.I , \-\-agree\-to\-third\-party\-licenses
+This option is an alias to zypper's --auto-agree-with-licenses option.
+.RE
.SH "NOTE"
.LP
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=6278&r1=6277&r2=6278&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Mon Jul 30 13:36:04 2007
@@ -281,7 +281,7 @@
}
//! @return true to retry solving now, false to cancel, indeterminate to continue
-tribool show_problem (bool non_interactive, const ResolverProblem & prob, ProblemSolutionList & todo)
+tribool show_problem (const ResolverProblem & prob, ProblemSolutionList & todo)
{
ostream& stm = cerr;
string det;
@@ -304,7 +304,7 @@
stm << " " << det << endl;
}
- if (non_interactive)
+ if (gSettings.non_interactive)
return false;
int reply;
@@ -337,7 +337,7 @@
}
// return true to retry solving, false to cancel transaction
-bool show_problems (bool non_interactive)
+bool show_problems ()
{
bool retry = true;
ostream& stm = cerr;
@@ -357,7 +357,7 @@
}
for (i = b; i != e; ++i) {
stm << endl;
- tribool stopnow = show_problem (non_interactive, *(*i), todo);
+ tribool stopnow = show_problem (*(*i), todo);
if (! indeterminate (stopnow)) {
retry = stopnow == true;
break;
@@ -1063,13 +1063,13 @@
* ZYPPER_EXIT_INF_REBOOT_NEEDED - if one of patches to be installed needs machine reboot,
* ZYPPER_EXIT_INF_RESTART_NEEDED - if one of patches to be installed needs package manager restart
*/
-int solve_and_commit (bool non_interactive, bool have_extra_deps ) {
+int solve_and_commit (bool have_extra_deps ) {
while (true) {
bool success = resolve( have_extra_deps );
if (success)
break;
- success = show_problems (non_interactive);
+ success = show_problems ();
if (! success) {
// TODO cancel transaction?
return ZYPPER_EXIT_ERR_ZYPP; // #242736
@@ -1081,9 +1081,9 @@
int retv = show_summary();
if (retv >= 0) { // there are resolvables to install/uninstall
- if (read_bool_answer(_("Continue?"), non_interactive)) {
+ if (read_bool_answer(_("Continue?"), true)) {
- if (!confirm_licenses(non_interactive)) return ZYPPER_EXIT_OK;
+ if (!confirm_licenses()) return ZYPPER_EXIT_OK;
cerr_v << _("committing") << endl;
@@ -1136,7 +1136,7 @@
// ask for [y/n/r] with 'r' for read the license text
// (opened throu more or less, etc...)
// - after negative answer, call solve_and_commit() again
-bool confirm_licenses(bool non_interactive)
+bool confirm_licenses()
{
bool confirmed = true;
@@ -1160,34 +1160,39 @@
continue;
}
- cout << it->resolvable()->name() << " " <<
- it->resolvable()->kind().asString() <<
- " " << _("license") << ": " <<
- it->resolvable()->licenseToConfirm() << endl;
+ cout << format(_("%s %s license:"))
+ % it->resolvable()->name() % it->resolvable()->kind().asString()
+ << it->resolvable()->licenseToConfirm() << endl;
string question = _("In order to install this package, you must agree"
" to terms of the above licencse. Continue?");
- if (non_interactive || !read_bool_answer(question, false))
+ if (!read_bool_answer(question, gSettings.license_auto_agree))
{
confirmed = false;
-
- if (non_interactive)
+
+ if (gSettings.non_interactive)
{
cout << endl <<
_("Aborting installation due to the need of"
- " license(s) confirmation.") <<
- " " << _("Please, restart the operation in interactive"
- " mode and confirm agreement with required license(s).")
+ " license(s) confirmation.") << " ";
+ // TranslatorExplanation Don't translate the '--auto-agree-with-licenses',
+ // it is a command line option
+ cout << _("Please, restart the operation in interactive"
+ " mode and confirm agreement with required license(s),"
+ " or use the --auto-agree-with-licenses option.")
<< endl;
+ MIL << "License(s) NOT confirmed (non-interactive without auto confirmation)" << endl;
}
else
{
- cout << endl <<
- _("Aborting installation due to user disagreement"
- " with ") << it->resolvable()->name() << " " <<
- it->resolvable()->kind().asString() <<
- " " << _("license") << "." << endl;
+ cout << endl;
+ // TranslatorExplanation e.g. "... with flash package license."
+ cout << format(
+ _("Aborting installation due to user disagreement with %s %s license."))
+ % it->resolvable()->name() % it->resolvable()->kind().asString()
+ << endl;
+ MIL << "License(s) NOT confirmed (interactive)" << endl;
}
break;
Modified: trunk/zypper/src/zypper-misc.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.h?rev=6278&r1=6277&r2=6278&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.h (original)
+++ trunk/zypper/src/zypper-misc.h Mon Jul 30 13:36:04 2007
@@ -79,8 +79,26 @@
void list_updates( const zypp::ResObject::Kind &kind, const std::string &repo_alias, bool best_effort );
void mark_updates( const zypp::ResObject::Kind &kind, const std::string &repo_alias, bool skip_interactive, bool best_effort );
void usage(int argc, char **argv);
-int solve_and_commit (bool non_interactive = false, bool have_extra_deps = false );
-bool confirm_licenses(bool non_interactive = false);
+
+/**
+ * Runs solver on the pool, asks to choose solution of eventual problems
+ * (when run interactively) and commits the result.
+ *
+ * \param have_extra_deps ?
+ * \return ZYPPER_EXIT_INF_REBOOT_NEEDED, ZYPPER_EXIT_INF_RESTART_NEEDED,
+ * or ZYPPER_EXIT_OK or ZYPPER_EXIT_ERR_ZYPP on zypp erorr.
+ *
+ */
+int solve_and_commit (bool have_extra_deps = false);
+
+/**
+ * Loops through resolvables, checking if there is license to confirm. When
+ * run interactively, it displays a dialog, otherwise it answers automatically
+ * according to --auto-agree-with-licenses present or not present.
+ *
+ * \returns true if all licenses have been confirmed, false otherwise.
+ */
+bool confirm_licenses();
// copied from yast2-pkg-bindings:PkgModuleFunctions::DoProvideNameKind
struct ProvideProcess
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=6278&r1=6277&r2=6278&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Mon Jul 30 13:36:04 2007
@@ -265,8 +265,11 @@
{"catalog", required_argument, 0, 'c'},
{"type", required_argument, 0, 't'},
{"name", no_argument, 0, 'n'},
- {"no-confirm", no_argument, 0, 'y'},
+ // rug compatibility, we have global --non-interactive
+ {"no-confirm", no_argument, 0, 'y'},
{"auto-agree-with-licenses", no_argument, 0, 'l'},
+ // rug compatibility, we have --auto-agree-with-licenses
+ {"agree-to-third-party-licenses", no_argument, 0, 0},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
@@ -280,10 +283,9 @@
"\t--catalog,-c\t\t\tOnly from this catalog (under development)\n"
"\t--type,-t \tType of resolvable (package, patch, pattern, product) (default: package)\n"
"\t--name,-n\t\t\tSelect resolvables by plain name, not by capability\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) {
static struct option remove_options[] = {
@@ -302,7 +304,6 @@
" Command options:\n"
"\t--type,-t \tType of resolvable (package, patch, pattern, product) (default: package)\n"
"\t--name,-n\t\t\tSelect resolvables by plain name, not by capability\n"
- "\t--no-confirm,-y\t\t\tDo not require user confirmation\n"
);
}
else if (command == ZypperCommand::ADD_REPO) {
@@ -432,7 +433,6 @@
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},
{"auto-agree-with-licenses", no_argument, 0, 'l'},
{ "from-repo", required_argument, 0, 0 },
@@ -447,12 +447,11 @@
" Command options:\n"
"\n"
"\t--type,-t \tType of resolvable (package, patch, pattern, product) (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"
"\t--from-repo \tRestrict updates to named repository (default: get updates from all repositories)\n"
"\t--best-effort\t\t\tDo a 'best effort' approach to update, updates to a lower than latest-and-greatest version are also acceptable\n"
- "\t\t\t\t\tSee man zypper for more details.\n"
);
}
else if (command == ZypperCommand::SEARCH) {
@@ -919,8 +918,6 @@
if (copts.count("auto-agree-with-licenses"))
gSettings.license_auto_agree = true;
-
-
}
if (command == ZypperCommand::REMOVE) {
@@ -939,6 +936,12 @@
return ZYPPER_EXIT_ERR_PRIVILEGES;
}
+ // rug compatibility code
+ // switch on non-interactive mode if no-confirm specified
+ if (copts.count("no-confirm"))
+ gSettings.non_interactive == true;
+
+
// read resolvable type
string skind = copts.count("type")? copts["type"].front() : "package";
kind = string_to_kind (skind);
@@ -975,8 +978,8 @@
else
mark_by_capability (install_not_remove, kind, *it);
}
-
- solve_and_commit (copts.count("no-confirm") || gSettings.non_interactive, !just_name);
+
+ solve_and_commit (!just_name);
return ZYPPER_EXIT_OK;
}
@@ -1151,6 +1154,11 @@
return ZYPPER_EXIT_ERR_PRIVILEGES;
}
+ // rug compatibility code
+ // switch on non-interactive mode if no-confirm specified
+ if (copts.count("no-confirm"))
+ gSettings.non_interactive == true;
+
if (copts.count("auto-agree-with-licenses"))
gSettings.license_auto_agree = true;
@@ -1182,7 +1190,7 @@
// commit
// returns ZYPPER_EXIT_OK, ZYPPER_EXIT_ERR_ZYPP,
// ZYPPER_EXIT_INF_REBOOT_NEEDED, or ZYPPER_EXIT_INF_RESTART_NEEDED
- return solve_and_commit( copts.count("no-confirm") || gSettings.non_interactive, best_effort );
+ return solve_and_commit(best_effort);
}
// -----------------------------( info )------------------------------------
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org