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
=== modified file 'UpdateManager/Core/MyCache.py'
--- UpdateManager/Core/MyCache.py 2011-05-19 23:20:43 +0000
+++ UpdateManager/Core/MyCache.py 2011-07-07 09:11:29 +0000
@@ -105,6 +105,52 @@
105 assert self._depcache.broken_count == 0 and self._depcache.del_count == 0105 assert self._depcache.broken_count == 0 and self._depcache.del_count == 0
106 self._depcache.upgrade()106 self._depcache.upgrade()
107 return wouldDelete107 return wouldDelete
108 def _has_ver_with_not_automatic_origin(self, pkg):
109 """
110 internal helper that checks if one pkg version has the
111 NotAutomatic flag
112 """
113 for ver in pkg._pkg.version_list:
114 for (verFileIter, index) in ver.file_list:
115 if verFileIter.not_automatic:
116 return True
117 return False
118 def not_automatic_upgradable(self, pkg):
119 """
120 check if 'pkg' is upgradable but has the 'NotAutomatic' flag
121 """
122 if ( pkg.is_installed and
123 not pkg.is_upgradable and
124 pkg.candidate and
125 self._has_ver_with_not_automatic_origin(pkg) ):
126 # now check if there is a higher NotAutomatic version
127 candVer = self._depcache.get_candidate_ver(pkg._pkg)
128 for ver in pkg._pkg.version_list:
129 if apt_pkg.version_compare(ver.ver_str, candVer.ver_str) > 0:
130 return True
131 return False
132 def mark_upgrade_install(self, pkg):
133 """
134 mark package for upgrade/install. we have a special version
135 here because update-manager deals with NotAutomatic by
136 explictely selecting it if there is no candidate already
137 """
138 # handle NotAutomatic: yes packages special
139 if self.not_automatic_upgradable(pkg):
140 for ver in pkg._pkg.version_list:
141 print "looking at: ", ver
142 for (verFileIter, index) in ver.file_list:
143 if verFileIter.not_automatic:
144 print "setting candidate ver: ", ver
145 self._depcache.set_candidate_ver(pkg._pkg, ver)
146 print "new cand: ", self._depcache.get_candidate_ver(pkg._pkg)
147 self._depcache.mark_install(pkg._pkg)
148 print "new cand: ", self._depcache.get_candidate_ver(pkg._pkg)
149 break
150 pkg.mark_install()
151 print pkg.marked_install
152 print pkg.marked_upgrade
153
108 def matchPackageOrigin(self, pkg, matcher):154 def matchPackageOrigin(self, pkg, matcher):
109 """ match 'pkg' origin against 'matcher', take versions between155 """ match 'pkg' origin against 'matcher', take versions between
110 installedVersion and candidateVersion into account too156 installedVersion and candidateVersion into account too
@@ -175,7 +221,10 @@
175221
176 # get the source version, start with the binaries version222 # get the source version, start with the binaries version
177 binver = pkg.candidateVersion223 binver = pkg.candidateVersion
178 srcver_epoch = pkg.candidateVersion224 # handle not-automatic special
225 if self.notAutomaticUpgradable(pkg):
226 binver = pkg._pkg.VersionList[0].VerStr
227 srcver_epoch = binver
179 srcver = self._strip_epoch(srcver_epoch)228 srcver = self._strip_epoch(srcver_epoch)
180 #print "bin: %s" % binver229 #print "bin: %s" % binver
181230
182231
=== modified file 'UpdateManager/Core/UpdateList.py'
--- UpdateManager/Core/UpdateList.py 2010-07-09 07:42:22 +0000
+++ UpdateManager/Core/UpdateList.py 2011-07-07 09:11:29 +0000
@@ -64,8 +64,8 @@
64 ("%s-security" % dist, "Ubuntu", _("Important security updates"),10),64 ("%s-security" % dist, "Ubuntu", _("Important security updates"),10),
65 ("%s-updates" % dist, "Ubuntu", _("Recommended updates"), 9),65 ("%s-updates" % dist, "Ubuntu", _("Recommended updates"), 9),
66 ("%s-proposed" % dist, "Ubuntu", _("Proposed updates"), 8),66 ("%s-proposed" % dist, "Ubuntu", _("Proposed updates"), 8),
67 ("%s-backports" % dist, "Ubuntu", _("Backports"), 7),67 (dist, "Ubuntu", _("Distribution updates"), 7),
68 (dist, "Ubuntu", _("Distribution updates"), 6)68 ("%s-backports" % dist, "Ubuntu", _("Backports"), 6),
69 ]69 ]
70 matcher = {}70 matcher = {}
71 for (origin, archive, desc, importance) in matcher_templates:71 for (origin, archive, desc, importance) in matcher_templates:
@@ -79,11 +79,11 @@
79 # do the upgrade79 # do the upgrade
80 self.distUpgradeWouldDelete = cache.saveDistUpgrade()80 self.distUpgradeWouldDelete = cache.saveDistUpgrade()
8181
82 dselect_upgrade_origin = UpdateOrigin(_("Previous selected"), 1)
83
84 # sort by origin82 # sort by origin
85 for pkg in cache:83 for pkg in cache:
86 if pkg.is_upgradable or pkg.marked_install:84 if (pkg.is_upgradable or
85 pkg.marked_install or
86 cache.not_automatic_upgradable(pkg)):
87 if pkg.candidateOrigin == None:87 if pkg.candidateOrigin == None:
88 # can happen for e.g. locked packages88 # can happen for e.g. locked packages
89 # FIXME: do something more sensible here (but what?)89 # FIXME: do something more sensible here (but what?)
9090
=== modified file 'UpdateManager/UpdateManager.py'
--- UpdateManager/UpdateManager.py 2011-06-23 00:10:55 +0000
+++ UpdateManager/UpdateManager.py 2011-07-07 09:11:29 +0000
@@ -885,6 +885,7 @@
885 885
886 pkg = self.store.get_value(iter, LIST_PKG)886 pkg = self.store.get_value(iter, LIST_PKG)
887 origin = self.store.get_value(iter, LIST_ORIGIN)887 origin = self.store.get_value(iter, LIST_ORIGIN)
888
888 if pkg is not None:889 if pkg is not None:
889 return890 return
890 self.toggle_from_origin(pkg, origin, True)891 self.toggle_from_origin(pkg, origin, True)
@@ -909,6 +910,7 @@
909 910
910 def toggled(self, renderer, path):911 def toggled(self, renderer, path):
911 """ a toggle button in the listview was toggled """912 """ a toggle button in the listview was toggled """
913 print "toggled"
912 iter = self.store.get_iter(path)914 iter = self.store.get_iter(path)
913 pkg = self.store.get_value(iter, LIST_PKG)915 pkg = self.store.get_value(iter, LIST_PKG)
914 origin = self.store.get_value(iter, LIST_ORIGIN)916 origin = self.store.get_value(iter, LIST_ORIGIN)
@@ -931,7 +933,7 @@
931 Fix = apt_pkg.ProblemResolver(self.cache._depcache)933 Fix = apt_pkg.ProblemResolver(self.cache._depcache)
932 Fix.resolve_by_keep()934 Fix.resolve_by_keep()
933 else:935 else:
934 pkg.mark_install()936 self.cache.mark_upgrade_install(pkg)
935 self.treeview_update.queue_draw()937 self.treeview_update.queue_draw()
936 self.refresh_updates_count()938 self.refresh_updates_count()
937 self.setBusy(False)939 self.setBusy(False)
938940
=== modified file 'UpdateManagerText/UpdateManagerText.py'
--- UpdateManagerText/UpdateManagerText.py 2011-03-30 08:31:21 +0000
+++ UpdateManagerText/UpdateManagerText.py 2011-07-07 09:11:29 +0000
@@ -151,7 +151,7 @@
151 if not (name in self.list.held_back):151 if not (name in self.list.held_back):
152 # FIXME: properly deal with "fromUser" here152 # FIXME: properly deal with "fromUser" here
153 need_refresh = True153 need_refresh = True
154 pkg.markInstall()154 self.cache.markUpgradeInstall(pkg)
155 # fixup any problems155 # fixup any problems
156 if self.cache._depcache.BrokenCount:156 if self.cache._depcache.BrokenCount:
157 need_refresh = True157 need_refresh = True
158158
=== modified file 'debian/changelog'
--- debian/changelog 2011-07-07 09:05:34 +0000
+++ debian/changelog 2011-07-07 09:11:29 +0000
@@ -2307,6 +2307,27 @@
23072307
2308 -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 18 Feb 2009 23:44:17 +01002308 -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 18 Feb 2009 23:44:17 +0100
23092309
2310update-manager (1:0.97.2) UNRELEASED; urgency=low
2311
2312 [ Michael Vogt ]
2313 * DistUpgrade/DistUpgradeController.py:
2314 - fixes in the error string (thanks to Jean-Baptiste
2315 Lallement, LP: #298296)
2316 * support getting NEWS.Debian information in addition
2317 to the changelog
2318 * debian/update-manager-core.links:
2319 - fix typo (thanks to tjaalton)
2320 * merge the "not-automatic" branch to support components
2321 that have the "NotAutomatic: yes" flag in their release
2322 file
2323
2324 [ Brian Murray ]
2325 * DistUpgrade - Release Announcements:
2326 - Modified reporting bugs sections to recommend using ubuntu-bug instead
2327 of filing bugs directly in Launchpad. (LP: #327800)
2328
2329 -- Brian Murray <brian@ubuntu.com> Wed, 11 Feb 2009 08:29:48 -0800
2330
2310update-manager (1:0.97.1) jaunty; urgency=low2331update-manager (1:0.97.1) jaunty; urgency=low
23112332
2312 [ Michael Vogt ]2333 [ Michael Vogt ]

Subscribers

People subscribed via source and target branches

to status/vote changes: