return str::form(_("Patch '%s' is not needed."), pname.str().c_str());
}
+ case PATCH_UNWANTED:
+ {
+ ostringstream pname;
+ pname << _objsel->name() << "-" << _objsel->edition();
+ string cmd = "zypper rl patch:" + _objsel->name();
+ return str::form(_("Patch '%s' is locked. Use '%s' to install it, or unlock it using '%s'."),
+ pname.str().c_str(), "--force", cmd.c_str());
+ }
+
case SET_TO_INSTALL:
return str::form(
_("Selecting '%s' from repository '%s' for installation."),
case UPD_CANDIDATE_IS_LOCKED:
case SELECTED_IS_OLDER:
case PATCH_NOT_NEEDED:
+ case PATCH_UNWANTED:
case FORCED_INSTALL:
out.info(asUserString(opts));
break;
addFeedback(Feedback::PATCH_INTERACTIVE_SKIPPED, patchspec, selected);
return false;
}
+ else if (selected.isUnwanted())
+ {
+ if (_command == ZypperCommand::INSTALL || _command == ZypperCommand::UPDATE)
+ {
+ DBG << "candidate patch " << patch << " is locked" << endl;
+ addFeedback(Feedback::PATCH_UNWANTED, patchspec, selected, selected);
+ }
+ }
else
{
// TODO use _opts.force
*/
PATCH_INTERACTIVE_SKIPPED,
+ /**
+ * Patch was requested (install/update command), but it's locked
+ * (set to ignore). Its installation can be forced with --force.
+ *
+ * In the 'patch' command, do not issue this feedback, silently skip
+ * the unwanted patch.
+ */
+ PATCH_UNWANTED,
+
// ********** zypp requests *********************************************
SET_TO_INSTALL,
{
ResObject::constPtr res = it->resolvable();
- if (all || it->isBroken())
+ // show only needed and wanted/unlocked (bnc #420606) patches unless --all
+ if (all || (it->isBroken() && !it->isUnwanted()))
{
Patch::constPtr patch = asKind<Patch>(res);
void list_patches_by_issue(Zypper & zypper)
{
- // lu --issues - list all issues which need to be fixed
- // lu --issues=foo - look for foo in issue # or description
- // lu --bz - list all bugzilla issues
- // lu --cve - list all CVE issues
- // lu --bz=foo --cve=foo - look for foo in bugzillas or CVEs
- // --all - list all, not only needed patches
+ // lp --issues - list all issues which need to be fixed
+ // lp --issues=foo - look for foo in issue # or description
+ // lp --bz, --bugzilla - list all bugzilla issues
+ // lp --cve - list all CVE issues
+ // lp --bz=foo --cve=foo - look for foo in bugzillas or CVEs
+ // lp --all - list all, not only needed patches
// --bz, --cve can't be used together with --issue; this case is ruled out
// in the initial arguments validation in Zypper.cc
for_(it, q.begin(), q.end())
{
PoolItem pi(*it);
- if (only_needed && !pi.status().isBroken())
+ if (only_needed && (!pi.isBroken() || pi.isUnwanted()))
continue;
Patch::constPtr patch = asKind<Patch>(pi.resolvable());
for_(it, q.begin(), q.end())
{
PoolItem pi(*it);
- if (only_needed && !pi.status().isBroken())
+ if (only_needed && (!pi.isBroken() || pi.isUnwanted()))
continue;
Patch::constPtr patch = asKind<Patch>(pi.resolvable());