Merge lp:~mvo/update-manager/not-automatic2 into lp:update-manager

Proposed by Michael Vogt
Status: Work in progress
Proposed branch: lp:~mvo/update-manager/not-automatic2
Merge into: lp:update-manager
Diff against target: 172 lines (+80/-8)
5 files modified
UpdateManager/Core/MyCache.py (+50/-1)
UpdateManager/Core/UpdateList.py (+5/-5)
UpdateManager/UpdateManager.py (+3/-1)
UpdateManagerText/UpdateManagerText.py (+1/-1)
debian/changelog (+21/-0)
To merge this branch: bzr merge lp:~mvo/update-manager/not-automatic2
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+67136@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

1263. By Michael Vogt

UpdateManager/Core/MyCache.py: fix pkg._depcache -> self._depcache

1262. By Michael Vogt

merged with trunk

1261. By Michael Vogt

handle getting not-automatic: yes changelogs

1260. By Michael Vogt

make backports lower priority than distro updates, ensure that the autoamtic dependency is higher version than the regular one

1259. By Michael Vogt

refactoring, cleaner code that works UI agnostic

1258. By Michael Vogt

merge from the mainline

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateManager/Core/MyCache.py'
2--- UpdateManager/Core/MyCache.py 2011-05-19 23:20:43 +0000
3+++ UpdateManager/Core/MyCache.py 2011-07-07 09:11:29 +0000
4@@ -105,6 +105,52 @@
5 assert self._depcache.broken_count == 0 and self._depcache.del_count == 0
6 self._depcache.upgrade()
7 return wouldDelete
8+ def _has_ver_with_not_automatic_origin(self, pkg):
9+ """
10+ internal helper that checks if one pkg version has the
11+ NotAutomatic flag
12+ """
13+ for ver in pkg._pkg.version_list:
14+ for (verFileIter, index) in ver.file_list:
15+ if verFileIter.not_automatic:
16+ return True
17+ return False
18+ def not_automatic_upgradable(self, pkg):
19+ """
20+ check if 'pkg' is upgradable but has the 'NotAutomatic' flag
21+ """
22+ if ( pkg.is_installed and
23+ not pkg.is_upgradable and
24+ pkg.candidate and
25+ self._has_ver_with_not_automatic_origin(pkg) ):
26+ # now check if there is a higher NotAutomatic version
27+ candVer = self._depcache.get_candidate_ver(pkg._pkg)
28+ for ver in pkg._pkg.version_list:
29+ if apt_pkg.version_compare(ver.ver_str, candVer.ver_str) > 0:
30+ return True
31+ return False
32+ def mark_upgrade_install(self, pkg):
33+ """
34+ mark package for upgrade/install. we have a special version
35+ here because update-manager deals with NotAutomatic by
36+ explictely selecting it if there is no candidate already
37+ """
38+ # handle NotAutomatic: yes packages special
39+ if self.not_automatic_upgradable(pkg):
40+ for ver in pkg._pkg.version_list:
41+ print "looking at: ", ver
42+ for (verFileIter, index) in ver.file_list:
43+ if verFileIter.not_automatic:
44+ print "setting candidate ver: ", ver
45+ self._depcache.set_candidate_ver(pkg._pkg, ver)
46+ print "new cand: ", self._depcache.get_candidate_ver(pkg._pkg)
47+ self._depcache.mark_install(pkg._pkg)
48+ print "new cand: ", self._depcache.get_candidate_ver(pkg._pkg)
49+ break
50+ pkg.mark_install()
51+ print pkg.marked_install
52+ print pkg.marked_upgrade
53+
54 def matchPackageOrigin(self, pkg, matcher):
55 """ match 'pkg' origin against 'matcher', take versions between
56 installedVersion and candidateVersion into account too
57@@ -175,7 +221,10 @@
58
59 # get the source version, start with the binaries version
60 binver = pkg.candidateVersion
61- srcver_epoch = pkg.candidateVersion
62+ # handle not-automatic special
63+ if self.notAutomaticUpgradable(pkg):
64+ binver = pkg._pkg.VersionList[0].VerStr
65+ srcver_epoch = binver
66 srcver = self._strip_epoch(srcver_epoch)
67 #print "bin: %s" % binver
68
69
70=== modified file 'UpdateManager/Core/UpdateList.py'
71--- UpdateManager/Core/UpdateList.py 2010-07-09 07:42:22 +0000
72+++ UpdateManager/Core/UpdateList.py 2011-07-07 09:11:29 +0000
73@@ -64,8 +64,8 @@
74 ("%s-security" % dist, "Ubuntu", _("Important security updates"),10),
75 ("%s-updates" % dist, "Ubuntu", _("Recommended updates"), 9),
76 ("%s-proposed" % dist, "Ubuntu", _("Proposed updates"), 8),
77- ("%s-backports" % dist, "Ubuntu", _("Backports"), 7),
78- (dist, "Ubuntu", _("Distribution updates"), 6)
79+ (dist, "Ubuntu", _("Distribution updates"), 7),
80+ ("%s-backports" % dist, "Ubuntu", _("Backports"), 6),
81 ]
82 matcher = {}
83 for (origin, archive, desc, importance) in matcher_templates:
84@@ -79,11 +79,11 @@
85 # do the upgrade
86 self.distUpgradeWouldDelete = cache.saveDistUpgrade()
87
88- dselect_upgrade_origin = UpdateOrigin(_("Previous selected"), 1)
89-
90 # sort by origin
91 for pkg in cache:
92- if pkg.is_upgradable or pkg.marked_install:
93+ if (pkg.is_upgradable or
94+ pkg.marked_install or
95+ cache.not_automatic_upgradable(pkg)):
96 if pkg.candidateOrigin == None:
97 # can happen for e.g. locked packages
98 # FIXME: do something more sensible here (but what?)
99
100=== modified file 'UpdateManager/UpdateManager.py'
101--- UpdateManager/UpdateManager.py 2011-06-23 00:10:55 +0000
102+++ UpdateManager/UpdateManager.py 2011-07-07 09:11:29 +0000
103@@ -885,6 +885,7 @@
104
105 pkg = self.store.get_value(iter, LIST_PKG)
106 origin = self.store.get_value(iter, LIST_ORIGIN)
107+
108 if pkg is not None:
109 return
110 self.toggle_from_origin(pkg, origin, True)
111@@ -909,6 +910,7 @@
112
113 def toggled(self, renderer, path):
114 """ a toggle button in the listview was toggled """
115+ print "toggled"
116 iter = self.store.get_iter(path)
117 pkg = self.store.get_value(iter, LIST_PKG)
118 origin = self.store.get_value(iter, LIST_ORIGIN)
119@@ -931,7 +933,7 @@
120 Fix = apt_pkg.ProblemResolver(self.cache._depcache)
121 Fix.resolve_by_keep()
122 else:
123- pkg.mark_install()
124+ self.cache.mark_upgrade_install(pkg)
125 self.treeview_update.queue_draw()
126 self.refresh_updates_count()
127 self.setBusy(False)
128
129=== modified file 'UpdateManagerText/UpdateManagerText.py'
130--- UpdateManagerText/UpdateManagerText.py 2011-03-30 08:31:21 +0000
131+++ UpdateManagerText/UpdateManagerText.py 2011-07-07 09:11:29 +0000
132@@ -151,7 +151,7 @@
133 if not (name in self.list.held_back):
134 # FIXME: properly deal with "fromUser" here
135 need_refresh = True
136- pkg.markInstall()
137+ self.cache.markUpgradeInstall(pkg)
138 # fixup any problems
139 if self.cache._depcache.BrokenCount:
140 need_refresh = True
141
142=== modified file 'debian/changelog'
143--- debian/changelog 2011-07-07 09:05:34 +0000
144+++ debian/changelog 2011-07-07 09:11:29 +0000
145@@ -2307,6 +2307,27 @@
146
147 -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 18 Feb 2009 23:44:17 +0100
148
149+update-manager (1:0.97.2) UNRELEASED; urgency=low
150+
151+ [ Michael Vogt ]
152+ * DistUpgrade/DistUpgradeController.py:
153+ - fixes in the error string (thanks to Jean-Baptiste
154+ Lallement, LP: #298296)
155+ * support getting NEWS.Debian information in addition
156+ to the changelog
157+ * debian/update-manager-core.links:
158+ - fix typo (thanks to tjaalton)
159+ * merge the "not-automatic" branch to support components
160+ that have the "NotAutomatic: yes" flag in their release
161+ file
162+
163+ [ Brian Murray ]
164+ * DistUpgrade - Release Announcements:
165+ - Modified reporting bugs sections to recommend using ubuntu-bug instead
166+ of filing bugs directly in Launchpad. (LP: #327800)
167+
168+ -- Brian Murray <brian@ubuntu.com> Wed, 11 Feb 2009 08:29:48 -0800
169+
170 update-manager (1:0.97.1) jaunty; urgency=low
171
172 [ Michael Vogt ]

Subscribers

People subscribed via source and target branches

to status/vote changes: