"Mark All Upgrades" clears packages marked for removal

Bug #50837 reported by Matthew Paul Thomas
48
This bug affects 6 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Low
Papercuts Ninjas
synaptic
Fix Released
Undecided
Unassigned
synaptic (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Synaptic 0.75.1ubuntu1, Ubuntu Natty

1. Mark a package/some packages for removal/complete removal.
2. Click the Mark all upgrades button (You can click Reload before, but that doesn't change the behavior, it's the same with or without packages to be upgraded).

What should happen:
* If there are any upgrades available, they should be marked, otherwise nothing should happen

What actually happens:
* The upgrades are marked. (Today there happened to be none.)
* The packages selected for removal you wanted is cleared.

Changed in synaptic:
status: Unconfirmed → Confirmed
Changed in synaptic:
importance: Undecided → Low
status: Confirmed → Triaged
Changed in synaptic:
status: New → Confirmed
Vish (vish)
Changed in hundredpapercuts:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Vish (vish) wrote :

Seems it isnt a very tough bug to fix , but needs a bit of attention.

Revision history for this message
clubsoda (clubsoda) wrote :

Confirmed still present on Lucid beta (including all repository updates) as of this date.

When tidying up an installation, it is not at all unusual to do the following:-
* mark all local or obsolete packages for removal
* mark all auto-removable packages for removal
* mark all upgrades.

That's when this bug kicks in, cancelling the two prior actions.

"Mark all upgrades" should preferably be additive, not clean-slate absolute.

Cheers.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Still present in Lucid release.

Changed in hundredpapercuts:
status: Confirmed → Triaged
Revision history for this message
Steven Danna (ssd7) wrote :

I don't think "Mark All Upgrades" is the culprit here. The following is what I see in Lucid, can anyone confirm?

Situation 1:
1) Mark Some Changes
2) Press "Mark All Upgrades"
3) Changes marked in (1) are still present.

Situation 2:
1) Mark Some Changes
2) Press "Reload"
3) Changes marked in (1) are cleared.

This behavior isn't actually completely unreasonable since, upon reload, the version or dependencies could be different.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Steven, if that is a bug, it is not the bug described in this bug report.

description: updated
Changed in hundredpapercuts:
assignee: nobody → Papercuts Ninja (papercuts-ninja)
Revision history for this message
tuxator (steffen-trekki) wrote :

as it seems the bug has not been fixed (I can reproduce it in Ubuntu 10.10) and I am almost sure about what the problem is.

for reference: http://bazaar.launchpad.net/~synaptic-developers/synaptic/trunk/annotate/head%3A/gtk/rgmainwindow.cc

following functions are part of this problem (if I'm right):

void RGMainWindow::cbUpgradeClicked [this is the function that is triggered when someone clicks the "Upgrade" button in synaptic]
bool RGMainWindow::askStateChange [this function is triggered by cbUpgradeClicked]

Let's look at function cbUpgradeClicked. look for this line: me->askStateChange(state, nullVector); (atm it's line 3142)
=====explanation of the quite obvious but noteable for someone like me who don't know c++/synaptic source code ========
The called function asks the user if he really wants to install the packages and lists the packages that should be installed. Now, in our case, instead of showing all packages, it only lists the packages that were aquired by the upgrade function. The cause of this is the state variable, which has (as far as I understand the source code, sorry I've never looked at it before) the packages which should be installed/upgraded/removed whatever. If you click "no" in this change window, you'll get your marked package back, which shows us that it was in the state variable 9 lines above, where it says "me->_lister->saveState(state);"

I'm not almost sure what that line does, I tracked it down to http://bazaar.launchpad.net/~synaptic-developers/synaptic/trunk/annotate/head%3A/common/rpackagelister.cc function "saveState" but I can't find any type named pkgState, so I can't say what it "save" function does. My best guess is, that it creates a shadow-copy of the state variable and resets it.
==============================================================================
The only way I see here is to shadow-copy the state variable before calling saveState, then call saveState and before calling "askStateChange", merge "our" shadow-copy with the state variable, so that _all_ changes are included in this variable.

Why I'm not doing this and uploading a text file with the changes: I don't know how to do this in C++. I don't even think I could do it in C#/Java because I don't know the type definition of "state" or how to handle it

Revision history for this message
tuxator (steffen-trekki) wrote :

[quote]before calling "askStateChange", merge "our" shadow-copy [/quote]
no comma here -> "before calling "askStateChange" merge "our" shadow-copy"

Revision history for this message
Robert Roth (evfool) wrote :

I've just tried this on Natty, selected a package, then clicked mark all upgrades, and the upgrades were selected, and the package I've selected was still selected, so the problem is not that Mark all upgrades clears the selection, but that the Reload clears the selection, just as Steven Danna commented in comment #4.

Revision history for this message
Robert Roth (evfool) wrote :

I've tried selecting a package, Reloading and then marking all upgrades, and the package is still selected, so the problem doesn't seem to occur anymore. Can anyone confirm that this has been fixed in Natty?

Revision history for this message
Robert Roth (evfool) wrote :

I have found the real problem, changing the title and the description accordingly.

summary: - "Mark All Upgrades" removes all previous markings
+ "Mark All Upgrades" clears packages marked for removal
Robert Roth (evfool)
description: updated
Revision history for this message
Timothy Arceri (t-fridey) wrote :

This seems to be fixed in Oneiric (synaptic 0.75.2ubuntu6) can someone confirm.

Revision history for this message
clubsoda (clubsoda) wrote :

Agreed.
Seems to be fixed both for "Reload" and "Mark All Upgrades".
0.75.2ubuntu7

Changed in synaptic (Ubuntu):
status: Triaged → Fix Released
Changed in synaptic:
status: Confirmed → Fix Released
Changed in hundredpapercuts:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.