DBG << "candidate patch " << patch << " is locked" << endl;
addFeedback(Feedback::PATCH_UNWANTED, patchspec, selected, selected);
}
+
else if (!_opts.category.empty() && _opts.category != patch->category())
{
DBG << "candidate patch " << patch << " is not in the specified category" << endl;
addFeedback(Feedback::PATCH_WRONG_CAT, patchspec, selected, selected);
}
+
+ else if (_opts.date_limit != Date()
+ && patch->timestamp() > _opts.date_limit)
+ {
+ DBG << "candidate patch " << patch << " is newer than specified date" << endl;
+ addFeedback(Feedback::PATCH_TOO_NEW, patchspec, selected, selected);
+ }
else
{
// TODO use _opts.force
{"bugzilla", required_argument, 0, 'b'},
{"cve", required_argument, 0, 0 },
{"category", required_argument, 0, 'g'},
+ {"date", required_argument, 0, 0 },
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
"-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"
+ " --date <YYYY-MM-DD> Install patches issued until the specified date\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"
{"bugzilla", optional_argument, 0, 'b'},
{"cve", optional_argument, 0, 0 },
{"category", required_argument, 0, 'g'},
+ {"date", required_argument, 0, 0 },
{"issues", optional_argument, 0, 0 },
{"all", no_argument, 0, 'a'},
{"help", no_argument, 0, 'h'},
" --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"
+ " --date <YYYY-MM-DD> List patches issued up to the specified date\n"
);
break;
}
else
{
SolverRequester::Options sropts;
- if (copts.find("force") != copts.end())
+ if (copts.find("force") !=
+copts.end())
sropts.force = true;
sropts.best_effort = best_effort;
sropts.skip_interactive = skip_interactive; // bcn #647214
}
}
+ // if --date is specified
+ {
+ parsed_opts::const_iterator optit;
+ optit = copts.find("date");
+ if (optit != copts.end())
+ {
+ for_(i, optit->second.begin(), optit->second.end())
+ {
+ // ISO 8601 format
+ sropts.date_limit = Date(*i, "%F");
+ break;
+ }
+ }
+
+ }
+
SolverRequester sr(sropts);
if (arguments().empty())
{
static bool list_patch_updates(Zypper & zypper)
{
bool all = zypper.cOpts().count("all");
+ // if --date is specified
+ Date date_limit;
+ {
+ parsed_opts::const_iterator it;
+ it = zypper.cOpts().find("date");
+ if (it != zypper.cOpts().end())
+ {
+ for_(i, it->second.begin(), it->second.end())
+ {
+ // ISO 8601 format
+ date_limit = Date(*i, "%F");
+ break;
+ }
+ }
+ }
// if --category is specified
string category;
if (all || (it->isBroken() && !it->isUnwanted()))
{
Patch::constPtr patch = asKind<Patch>(res);
+ if (date_limit != Date() && patch->timestamp() > date_limit ) {
+ DBG << patch->ident() << " skipped. (too new and date limit specified)" << endl;
+ continue;
+ }
if (!category.empty() && category != patch->category())
{
continue;
}
+ // table
{
TableRow tr (cols);
tr << (zypper.config().show_alias ? patch->repoInfo().alias() : patch->repoInfo().name());