{"bz", required_argument, 0, 'b'},
{"bugzilla", required_argument, 0, 'b'},
{"cve", required_argument, 0, 0 },
+ {"category", required_argument, 0, 'g'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
" See man zypper for more details.\n"
"-b, --bugzilla # Install patch fixing the specified bugzilla issue.\n"
" --cve # Install patch fixing the specified CVE issue.\n"
+ "-g --category <category> Install all patches in this category.\n"
" --debug-solver Create solver test case for debugging.\n"
" --no-recommends Do not install recommended packages, only required.\n"
" --recommends Install also recommended packages in addition\n"
{"bz", optional_argument, 0, 'b'},
{"bugzilla", optional_argument, 0, 'b'},
{"cve", optional_argument, 0, 0 },
+ {"category", required_argument, 0, 'g'},
{"issues", optional_argument, 0, 0 },
{"all", no_argument, 0, 'a'},
{"help", no_argument, 0, 'h'},
" Command options:\n"
"-b, --bugzilla[=#] List needed patches for Bugzilla issues.\n"
" --cve[=#] List needed patches for CVE issues.\n"
+ "-g --category <category> List all patches in this category.\n"
" --issues[=string] Look for issues matching the specified string.\n"
"-a, --all List all patches, not only the needed ones.\n"
"-r, --repo <alias|#|URI> List only patches from the specified repository.\n"
return;
}
- if (_copts.count("category"))
- report_dummy_option(out(), "category");
-
// rug compatibility code
// switch on non-interactive mode if no-confirm specified
if (copts.count("no-confirm"))
sropts.best_effort = best_effort;
sropts.skip_interactive = skip_interactive; // bcn #647214
+ // if --category is specified
+ {
+ parsed_opts::const_iterator optit;
+ optit = copts.find("category");
+ if (optit != copts.end())
+ {
+ for_(i, optit->second.begin(), optit->second.end())
+ {
+ sropts.category = *i;
+ break;
+ }
+ }
+ }
+
SolverRequester sr(sropts);
if (arguments().empty())
{
{
bool all = zypper.cOpts().count("all");
+ // if --category is specified
+ string category;
+ {
+ parsed_opts::const_iterator it;
+ it = zypper.cOpts().find("category");
+ if (it != zypper.cOpts().end())
+ {
+ for_(i, it->second.begin(), it->second.end())
+ {
+ category = *i;
+ break;
+ }
+ }
+ else {
+ it = zypper.cOpts().find("g");
+ if (it != zypper.cOpts().end())
+ {
+ for_(i, it->second.begin(), it->second.end())
+ {
+ category = *i;
+ break;
+ }
+ }
+ }
+ }
+
Table tbl;
Table pm_tbl; // only those that affect packagemanager (restartSuggested()), they have priority
TableHeader th;
{
Patch::constPtr patch = asKind<Patch>(res);
+ if (!category.empty() && category != patch->category())
+ {
+ DBG << "candidate patch " << patch << " is not in the specified category" << endl;
+ continue;
+ }
+
{
TableRow tr (cols);
tr << (zypper.config().show_alias ? patch->repoInfo().alias() : patch->repoInfo().name());