Bug 627316

Summary: kupdate wants to apply patches that I don't need/want
Product: [openSUSE] openSUSE 11.3 Reporter: nick savolainen <nick.savolainen>
Component: libzyppAssignee: E-mail List <gnome-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P2 - High CC: ctrippe, dvaleev, EagleScreen, gfarrell, javier, jsuchome, lslezak, ma, tgoettlicher
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.3   
Whiteboard: maint:released:sle11-sp1:41910
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description nick savolainen 2010-08-01 14:51:55 UTC
User-Agent:       Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.2.15 Version/10.11

Yast/kupdate wants to patch some things with patches from the updates repo, to manually installed and packman packages that don't need patching.  Patches marked as taboo through yast->update do not retain their taboo flags.  It also ignores "protected" packages and wants to patch those too.  It also seems to ignore my repo priority numbers.

Reproducible: Always

Steps to Reproduce:
1. install k3b from packman or a manually compiled+patched wine for example
2. yast->update, mark the patches it wants to install as taboo
3. reboot, go to work, whatever
Actual Results:  
kupdate still notifies you that patches are available

Expected Results:  
update system to honour my settings and kupdate to not notify me of the unwanted/needed patches
Comment 1 Michael Andres 2010-08-02 10:44:24 UTC
@Jano: As zypper seems to operate on PoolItems, I ported the ui::Selectables classification methods isNeeded() and isUnwanted() to PoolItem.

- isNeeded are already selected or unlocked-broken patches.
- isUnwanted are locked-broken patches.

Thus zyppers list_patch_updates could e.g list

  -    if (all || it->isBroken())
  +    if (all || it->isNeeded())

and classify as 

-        tr << (it->isBroken() ? _("needed") : _("not needed"));
+        tr << (it->isNeeded() ? _("needed") 
                               : (it->isUnwanted() ? _("unwanted") 
                                                   : _("not needed")));

There are probably some other locations where changes are needed to respect unwanted (locked) patches.

The new methods are available in libzypp-7.9.0 (for 11.3) and -8.1.0.
Comment 2 Michael Andres 2010-08-10 09:43:57 UTC
*** Bug 629516 has been marked as a duplicate of this bug. ***
Comment 6 Geoff Farrell 2010-08-16 10:00:23 UTC
It may be true that libzypp's handling of locked patches was faulty, but it isn't the cause of this bug. Instead of having to lock a patch, it would be preferable for kupdateapplet to correctly assess the requirement for an update in the first place.

In this instance, these are the k3b package details:

Updates repository:
k3b-2.0.0-1.1.1.x86_64.rpm, date compiled: 22 Jul 2010 18:55:59 UTC

Packman repository:
k3b-2.0.0-1.pm.2.14.x86_64.rpm, date compiled: 08 Aug 2010 01:31:59 UTC

On both version number and date, the 'updates' repository package does not qualify as an 'update' if the Packman package is installed. Flagging it as an update when it's not is the bug. Making the user 'lock' the patch is just papering over the bug.

As well, on my system, I have the Updates repository set at a priority of 90, and the Packman repository set at 80. Therefore, regardless of kupdateapplet's assessment of the packages' version numbers, the repository priority should block the update from being flagged. Since it doesn't, kupdateapplet fails on a second count here.

To fix this bug, there seem to be two things that need to be corrected:
1. kupdateapplet does not correctly assess patches according to version, and
2. It does not filter patches according to repository priority.
Comment 8 Jan Kupec 2010-08-24 09:12:37 UTC
comment #1: Michael, this isn't about zypper, but rather yast and kupdateapplet. Zypper has it's own related bug 420606.

Thomas, Jirka, Lada, can you fix yast according to Michael's comment #1? I'll take care of zypper.

Michael, to make it work in kupdateapplet we probably need to fix the evaluation of needed patches in packagekit, right? Or is it done already? We should probably create a copy of this bug to track that.
Comment 9 Ladislav Slezák 2010-09-30 16:36:13 UTC
JFYI: I have fixed yast2-pkg-bindings to ignore unwanted patches:
-	    if (s && s->isNeeded())
+	    if (s && s->isNeeded() && !s->isUnwanted())

Fixed in yast2-pkg-bindings-2.20.0 (FACTORY, openSUSE-11.4), let me know if the patch is also needed in 11.3 (maint. update).
Comment 10 Christian Trippe 2010-09-30 17:11:10 UTC
It would be nice if an update for 11.3 could be released. Thanks
Comment 11 Ladislav Slezák 2010-09-30 17:40:41 UTC
You can install yast2-pkg-bindings-2.20.0 for 11.3 from http://download.opensuse.org/repositories/YaST:/Head/openSUSE_11.3

Let me know if it fixes the problem in yast (of course this won't fix kupdate applet).
Comment 12 Christian Trippe 2010-09-30 17:51:29 UTC
Yes the problem is fixed for yast with yast2-pkg-bindings-2.20.0 on 11.3
Comment 13 Thomas Göttlicher 2010-10-11 09:48:43 UTC
kupdateapplet doesn't need to be changed as it retrieves the list of packages via packagekit and therefore doesn't have code that selects patches.
Comment 20 Swamp Workflow Management 2011-07-08 18:04:25 UTC
Update released for: PackageKit, PackageKit-debuginfo, PackageKit-debugsource, PackageKit-devel, PackageKit-lang, libpackagekit-glib10, libpackagekit-glib10-devel, libpackagekit-qt10, libpackagekit-qt10-devel, libsatsolver, libsatsolver-debuginfo, libsatsolver-debugsource, libsatsolver-demo, libsatsolver-devel, libzypp, libzypp-debuginfo, libzypp-debugsource, libzypp-devel, perl-satsolver, python-satsolver, ruby-satsolver, satsolver-tools, zypper, zypper-debuginfo, zypper-debugsource
Products:
SLE-DEBUGINFO 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
SLE-DESKTOP 11-SP1 (i386, x86_64)
SLE-SDK 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP1 (i386, x86_64)
Comment 21 Ladislav Slezák 2011-07-19 07:33:31 UTC
JFYI: also fixed upstream in PackageKit GIT (will be in version 0.7)
Comment 22 Dirk Mueller 2011-07-22 08:16:16 UTC
completely fixed then?
Comment 23 Ladislav Slezák 2011-07-22 08:52:55 UTC
Not yet, fix for SP2 is still pending.
Comment 24 Ladislav Slezák 2011-07-22 09:15:49 UTC
Yeah, it has been already accepted, resolving as FIXED.
Comment 25 Bernhard Wiedemann 2016-04-15 12:54:15 UTC
This is an autogenerated message for OBS integration:
This bug (627316) was mentioned in
https://build.opensuse.org/request/show/49592 Factory / yast2-pkg-bindings