Merge ~nteodosio/update-manager:jammy-ua into update-manager:ubuntu/jammy

Proposed by Nathan Teodosio
Status: Merged
Merged at revision: b57402403bac6714e8c0d341b7fb8b81ba3b9145
Proposed branch: ~nteodosio/update-manager:jammy-ua
Merge into: update-manager:ubuntu/jammy
Diff against target: 65 lines (+20/-2)
3 files modified
UpdateManager/Core/MyCache.py (+11/-2)
UpdateManager/UpdateManager.py (+1/-0)
debian/changelog (+8/-0)
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+455891@code.launchpad.net

Description of the change

Fix incorrect available version for Ubuntu Pro updates in unattached case.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

in fact there was an extra line in the changelog with a timestamp, I fixed that and force pushed now

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/UpdateManager/Core/MyCache.py b/UpdateManager/Core/MyCache.py
index e86c9b3..7639429 100644
--- a/UpdateManager/Core/MyCache.py
+++ b/UpdateManager/Core/MyCache.py
@@ -81,6 +81,7 @@ class MyCache(DistUpgrade.DistUpgradeCache.MyCache):
81 self._initDepCache()81 self._initDepCache()
82 self.all_changes = {}82 self.all_changes = {}
83 self.all_news = {}83 self.all_news = {}
84 self.pro_versions = {}
84 # on broken packages, try to fix via saveDistUpgrade()85 # on broken packages, try to fix via saveDistUpgrade()
85 if self._depcache.broken_count > 0:86 if self._depcache.broken_count > 0:
86 self.saveDistUpgrade()87 self.saveDistUpgrade()
@@ -424,14 +425,22 @@ class MyCache(DistUpgrade.DistUpgradeCache.MyCache):
424 "Please check your Internet connection.")425 "Please check your Internet connection.")
425 self.all_changes[name] += error_message426 self.all_changes[name] += error_message
426427
428 # If the machine is not attached to Ubuntu Pro, Update Manager advertises
429 # the upgrades that would be available if it were attached.
430 # As that is unbeknownst to Apt, we need this map to show the correct
431 # version of each upgradable-if-pro-subscribed package.
432 def create_pro_cache(self, pro_pkgs):
433 for (name, version, _, _) in pro_pkgs:
434 self.pro_versions[name] = version
435
427 def get_changelog(self, name):436 def get_changelog(self, name):
428 " get the changelog file from the changelog location "437 " get the changelog file from the changelog location "
429 origins = self[name].candidate.origins438 origins = self[name].candidate.origins
439 version = self.pro_versions.get(name, self[name].candidate.version)
430 self.all_changes[name] = _("Changes for %s versions:\n"440 self.all_changes[name] = _("Changes for %s versions:\n"
431 "Installed version: %s\n"441 "Installed version: %s\n"
432 "Available version: %s\n\n") % \442 "Available version: %s\n\n") % \
433 (name, getattr(self[name].installed, "version", None),443 (name, getattr(self[name].installed, "version", None), version)
434 self[name].candidate.version)
435 if self.CHANGELOG_ORIGIN not in [o.origin for o in origins]:444 if self.CHANGELOG_ORIGIN not in [o.origin for o in origins]:
436 self._fetch_changelog_for_third_party_package(name, origins)445 self._fetch_changelog_for_third_party_package(name, origins)
437 return446 return
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 2b0af65..aecabcf 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -299,6 +299,7 @@ class UpdateManager(Gtk.Window):
299 self.ua_security_packages.append(299 self.ua_security_packages.append(
300 (name, version, size, downloadable)300 (name, version, size, downloadable)
301 )301 )
302 self.cache.create_pro_cache(self.ua_security_packages)
302303
303 def _make_available_pane(self, install_count, need_reboot=False,304 def _make_available_pane(self, install_count, need_reboot=False,
304 cancelled_update=False, error_occurred=False):305 cancelled_update=False, error_occurred=False):
diff --git a/debian/changelog b/debian/changelog
index dc1c9e8..ae45c95 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1update-manager (1:22.04.17) jammy; urgency=medium
2
3 * Fix incorrect available version for Ubuntu Pro updates in unattached case
4 (LP: #2043425).
5
6 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Thu, 16 Nov 2023 10:07:06 +0100
7 +0100
8
1update-manager (1:22.04.16) jammy; urgency=medium9update-manager (1:22.04.16) jammy; urgency=medium
210
3 * Ubuntu Pro (LP: #1990450):11 * Ubuntu Pro (LP: #1990450):

Subscribers

People subscribed via source and target branches