{
// --force-resolution command line parameter value
tribool force_resolution = indeterminate;
- unsigned int count = zypper.cOpts().count("force-resolution");
- if (count)
- {
- string value = copts["force-resolution"].front();
- if (value == "on" || value == "true" || value == "1" || value == "yes")
- force_resolution = true;
- else if (value == "off" || value == "false" || value == "0" || value == "no")
- force_resolution = false;
- else
- {
- zypper.out().error(
- boost::str(format(_("Invalid value '%s' of the %s parameter"))
- % value % "force-resolution"),
- boost::str(format(_("Valid values are '%s' and '%s'")) % "on" % "off"));
- }
- if (count > 1)
- zypper.out().warning(boost::str(format(
- _("Considering only the first value of the %s parameter, ignoring the rest"))
- % "force-resolution"));
+ if (zypper.cOpts().count("force-resolution"))
+ force_resolution = true;
+ if (zypper.cOpts().count("no-force-resolution"))
+ {
+ if (force_resolution)
+ zypper.out().warning(str::form(
+ // translators: meaning --force-resolution and --no-force-resolution
+ _("%s conflicts with %s, will use the less aggressive %s"),
+ "--force-resolution", "--no-force-resolution", "--no-force-resolution"));
+ force_resolution = false;
}
// if --force-resolution was not specified on the command line, force
// rug compatibility, we have --auto-agree-with-licenses
{"agree-to-third-party-licenses", no_argument, 0, 0},
{"debug-solver", no_argument, 0, 0},
- {"force-resolution", required_argument, 0, 'R'},
+ {"no-force-resolution", no_argument, 0, 'R'},
+ {"force-resolution", no_argument, 0, 0 },
{"dry-run", no_argument, 0, 'D'},
// rug uses -N shorthand
{"dry-run", no_argument, 0, 'N'},
" See 'man zypper' for more details.\n"
" --debug-solver Create solver test case for debugging\n"
" --no-recommends Do not install recommended packages, only required.\n"
- "-R, --force-resolution <on|off> Force the solver to find a solution (even agressive)\n"
+ "-R, --no-force-resolution Do not force the solver to find solution, let it ask.\n"
+ " --force-resolution Force the solver to find a solution (even an agressive).\n"
"-D, --dry-run Test the installation, do not actually install\n"
)) % "package, patch, pattern, product" % "package");
break;
// rug compatibility, we have global --non-interactive
{"no-confirm", no_argument, 0, 'y'},
{"debug-solver", no_argument, 0, 0},
- {"force-resolution", required_argument, 0, 'R'},
+ {"no-force-resolution", no_argument, 0, 'R'},
+ {"force-resolution", no_argument, 0, 0 },
{"dry-run", no_argument, 0, 'D'},
// rug uses -N shorthand
{"dry-run", no_argument, 0, 'N'},
"-n, --name Select resolvables by plain name, not by capability\n"
"-C, --capability Select resolvables by capability\n"
" --debug-solver Create solver test case for debugging\n"
- "-R, --force-resolution <on|off> Force the solver to find a solution (even agressive)\n"
+ "-R, --no-force-resolution Do not force the solver to find solution, let it ask.\n"
+ " --force-resolution Force the solver to find a solution (even an agressive).\n"
"-D, --dry-run Test the removal, do not actually remove\n"
)) % "package, patch, pattern, product" % "package");
break;
{"agree-to-third-party-licenses", no_argument, 0, 0},
{"best-effort", no_argument, 0, 0},
{"debug-solver", no_argument, 0, 0},
- {"force-resolution", required_argument, 0, 'R'},
+ {"no-force-resolution", no_argument, 0, 'R'},
+ {"force-resolution", no_argument, 0, 0 },
{"no-recommends", no_argument, 0, 0 },
{"dry-run", no_argument, 0, 'D'},
// rug uses -N shorthand
" --best-effort Do a 'best effort' approach to update, updates to a lower than latest-and-greatest version are also acceptable\n"
" --debug-solver Create solver test case for debugging\n"
" --no-recommends Do not install recommended packages, only required.\n"
- "-R, --force-resolution <on|off> Force the solver to find a solution (even agressive)\n"
+ "-R, --no-force-resolution Do not force the solver to find solution, let it ask.\n"
+ " --force-resolution Force the solver to find a solution (even an agressive).\n"
"-D, --dry-run Test the update, do not actually update\n"
)) % "package, patch, pattern, product" % "patch");
break;