Merge lp:~jibel/synaptic/bug.513460 into lp:synaptic

Proposed by Jean-Baptiste Lallement
Status: Merged
Merged at revision: 1771
Proposed branch: lp:~jibel/synaptic/bug.513460
Merge into: lp:synaptic
Diff against target: 64 lines (+22/-9)
1 file modified
gtk/rgmainwindow.cc (+22/-9)
To merge this branch: bzr merge lp:~jibel/synaptic/bug.513460
Reviewer Review Type Date Requested Status
synaptic-developers Pending
Review via email: mp+23173@code.launchpad.net

Description of the change

I applied nearly the same checks than those to enable/disable the contextual menu entries.
It fixes the synaptic bug but there is still something odd with apt.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks! I merged it into the lucid branch, the next step is to merge into trunk/ and upload to debian.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/rgmainwindow.cc'
2--- gtk/rgmainwindow.cc 2010-03-25 20:34:44 +0000
3+++ gtk/rgmainwindow.cc 2010-04-11 11:29:16 +0000
4@@ -641,6 +641,7 @@
5 vector<RPackage *> exclude;
6 vector<RPackage *> instPkgs;
7 RPackage *pkg = NULL;
8+ int flags;
9
10 while (li != NULL) {
11 pkgDepCache::ActionGroup group(*_lister->getCache()->deps());
12@@ -650,6 +651,8 @@
13 if (pkg == NULL)
14 continue;
15
16+ flags = pkg->getFlags();
17+
18 pkg->setNotify(false);
19
20 // needed for the stateChange
21@@ -660,24 +663,34 @@
22 pkgKeepHelper(pkg);
23 break;
24 case PKG_INSTALL: // install
25- instPkgs.push_back(pkg);
26- pkgInstallHelper(pkg, false);
27+ // install only if not installed
28+ if(!(flags & RPackage::FInstalled))
29+ pkgInstallHelper(pkg, false);
30 break;
31 case PKG_INSTALL_FROM_VERSION: // install with specific version
32- pkgInstallHelper(pkg, false);
33+ if(!(flags & RPackage::FInstalled))
34+ pkgInstallHelper(pkg, false);
35 break;
36 case PKG_REINSTALL: // reinstall
37- instPkgs.push_back(pkg);
38- pkgInstallHelper(pkg, false, true);
39- break;
40+ // Only reinstall installable packages and non outdated packages
41+ if(flags & RPackage::FInstalled
42+ && !(flags & RPackage::FNotInstallable)
43+ && !(flags & RPackage::FOutdated)) {
44+ instPkgs.push_back(pkg);
45+ pkgInstallHelper(pkg, false, true);
46+ }
47+ break;
48 case PKG_DELETE: // delete
49- pkgRemoveHelper(pkg);
50+ if(flags & RPackage::FInstalled)
51+ pkgRemoveHelper(pkg);
52 break;
53 case PKG_PURGE: // purge
54- pkgRemoveHelper(pkg, true);
55+ if(flags & RPackage::FInstalled || flags & RPackage::FResidualConfig)
56+ pkgRemoveHelper(pkg, true);
57 break;
58 case PKG_DELETE_WITH_DEPS:
59- pkgRemoveHelper(pkg, true, true);
60+ if(flags & RPackage::FInstalled || flags & RPackage::FResidualConfig)
61+ pkgRemoveHelper(pkg, true, true);
62 break;
63 default:
64 cout << "uh oh!!!!!!!!!" << endl;

Subscribers

People subscribed via source and target branches

to status/vote changes: