Merge ~nteodosio/update-manager:dont-nag-pro-focal into update-manager:main

Proposed by Nathan Teodosio
Status: Superseded
Proposed branch: ~nteodosio/update-manager:dont-nag-pro-focal
Merge into: update-manager:main
Diff against target: 1725 lines (+824/-0) (has conflicts)
15 files modified
UpdateManager/Core/MyCache.py (+7/-0)
UpdateManager/Core/UpdateList.py (+114/-0)
UpdateManager/Dialogs.py (+9/-0)
UpdateManager/UpdateManager.py (+94/-0)
UpdateManager/UpdatesAvailable.py (+81/-0)
UpdateManager/backend/InstallBackendAptdaemon.py (+175/-0)
UpdateManager/backend/__init__.py (+30/-0)
data/gtkbuilder/UpdateManager.ui (+4/-0)
debian/changelog (+155/-0)
debian/control (+30/-0)
debian/tests/control (+4/-0)
tests/test_cache.py (+5/-0)
tests/test_changelog.py (+12/-0)
tests/test_meta_release_core.py (+18/-0)
tests/test_update_list.py (+86/-0)
Conflict in UpdateManager/Core/MyCache.py
Conflict in UpdateManager/Core/UpdateList.py
Conflict in UpdateManager/Dialogs.py
Conflict in UpdateManager/UpdateManager.py
Conflict in UpdateManager/UpdatesAvailable.py
Conflict in UpdateManager/backend/InstallBackendAptdaemon.py
Conflict in UpdateManager/backend/__init__.py
Conflict in data/gtkbuilder/UpdateManager.ui
Conflict in debian/changelog
Conflict in debian/control
Conflict in debian/tests/control
Conflict in tests/test_cache.py
Conflict in tests/test_changelog.py
Conflict in tests/test_meta_release_core.py
Conflict in tests/test_update_list.py
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+459436@code.launchpad.net

This proposal has been superseded by a proposal from 2024-01-25.

Description of the change

Do not show the list of packages if the machine is not attached to Ubuntu Pro and only those coming from Ubuntu Pro are available.

To post a comment you must log in.

Unmerged commits

e954fc2... by Nathan Teodosio

Update change log for version 1:20.04.10.20.

2ffb4b0... by Nathan Teodosio

Do not offer Ubuntu Pro if they are the only updates available.

928b535... by Nathan Teodosio

Update changelog.

eac8e4b... by Nathan Teodosio

Removed widgets added back to *.ui file.

Even though unused, updating Update Manager in place would otherwise cause
a crash.

LP:2045918

dfd9a81... by Sebastien Bacher

releasing package update-manager version 1:20.04.10.18

9020957... by Nathan Teodosio

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

LP:2043425

cacc1f3... by Sebastien Bacher

releasing package update-manager version 1:20.04.10.17

3b7747b... by Sebastien Bacher

* Ubuntu Pro (LP: #1990450):
  - fix another linter error which was created while fixing a missing
    space in the previous upload...

5a1ded2... by Sebastien Bacher

releasing package update-manager version 1:20.04.10.16

5926e16... by Nathan Teodosio

Prepare changelog for 1:20.04.10.16.

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 80557c6..4bd0486 100644
--- a/UpdateManager/Core/MyCache.py
+++ b/UpdateManager/Core/MyCache.py
@@ -481,6 +481,7 @@ class MyCache(DistUpgrade.DistUpgradeCache.MyCache):
481 "get the changelog file from the changelog location"481 "get the changelog file from the changelog location"
482 origins = self[name].candidate.origins482 origins = self[name].candidate.origins
483 version = self.pro_versions.get(name, self[name].candidate.version)483 version = self.pro_versions.get(name, self[name].candidate.version)
484<<<<<<< UpdateManager/Core/MyCache.py
484 self.all_changes[name] = _(485 self.all_changes[name] = _(
485 "Changes for %s versions:\n"486 "Changes for %s versions:\n"
486 "Installed version: %s\n"487 "Installed version: %s\n"
@@ -490,6 +491,12 @@ class MyCache(DistUpgrade.DistUpgradeCache.MyCache):
490 getattr(self[name].installed, "version", None),491 getattr(self[name].installed, "version", None),
491 version,492 version,
492 )493 )
494=======
495 self.all_changes[name] = _("Changes for %s versions:\n"
496 "Installed version: %s\n"
497 "Available version: %s\n\n") % \
498 (name, getattr(self[name].installed, "version", None), version)
499>>>>>>> UpdateManager/Core/MyCache.py
493 if self.CHANGELOG_ORIGIN not in [o.origin for o in origins]:500 if self.CHANGELOG_ORIGIN not in [o.origin for o in origins]:
494 self._fetch_changelog_for_third_party_package(name, origins)501 self._fetch_changelog_for_third_party_package(name, origins)
495 return502 return
diff --git a/UpdateManager/Core/UpdateList.py b/UpdateManager/Core/UpdateList.py
index 265ab90..4e904ed 100644
--- a/UpdateManager/Core/UpdateList.py
+++ b/UpdateManager/Core/UpdateList.py
@@ -43,7 +43,11 @@ from gi.repository import Gio
43from UpdateManager.Core import utils43from UpdateManager.Core import utils
4444
4545
46<<<<<<< UpdateManager/Core/UpdateList.py
46class UpdateItem:47class UpdateItem:
48=======
49class UpdateItem():
50>>>>>>> UpdateManager/Core/UpdateList.py
47 def __init__(self, pkg, name, icon, to_remove, sensitive=True):51 def __init__(self, pkg, name, icon, to_remove, sensitive=True):
48 self.icon = icon52 self.icon = icon
49 self.name = name53 self.name = name
@@ -76,6 +80,7 @@ class UpdateGroup(UpdateItem):
76 all_items.extend(self._items)80 all_items.extend(self._items)
77 return sorted(all_items, key=lambda a: a.name.lower())81 return sorted(all_items, key=lambda a: a.name.lower())
7882
83<<<<<<< UpdateManager/Core/UpdateList.py
79 def add(84 def add(
80 self,85 self,
81 pkg,86 pkg,
@@ -84,6 +89,10 @@ class UpdateGroup(UpdateItem):
84 to_remove=False,89 to_remove=False,
85 sensitive=True,90 sensitive=True,
86 ):91 ):
92=======
93 def add(self, pkg, cache=None, eventloop_callback=None, to_remove=False,
94 sensitive=True):
95>>>>>>> UpdateManager/Core/UpdateList.py
87 name = utils.get_package_label(pkg)96 name = utils.get_package_label(pkg)
88 icon = Gio.ThemedIcon.new("package")97 icon = Gio.ThemedIcon.new("package")
89 self._items.add(UpdateItem(pkg, name, icon, to_remove, sensitive))98 self._items.add(UpdateItem(pkg, name, icon, to_remove, sensitive))
@@ -168,18 +177,28 @@ class UpdateApplicationGroup(UpdateGroup):
168 def __init__(self, pkg, application, to_remove, sensitive=True):177 def __init__(self, pkg, application, to_remove, sensitive=True):
169 name = application.get_display_name()178 name = application.get_display_name()
170 icon = application.get_icon()179 icon = application.get_icon()
180<<<<<<< UpdateManager/Core/UpdateList.py
171 super(UpdateApplicationGroup, self).__init__(181 super(UpdateApplicationGroup, self).__init__(
172 pkg, name, icon, to_remove, sensitive182 pkg, name, icon, to_remove, sensitive
173 )183 )
184=======
185 super(UpdateApplicationGroup, self).__init__(pkg, name, icon,
186 to_remove, sensitive)
187>>>>>>> UpdateManager/Core/UpdateList.py
174188
175189
176class UpdatePackageGroup(UpdateGroup):190class UpdatePackageGroup(UpdateGroup):
177 def __init__(self, pkg, to_remove, sensitive=True):191 def __init__(self, pkg, to_remove, sensitive=True):
178 name = utils.get_package_label(pkg)192 name = utils.get_package_label(pkg)
179 icon = Gio.ThemedIcon.new("package")193 icon = Gio.ThemedIcon.new("package")
194<<<<<<< UpdateManager/Core/UpdateList.py
180 super(UpdatePackageGroup, self).__init__(195 super(UpdatePackageGroup, self).__init__(
181 pkg, name, icon, to_remove, sensitive196 pkg, name, icon, to_remove, sensitive
182 )197 )
198=======
199 super(UpdatePackageGroup, self).__init__(pkg, name, icon, to_remove,
200 sensitive)
201>>>>>>> UpdateManager/Core/UpdateList.py
183202
184203
185class UpdateSystemGroup(UpdateGroup):204class UpdateSystemGroup(UpdateGroup):
@@ -188,9 +207,14 @@ class UpdateSystemGroup(UpdateGroup):
188 # the core components and packages.207 # the core components and packages.
189 name = _("%s base") % utils.get_ubuntu_flavor_name(cache=cache)208 name = _("%s base") % utils.get_ubuntu_flavor_name(cache=cache)
190 icon = Gio.ThemedIcon.new("distributor-logo")209 icon = Gio.ThemedIcon.new("distributor-logo")
210<<<<<<< UpdateManager/Core/UpdateList.py
191 super(UpdateSystemGroup, self).__init__(211 super(UpdateSystemGroup, self).__init__(
192 None, name, icon, to_remove, sensitive212 None, name, icon, to_remove, sensitive
193 )213 )
214=======
215 super(UpdateSystemGroup, self).__init__(None, name, icon, to_remove,
216 sensitive)
217>>>>>>> UpdateManager/Core/UpdateList.py
194218
195219
196class UpdateOrigin:220class UpdateOrigin:
@@ -435,9 +459,14 @@ class UpdateList:
435 for pkg in pkgs:459 for pkg in pkgs:
436 app = self._get_application_for_package(pkg)460 app = self._get_application_for_package(pkg)
437 if app is not None:461 if app is not None:
462<<<<<<< UpdateManager/Core/UpdateList.py
438 app_group = UpdateApplicationGroup(463 app_group = UpdateApplicationGroup(
439 pkg, app, to_remove, sensitive464 pkg, app, to_remove, sensitive
440 )465 )
466=======
467 app_group = UpdateApplicationGroup(pkg, app, to_remove,
468 sensitive)
469>>>>>>> UpdateManager/Core/UpdateList.py
441 app_groups.append(app_group)470 app_groups.append(app_group)
442 else:471 else:
443 ungrouped_pkgs.append(pkg)472 ungrouped_pkgs.append(pkg)
@@ -458,6 +487,7 @@ class UpdateList:
458 if ungrouped_pkgs:487 if ungrouped_pkgs:
459 # Separate out system base packages. If we have already found an488 # Separate out system base packages. If we have already found an
460 # application for all updates, don't bother.489 # application for all updates, don't bother.
490<<<<<<< UpdateManager/Core/UpdateList.py
461 linux_names = (491 linux_names = (
462 "linux$",492 "linux$",
463 "linux-.*-buildinfo.*",493 "linux-.*-buildinfo.*",
@@ -488,6 +518,32 @@ class UpdateList:
488 "ubuntu-standard",518 "ubuntu-standard",
489 "ubuntu-minimal",519 "ubuntu-minimal",
490 ]520 ]
521=======
522 linux_names = ("linux$",
523 "linux-.*-buildinfo.*",
524 "linux-.*-dev.*",
525 "linux-.*-generic.*",
526 "linux-.*-headers.*",
527 "linux-.*-hwe.*",
528 "linux-.*-gcp.*",
529 "linux-.*-kernel.*",
530 "linux-.*-lowlatency.*",
531 "linux-.*-modules.*",
532 "linux-.*-raspi.*",
533 "linux-.*-tools.*",
534 "linux-.*-virtual.*",
535 "linux-base.*",
536 "linux-crashdump.*",
537 "linux-doc.*")
538 linux_regexp = re.compile("(" + "|".join(
539 ["^" + n for n in linux_names]) + ")")
540 ubuntu_base_group = UpdateGroup(None, None, None, to_remove,
541 sensitive)
542 flavor_package = utils.get_ubuntu_flavor_package(cache=cache)
543 ubuntu_base_pkgs = [flavor_package,
544 "ubuntu-standard",
545 "ubuntu-minimal"]
546>>>>>>> UpdateManager/Core/UpdateList.py
491 for pkg in cache:547 for pkg in cache:
492 if linux_regexp.match(pkg.name):548 if linux_regexp.match(pkg.name):
493 ubuntu_base_pkgs.append(pkg.name)549 ubuntu_base_pkgs.append(pkg.name)
@@ -498,6 +554,7 @@ class UpdateList:
498 # which fixes LP: #1912718554 # which fixes LP: #1912718
499 ubuntu_base_group.add(cache[pkg])555 ubuntu_base_group.add(cache[pkg])
500 for pkg in ungrouped_pkgs:556 for pkg in ungrouped_pkgs:
557<<<<<<< UpdateManager/Core/UpdateList.py
501 if ubuntu_base_group.is_dependency(558 if ubuntu_base_group.is_dependency(
502 pkg, cache, eventloop_callback559 pkg, cache, eventloop_callback
503 ):560 ):
@@ -509,6 +566,17 @@ class UpdateList:
509 else:566 else:
510 pkg_groups.append(567 pkg_groups.append(
511 UpdatePackageGroup(pkg, to_remove, sensitive)568 UpdatePackageGroup(pkg, to_remove, sensitive)
569=======
570 if ubuntu_base_group.is_dependency(pkg, cache,
571 eventloop_callback):
572 if system_group is None:
573 system_group = UpdateSystemGroup(cache, to_remove,
574 sensitive)
575 system_group.add(pkg)
576 else:
577 pkg_groups.append(UpdatePackageGroup(
578 pkg, to_remove, sensitive)
579>>>>>>> UpdateManager/Core/UpdateList.py
512 )580 )
513581
514 app_groups.sort(key=lambda a: a.name.lower())582 app_groups.sort(key=lambda a: a.name.lower())
@@ -518,6 +586,7 @@ class UpdateList:
518586
519 return app_groups + pkg_groups587 return app_groups + pkg_groups
520588
589<<<<<<< UpdateManager/Core/UpdateList.py
521 def update(590 def update(
522 self,591 self,
523 cache,592 cache,
@@ -525,6 +594,10 @@ class UpdateList:
525 duplicate_packages=[],594 duplicate_packages=[],
526 ua_security_packages=[],595 ua_security_packages=[],
527 ):596 ):
597=======
598 def update(self, cache, eventloop_callback=None, duplicate_packages=[],
599 ua_security_packages=[]):
600>>>>>>> UpdateManager/Core/UpdateList.py
528 self.held_back = []601 self.held_back = []
529602
530 # do the upgrade603 # do the upgrade
@@ -550,9 +623,14 @@ class UpdateList:
550 class FakeUbuntuProPackage:623 class FakeUbuntuProPackage:
551 def __init__(self, package_name, version, size):624 def __init__(self, package_name, version, size):
552 self.name = package_name625 self.name = package_name
626<<<<<<< UpdateManager/Core/UpdateList.py
553 self.candidate = FakeUbuntuProPackageCandidate(627 self.candidate = FakeUbuntuProPackageCandidate(
554 package_name, version, size628 package_name, version, size
555 )629 )
630=======
631 self.candidate = FakeUbuntuProPackageCandidate(package_name,
632 version, size)
633>>>>>>> UpdateManager/Core/UpdateList.py
556 self.marked_install = False634 self.marked_install = False
557 self.marked_upgrade = False635 self.marked_upgrade = False
558 self.marked_delete = False636 self.marked_delete = False
@@ -563,7 +641,10 @@ class UpdateList:
563641
564 def mark_delete(self):642 def mark_delete(self):
565 pass643 pass
644<<<<<<< UpdateManager/Core/UpdateList.py
566645
646=======
647>>>>>>> UpdateManager/Core/UpdateList.py
567 fake_ua_packages = []648 fake_ua_packages = []
568 ua_packages_names = []649 ua_packages_names = []
569 for (650 for (
@@ -575,9 +656,14 @@ class UpdateList:
575 if downloadable:656 if downloadable:
576 ua_packages_names.append(package_name)657 ua_packages_names.append(package_name)
577 else:658 else:
659<<<<<<< UpdateManager/Core/UpdateList.py
578 fake_ua_packages.append(660 fake_ua_packages.append(
579 FakeUbuntuProPackage(package_name, version, size)661 FakeUbuntuProPackage(package_name, version, size)
580 )662 )
663=======
664 fake_ua_packages.append(FakeUbuntuProPackage(package_name,
665 version, size))
666>>>>>>> UpdateManager/Core/UpdateList.py
581667
582 # Find all upgradable packages668 # Find all upgradable packages
583 for pkg in cache:669 for pkg in cache:
@@ -600,7 +686,11 @@ class UpdateList:
600 self.ignored_phased_updates.append(pkg)686 self.ignored_phased_updates.append(pkg)
601 continue687 continue
602688
689<<<<<<< UpdateManager/Core/UpdateList.py
603 if fnmatch.fnmatch(pkg.name, "oem-*-meta"):690 if fnmatch.fnmatch(pkg.name, "oem-*-meta"):
691=======
692 if fnmatch.fnmatch(pkg.name, 'oem-*-meta'):
693>>>>>>> UpdateManager/Core/UpdateList.py
604 oem_pkgs.append(pkg)694 oem_pkgs.append(pkg)
605 comes_from_pro = pkg.name in ua_packages_names695 comes_from_pro = pkg.name in ua_packages_names
606 if comes_from_pro:696 if comes_from_pro:
@@ -636,6 +726,7 @@ class UpdateList:
636726
637 if security_pkgs or upgrade_pkgs or pro_pkgs:727 if security_pkgs or upgrade_pkgs or pro_pkgs:
638 # There's updates available. Initiate the desktop file cache.728 # There's updates available. Initiate the desktop file cache.
729<<<<<<< UpdateManager/Core/UpdateList.py
639 pkg_names = [730 pkg_names = [
640 p.name731 p.name
641 for p in security_pkgs732 for p in security_pkgs
@@ -654,10 +745,26 @@ class UpdateList:
654 self.security_groups = self._make_groups(745 self.security_groups = self._make_groups(
655 cache, security_pkgs, eventloop_callback746 cache, security_pkgs, eventloop_callback
656 )747 )
748=======
749 pkg_names = [p.name for p in
750 pro_pkgs
751 + security_pkgs
752 + upgrade_pkgs
753 + kernel_autoremove_pkgs
754 + duplicate_pkgs]
755 self._populate_desktop_cache(pkg_names)
756 self.oem_groups = self._make_groups(cache, oem_pkgs,
757 eventloop_callback)
758 self.update_groups = self._make_groups(cache, upgrade_pkgs,
759 eventloop_callback)
760 self.security_groups = self._make_groups(cache, security_pkgs,
761 eventloop_callback)
762>>>>>>> UpdateManager/Core/UpdateList.py
657 self.kernel_autoremove_groups = self._make_groups(763 self.kernel_autoremove_groups = self._make_groups(
658 cache, kernel_autoremove_pkgs, eventloop_callback, True764 cache, kernel_autoremove_pkgs, eventloop_callback, True
659 )765 )
660 self.duplicate_groups = self._make_groups(766 self.duplicate_groups = self._make_groups(
767<<<<<<< UpdateManager/Core/UpdateList.py
661 cache, duplicate_pkgs, eventloop_callback, True768 cache, duplicate_pkgs, eventloop_callback, True
662 )769 )
663 self.ubuntu_pro_fake_groups = self._make_groups(770 self.ubuntu_pro_fake_groups = self._make_groups(
@@ -666,3 +773,10 @@ class UpdateList:
666 self.ubuntu_pro_groups = self._make_groups(773 self.ubuntu_pro_groups = self._make_groups(
667 cache, pro_pkgs, eventloop_callback774 cache, pro_pkgs, eventloop_callback
668 )775 )
776=======
777 cache, duplicate_pkgs, eventloop_callback, True)
778 self.ubuntu_pro_fake_groups = self._make_groups(
779 cache, fake_ua_packages, eventloop_callback, sensitive=False)
780 self.ubuntu_pro_groups = self._make_groups(
781 cache, pro_pkgs, eventloop_callback)
782>>>>>>> UpdateManager/Core/UpdateList.py
diff --git a/UpdateManager/Dialogs.py b/UpdateManager/Dialogs.py
index 304609c..8b1cbd1 100644
--- a/UpdateManager/Dialogs.py
+++ b/UpdateManager/Dialogs.py
@@ -159,6 +159,7 @@ class InternalDialog(BuilderDialog):
159 self.set_desc(None)159 self.set_desc(None)
160160
161 if not active:161 if not active:
162<<<<<<< UpdateManager/Dialogs.py
162 if (163 if (
163 self._is_livepatch_supported()164 self._is_livepatch_supported()
164 and self.settings_button165 and self.settings_button
@@ -171,6 +172,14 @@ class InternalDialog(BuilderDialog):
171 "secure between restarts."172 "secure between restarts."
172 )173 )
173 )174 )
175=======
176 if self._is_livepatch_supported() and \
177 self.settings_button and \
178 self.settings.get_int('launch-count') >= 4:
179 self.set_desc(_("<b>Tip:</b> You can use Livepatch with "
180 "Ubuntu Pro to keep your computer more "
181 "secure between restarts."))
182>>>>>>> UpdateManager/Dialogs.py
174 self.settings_button.set_label(_("Settings & Pro…"))183 self.settings_button.set_label(_("Settings & Pro…"))
175 return184 return
176185
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index efe654e..7a11ebc 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -37,6 +37,10 @@ warnings.filterwarnings(
3737
38import distro_info38import distro_info
39import fnmatch39import fnmatch
40<<<<<<< UpdateManager/UpdateManager.py
41=======
42import json
43>>>>>>> UpdateManager/UpdateManager.py
40import os44import os
41import subprocess45import subprocess
42import sys46import sys
@@ -70,7 +74,12 @@ from .Core.MyCache import MyCache
70from .Core.roam import NetworkManagerHelper74from .Core.roam import NetworkManagerHelper
71from .Core.UpdateList import UpdateList75from .Core.UpdateList import UpdateList
72from .Core.utils import get_arch, get_dist, SoftwarePropertiesPage76from .Core.utils import get_arch, get_dist, SoftwarePropertiesPage
77<<<<<<< UpdateManager/UpdateManager.py
73from .backend import InstallBackend, get_backend78from .backend import InstallBackend, get_backend
79=======
80from .backend import (InstallBackend,
81 get_backend)
82>>>>>>> UpdateManager/UpdateManager.py
7483
75# file that signals if we need to reboot84# file that signals if we need to reboot
76REBOOT_REQUIRED_FILE = "/var/run/reboot-required"85REBOOT_REQUIRED_FILE = "/var/run/reboot-required"
@@ -248,12 +257,19 @@ class UpdateManager(Gtk.Window):
248 if self.cache is None:257 if self.cache is None:
249 return258 return
250259
260<<<<<<< UpdateManager/UpdateManager.py
251 pane = self._make_available_pane(261 pane = self._make_available_pane(
252 self.cache.install_count + self.cache.del_count,262 self.cache.install_count + self.cache.del_count,
253 os.path.exists(REBOOT_REQUIRED_FILE),263 os.path.exists(REBOOT_REQUIRED_FILE),
254 cancelled_update,264 cancelled_update,
255 error_occurred,265 error_occurred,
256 )266 )
267=======
268 pane = self._make_available_pane(self.cache.install_count
269 + self.cache.del_count,
270 os.path.exists(REBOOT_REQUIRED_FILE),
271 cancelled_update, error_occurred)
272>>>>>>> UpdateManager/UpdateManager.py
257 self._start_pane(pane)273 self._start_pane(pane)
258274
259 def _check_oem_metapackages(self):275 def _check_oem_metapackages(self):
@@ -262,18 +278,28 @@ class UpdateManager(Gtk.Window):
262 lts = di.is_lts(codename)278 lts = di.is_lts(codename)
263 if not lts:279 if not lts:
264 return None280 return None
281<<<<<<< UpdateManager/UpdateManager.py
265 OEM_PATH = os.path.join(282 OEM_PATH = os.path.join(
266 GLib.get_user_runtime_dir(), "ubuntu-drivers-oem.package-list"283 GLib.get_user_runtime_dir(), "ubuntu-drivers-oem.package-list"
267 )284 )
285=======
286 OEM_PATH = os.path.join(GLib.get_user_runtime_dir(),
287 "ubuntu-drivers-oem.package-list")
288>>>>>>> UpdateManager/UpdateManager.py
268 if not os.path.exists(OEM_PATH):289 if not os.path.exists(OEM_PATH):
269 return None290 return None
270291
271 # Packages that aren't installed but apply to this system292 # Packages that aren't installed but apply to this system
293<<<<<<< UpdateManager/UpdateManager.py
272 with open(OEM_PATH, "r") as f:294 with open(OEM_PATH, "r") as f:
295=======
296 with open(OEM_PATH, 'r') as f:
297>>>>>>> UpdateManager/UpdateManager.py
273 self.oem_metapackages |= set(f.read().splitlines())298 self.oem_metapackages |= set(f.read().splitlines())
274299
275 # Packages that are already installed300 # Packages that are already installed
276 for pkg in self.cache:301 for pkg in self.cache:
302<<<<<<< UpdateManager/UpdateManager.py
277 if fnmatch.fnmatch(pkg.name, "oem-*-meta") and pkg.installed:303 if fnmatch.fnmatch(pkg.name, "oem-*-meta") and pkg.installed:
278 self.oem_metapackages.add(pkg)304 self.oem_metapackages.add(pkg)
279305
@@ -318,15 +344,61 @@ class UpdateManager(Gtk.Window):
318 ):344 ):
319 self._check_hwe_support_status()345 self._check_hwe_support_status()
320 if install_count != 0 or len(self.ua_security_packages) > 0:346 if install_count != 0 or len(self.ua_security_packages) > 0:
347=======
348 if fnmatch.fnmatch(pkg.name, 'oem-*-meta') \
349 and pkg.installed:
350 self.oem_metapackages.add(pkg)
351
352 def _get_ua_security_status(self):
353 self.ua_security_packages = []
354 try:
355 p = subprocess.Popen(['pro', 'security-status', '--format=json'],
356 stdout=subprocess.PIPE)
357 except OSError:
358 pass
359 else:
360 while p.poll() is None:
361 while Gtk.events_pending():
362 Gtk.main_iteration()
363 time.sleep(0.05)
364 s = json.load(p.stdout)
365 for package in s.get('packages', []):
366 if package.get('service_name', '') == 'standard-security':
367 continue
368 status = package.get('status', '')
369 if (
370 status == 'pending_attach'
371 or status == 'pending_enable'
372 or status == 'upgrade_available'
373 ):
374 name = package.get('package', '')
375 version = package.get('version', '')
376 size = package.get('download_size', 0)
377 downloadable = status == 'upgrade_available'
378 self.ua_security_packages.append(
379 (name, version, size, downloadable)
380 )
381 self.cache.create_pro_cache(self.ua_security_packages)
382
383 def _make_available_pane(self, install_count, need_reboot=False,
384 cancelled_update=False, error_occurred=False):
385 self._check_hwe_support_status()
386 if install_count != 0:
387>>>>>>> UpdateManager/UpdateManager.py
321 header = None388 header = None
322 desc = None389 desc = None
323 if error_occurred:390 if error_occurred:
324 desc = _("Some software couldn’t be checked for updates.")391 desc = _("Some software couldn’t be checked for updates.")
325 elif cancelled_update:392 elif cancelled_update:
326 header = _("You stopped the check for updates.")393 header = _("You stopped the check for updates.")
394<<<<<<< UpdateManager/UpdateManager.py
327 desc = _(395 desc = _(
328 "Updated software is available from a previous check."396 "Updated software is available from a previous check."
329 )397 )
398=======
399 desc = _("Updated software is available from "
400 "a previous check.")
401>>>>>>> UpdateManager/UpdateManager.py
330 # Display HWE updates first as an old HWE stack is vulnerable402 # Display HWE updates first as an old HWE stack is vulnerable
331 elif self.hwe_replacement_packages:403 elif self.hwe_replacement_packages:
332 return HWEUpgradeDialog(self)404 return HWEUpgradeDialog(self)
@@ -450,22 +522,37 @@ class UpdateManager(Gtk.Window):
450 self._start_pane(PartialUpgradeDialog(self))522 self._start_pane(PartialUpgradeDialog(self))
451 # we assert a clean cache523 # we assert a clean cache
452 header = _("Software index is broken")524 header = _("Software index is broken")
525<<<<<<< UpdateManager/UpdateManager.py
453 desc = _(526 desc = _(
454 "It is impossible to install or remove any software. "527 "It is impossible to install or remove any software. "
455 'Please use the package manager "Synaptic" or run '528 'Please use the package manager "Synaptic" or run '
456 '"sudo apt-get install -f" in a terminal to fix '529 '"sudo apt-get install -f" in a terminal to fix '
457 "this issue at first."530 "this issue at first."
458 )531 )
532=======
533 desc = _("It is impossible to install or remove any software. "
534 "Please use the package manager \"Synaptic\" or run "
535 "\"sudo apt-get install -f\" in a terminal to fix "
536 "this issue at first.")
537>>>>>>> UpdateManager/UpdateManager.py
459 self.start_error(False, header, desc)538 self.start_error(False, header, desc)
460 return539 return
461 except SystemError as e:540 except SystemError as e:
462 header = _("Could not initialize the package information")541 header = _("Could not initialize the package information")
542<<<<<<< UpdateManager/UpdateManager.py
463 desc = _(543 desc = _(
464 "An unresolvable problem occurred while "544 "An unresolvable problem occurred while "
465 "initializing the package information.\n\n"545 "initializing the package information.\n\n"
466 "Please report this bug against the 'update-manager' "546 "Please report this bug against the 'update-manager' "
467 "package and include the following error message:\n"547 "package and include the following error message:\n"
468 ) + str(e)548 ) + str(e)
549=======
550 desc = _("An unresolvable problem occurred while "
551 "initializing the package information.\n\n"
552 "Please report this bug against the 'update-manager' "
553 "package and include the following error "
554 "message:\n") + str(e)
555>>>>>>> UpdateManager/UpdateManager.py
469 self.start_error(False, header, desc)556 self.start_error(False, header, desc)
470 return557 return
471558
@@ -489,12 +576,19 @@ class UpdateManager(Gtk.Window):
489576
490 self.update_list = UpdateList(self)577 self.update_list = UpdateList(self)
491 try:578 try:
579<<<<<<< UpdateManager/UpdateManager.py
492 self.update_list.update(580 self.update_list.update(
493 self.cache,581 self.cache,
494 eventloop_callback=iterate,582 eventloop_callback=iterate,
495 duplicate_packages=self.duplicate_packages,583 duplicate_packages=self.duplicate_packages,
496 ua_security_packages=self.ua_security_packages,584 ua_security_packages=self.ua_security_packages,
497 )585 )
586=======
587 self.update_list.update(self.cache, eventloop_callback=iterate,
588 duplicate_packages=self.duplicate_packages,
589 ua_security_packages=self.
590 ua_security_packages)
591>>>>>>> UpdateManager/UpdateManager.py
498 except SystemError as e:592 except SystemError as e:
499 header = _("Could not calculate the upgrade")593 header = _("Could not calculate the upgrade")
500 desc = _(594 desc = _(
diff --git a/UpdateManager/UpdatesAvailable.py b/UpdateManager/UpdatesAvailable.py
index 75cfd33..f4f84ed 100644
--- a/UpdateManager/UpdatesAvailable.py
+++ b/UpdateManager/UpdatesAvailable.py
@@ -75,6 +75,7 @@ from .UnitySupport import UnitySupport
75# - screen reader does not say "Downloaded" for downloaded updates75# - screen reader does not say "Downloaded" for downloaded updates
7676
77# list constants77# list constants
78<<<<<<< UpdateManager/UpdatesAvailable.py
78(79(
79 LIST_NAME,80 LIST_NAME,
80 LIST_UPDATE_DATA,81 LIST_UPDATE_DATA,
@@ -82,6 +83,10 @@ from .UnitySupport import UnitySupport
82 LIST_TOGGLE_ACTIVE,83 LIST_TOGGLE_ACTIVE,
83 LIST_SENSITIVE,84 LIST_SENSITIVE,
84) = range(5)85) = range(5)
86=======
87(LIST_NAME, LIST_UPDATE_DATA, LIST_SIZE, LIST_TOGGLE_ACTIVE,
88 LIST_SENSITIVE) = range(5)
89>>>>>>> UpdateManager/UpdatesAvailable.py
8590
86# NetworkManager enums91# NetworkManager enums
87from .Core.roam import NetworkManagerHelper92from .Core.roam import NetworkManagerHelper
@@ -256,6 +261,7 @@ class UpdatesAvailable(InternalDialog):
256 # self.button_help.set_sensitive(False)261 # self.button_help.set_sensitive(False)
257262
258 self.add_settings_button()263 self.add_settings_button()
264<<<<<<< UpdateManager/UpdatesAvailable.py
259 self.button_close = self.add_button(265 self.button_close = self.add_button(
260 Gtk.STOCK_CANCEL, self.window_main.close266 Gtk.STOCK_CANCEL, self.window_main.close
261 )267 )
@@ -265,6 +271,14 @@ class UpdatesAvailable(InternalDialog):
265 self.button_install = self.add_button(271 self.button_install = self.add_button(
266 _("Install Now"), self.on_button_install_clicked272 _("Install Now"), self.on_button_install_clicked
267 )273 )
274=======
275 self.button_close = self.add_button(Gtk.STOCK_CANCEL,
276 self.window_main.close)
277 self.button_pro = self.add_button(_("Enable Ubuntu Pro..."),
278 self.on_button_pro_clicked)
279 self.button_install = self.add_button(_("Install Now"),
280 self.on_button_install_clicked)
281>>>>>>> UpdateManager/UpdatesAvailable.py
268 self.focus_button = self.button_install282 self.focus_button = self.button_install
269283
270 # create text view284 # create text view
@@ -310,6 +324,7 @@ class UpdatesAvailable(InternalDialog):
310 pkg_toggle_renderer.set_property("ypad", 2)324 pkg_toggle_renderer.set_property("ypad", 2)
311 pkg_toggle_renderer.connect("toggled", self.on_update_toggled)325 pkg_toggle_renderer.connect("toggled", self.on_update_toggled)
312 pkg_column.pack_start(pkg_toggle_renderer, False)326 pkg_column.pack_start(pkg_toggle_renderer, False)
327<<<<<<< UpdateManager/UpdatesAvailable.py
313 pkg_column.add_attribute(328 pkg_column.add_attribute(
314 pkg_toggle_renderer, "active", LIST_TOGGLE_ACTIVE329 pkg_toggle_renderer, "active", LIST_TOGGLE_ACTIVE
315 )330 )
@@ -319,6 +334,14 @@ class UpdatesAvailable(InternalDialog):
319 pkg_column.set_cell_data_func(334 pkg_column.set_cell_data_func(
320 pkg_toggle_renderer, self.pkg_toggle_renderer_data_func335 pkg_toggle_renderer, self.pkg_toggle_renderer_data_func
321 )336 )
337=======
338 pkg_column.add_attribute(pkg_toggle_renderer,
339 'active', LIST_TOGGLE_ACTIVE)
340 pkg_column.add_attribute(pkg_toggle_renderer,
341 'sensitive', LIST_SENSITIVE)
342 pkg_column.set_cell_data_func(pkg_toggle_renderer,
343 self.pkg_toggle_renderer_data_func)
344>>>>>>> UpdateManager/UpdatesAvailable.py
322345
323 pkg_icon_renderer = Gtk.CellRendererPixbuf()346 pkg_icon_renderer = Gtk.CellRendererPixbuf()
324 pkg_icon_renderer.set_property("ypad", 2)347 pkg_icon_renderer.set_property("ypad", 2)
@@ -346,7 +369,12 @@ class UpdatesAvailable(InternalDialog):
346 _("Download"), size_renderer, text=LIST_SIZE369 _("Download"), size_renderer, text=LIST_SIZE
347 )370 )
348 size_column.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)371 size_column.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
372<<<<<<< UpdateManager/UpdatesAvailable.py
349 size_column.add_attribute(size_renderer, "sensitive", LIST_SENSITIVE)373 size_column.add_attribute(size_renderer, "sensitive", LIST_SENSITIVE)
374=======
375 size_column.add_attribute(size_renderer,
376 'sensitive', LIST_SENSITIVE)
377>>>>>>> UpdateManager/UpdatesAvailable.py
350 self.treeview_update.append_column(size_column)378 self.treeview_update.append_column(size_column)
351379
352 self.treeview_update.set_headers_visible(True)380 self.treeview_update.set_headers_visible(True)
@@ -371,9 +399,14 @@ class UpdatesAvailable(InternalDialog):
371 self.settings.get_boolean("show-details")399 self.settings.get_boolean("show-details")
372 )400 )
373 self.expander_details.connect("activate", self.pre_activate_details)401 self.expander_details.connect("activate", self.pre_activate_details)
402<<<<<<< UpdateManager/UpdatesAvailable.py
374 self.expander_details.connect(403 self.expander_details.connect(
375 "notify::expanded", self.activate_details404 "notify::expanded", self.activate_details
376 )405 )
406=======
407 self.expander_details.connect("notify::expanded",
408 self.activate_details)
409>>>>>>> UpdateManager/UpdatesAvailable.py
377410
378 # If auto-updates are on, change cancel label411 # If auto-updates are on, change cancel label
379 self.notifier_settings = Gio.Settings.new("com.ubuntu.update-notifier")412 self.notifier_settings = Gio.Settings.new("com.ubuntu.update-notifier")
@@ -401,6 +434,17 @@ class UpdatesAvailable(InternalDialog):
401 self.news.get_buffer().set_text(apt_news)434 self.news.get_buffer().set_text(apt_news)
402 self.expander_news.set_visible(True)435 self.expander_news.set_visible(True)
403436
437 try:
438 from uaclient.api.u.apt_news.current_news.v1 import current_news
439 apt_news = current_news().current_news
440 except ImportError:
441 apt_news = self._get_apt_news(
442 "/var/lib/ubuntu-advantage/messages/apt-news"
443 )
444 if apt_news:
445 self.news.get_buffer().set_text(apt_news)
446 self.expander_news.set_visible(True)
447
404 def stop(self):448 def stop(self):
405 InternalDialog.stop(self)449 InternalDialog.stop(self)
406 self._save_state()450 self._save_state()
@@ -584,6 +628,7 @@ class UpdatesAvailable(InternalDialog):
584 version = version_match.group(1)628 version = version_match.group(1)
585 # upload_archive = version_match.group(2).strip()629 # upload_archive = version_match.group(2).strip()
586 version_text = _("Version %s: \n") % version630 version_text = _("Version %s: \n") % version
631<<<<<<< UpdateManager/UpdatesAvailable.py
587 changes_buffer.insert_with_tags_by_name(632 changes_buffer.insert_with_tags_by_name(
588 end_iter, version_text, "versiontag"633 end_iter, version_text, "versiontag"
589 )634 )
@@ -592,6 +637,14 @@ class UpdatesAvailable(InternalDialog):
592 end_iter, line + "\n", "changestag"637 end_iter, line + "\n", "changestag"
593 )638 )
594 elif author_match:639 elif author_match:
640=======
641 changes_buffer.insert_with_tags_by_name(end_iter, version_text,
642 "versiontag")
643 elif changes_match:
644 changes_buffer.insert_with_tags_by_name(end_iter, line + "\n",
645 "changestag")
646 elif (author_match):
647>>>>>>> UpdateManager/UpdatesAvailable.py
595 pass648 pass
596 else:649 else:
597 changes_buffer.insert(end_iter, line + "\n")650 changes_buffer.insert(end_iter, line + "\n")
@@ -633,7 +686,10 @@ class UpdatesAvailable(InternalDialog):
633 # replace all multiple spaces by newlines686 # replace all multiple spaces by newlines
634 p = re.compile(r"\s\s+", re.MULTILINE)687 p = re.compile(r"\s\s+", re.MULTILINE)
635 long_desc = p.sub("\n", long_desc)688 long_desc = p.sub("\n", long_desc)
689<<<<<<< UpdateManager/UpdatesAvailable.py
636 long_desc = "Package: %s\n%s" % (item.pkg.name, long_desc)690 long_desc = "Package: %s\n%s" % (item.pkg.name, long_desc)
691=======
692>>>>>>> UpdateManager/UpdatesAvailable.py
637693
638 # now do the changelog694 # now do the changelog
639 name = item.pkg.name695 name = item.pkg.name
@@ -851,8 +907,13 @@ class UpdatesAvailable(InternalDialog):
851 self.button_pro.destroy()907 self.button_pro.destroy()
852 elif (self.list.ubuntu_pro_fake_groups908 elif (self.list.ubuntu_pro_fake_groups
853 and not self.list.ubuntu_pro_groups):909 and not self.list.ubuntu_pro_groups):
910<<<<<<< UpdateManager/UpdatesAvailable.py
854 download_str = _("You need to enable Ubuntu Pro to install"911 download_str = _("You need to enable Ubuntu Pro to install"
855 " these updates.")912 " these updates.")
913=======
914 download_str = _("You need to enable Ubuntu Pro to "
915 "install these updates.")
916>>>>>>> UpdateManager/UpdatesAvailable.py
856 self.button_install.destroy()917 self.button_install.destroy()
857 else:918 else:
858 download_str = _("There are no updates to install.")919 download_str = _("There are no updates to install.")
@@ -1140,7 +1201,11 @@ class UpdatesAvailable(InternalDialog):
1140 UpdateData(groups, None, None),1201 UpdateData(groups, None, None),
1141 humanize_size(total_size),1202 humanize_size(total_size),
1142 True,1203 True,
1204<<<<<<< UpdateManager/UpdatesAvailable.py
1143 sensitive,1205 sensitive,
1206=======
1207 sensitive
1208>>>>>>> UpdateManager/UpdatesAvailable.py
1144 ]1209 ]
1145 return self.store.append(None, header_row)1210 return self.store.append(None, header_row)
11461211
@@ -1163,16 +1228,23 @@ class UpdatesAvailable(InternalDialog):
11631228
1164 if group.name == "Ubuntu base":1229 if group.name == "Ubuntu base":
1165 group.name = "System components"1230 group.name = "System components"
1231<<<<<<< UpdateManager/UpdatesAvailable.py
1166 name = group.name1232 name = group.name
1167 if len(group.items) > 1:1233 if len(group.items) > 1:
1168 name = '%s (%d)' % (group.name, len(group.items))1234 name = '%s (%d)' % (group.name, len(group.items))
11691235
1236=======
1237>>>>>>> UpdateManager/UpdatesAvailable.py
1170 group_row = [1238 group_row = [
1171 name,1239 name,
1172 UpdateData(None, group, group_is_item),1240 UpdateData(None, group, group_is_item),
1173 humanize_size(group.get_total_size()),1241 humanize_size(group.get_total_size()),
1174 True,1242 True,
1243<<<<<<< UpdateManager/UpdatesAvailable.py
1175 group.sensitive,1244 group.sensitive,
1245=======
1246 group.sensitive
1247>>>>>>> UpdateManager/UpdatesAvailable.py
1176 ]1248 ]
1177 group_iter = self.store.append(None, group_row)1249 group_iter = self.store.append(None, group_row)
11781250
@@ -1184,7 +1256,11 @@ class UpdatesAvailable(InternalDialog):
1184 UpdateData(None, None, item),1256 UpdateData(None, None, item),
1185 humanize_size(getattr(item.pkg.candidate, "size", 0)),1257 humanize_size(getattr(item.pkg.candidate, "size", 0)),
1186 True,1258 True,
1259<<<<<<< UpdateManager/UpdatesAvailable.py
1187 group.sensitive,1260 group.sensitive,
1261=======
1262 group.sensitive
1263>>>>>>> UpdateManager/UpdatesAvailable.py
1188 ]1264 ]
1189 self.store.append(group_iter, item_row)1265 self.store.append(group_iter, item_row)
11901266
@@ -1203,9 +1279,14 @@ class UpdatesAvailable(InternalDialog):
12031279
1204 # add security and update groups to self.store1280 # add security and update groups to self.store
1205 if self.list.oem_groups:1281 if self.list.oem_groups:
1282<<<<<<< UpdateManager/UpdatesAvailable.py
1206 self._add_header(1283 self._add_header(
1207 _("Improved hardware support"), self.list.oem_groups1284 _("Improved hardware support"), self.list.oem_groups
1208 )1285 )
1286=======
1287 self._add_header(_("Improved hardware support"),
1288 self.list.oem_groups)
1289>>>>>>> UpdateManager/UpdatesAvailable.py
1209 self._add_groups(self.list.oem_groups)1290 self._add_groups(self.list.oem_groups)
1210 if self.list.security_groups:1291 if self.list.security_groups:
1211 self._add_header(_("Security updates"), self.list.security_groups)1292 self._add_header(_("Security updates"), self.list.security_groups)
diff --git a/UpdateManager/backend/InstallBackendAptdaemon.py b/UpdateManager/backend/InstallBackendAptdaemon.py
index 2959aa6..559faa7 100644
--- a/UpdateManager/backend/InstallBackendAptdaemon.py
+++ b/UpdateManager/backend/InstallBackendAptdaemon.py
@@ -7,6 +7,7 @@ from gi.repository import Gtk
77
8from aptdaemon import client, errors8from aptdaemon import client, errors
9from defer import inline_callbacks9from defer import inline_callbacks
10<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
10from aptdaemon.gtk3widgets import (11from aptdaemon.gtk3widgets import (
11 AptCancelButton,12 AptCancelButton,
12 AptConfigFileConflictDialog,13 AptConfigFileConflictDialog,
@@ -25,6 +26,22 @@ from aptdaemon.enums import (
25 get_error_string_from_enum,26 get_error_string_from_enum,
26 get_status_string_from_enum,27 get_status_string_from_enum,
27)28)
29=======
30from aptdaemon.gtk3widgets import (AptCancelButton,
31 AptConfigFileConflictDialog,
32 AptDetailsExpander,
33 AptMediumRequiredDialog,
34 AptProgressBar)
35from aptdaemon.enums import (EXIT_SUCCESS,
36 EXIT_FAILED,
37 STATUS_COMMITTING,
38 STATUS_DOWNLOADING,
39 STATUS_DOWNLOADING_REPO,
40 STATUS_FINISHED,
41 get_error_description_from_enum,
42 get_error_string_from_enum,
43 get_status_string_from_enum)
44>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
2845
29from UpdateManager.backend import InstallBackend46from UpdateManager.backend import InstallBackend
30from UpdateManager.UnitySupport import UnitySupport47from UpdateManager.UnitySupport import UnitySupport
@@ -39,10 +56,17 @@ import os
39class UpdateManagerExpander(AptDetailsExpander):56class UpdateManagerExpander(AptDetailsExpander):
40 """An AptDetailsExpander which can be used with multiple terminals.57 """An AptDetailsExpander which can be used with multiple terminals.
4158
59<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
42 The default AptDetailsExpander will shrink/hide when its transaction60 The default AptDetailsExpander will shrink/hide when its transaction
43 finishes. But here we want to support "chaining" transactions. So we61 finishes. But here we want to support "chaining" transactions. So we
44 override the status-changed handler to only do that when we are62 override the status-changed handler to only do that when we are
45 running the final transaction."""63 running the final transaction."""
64=======
65 The default AptDetailsExpander will shrink/hide when its transaction
66 finishes. But here we want to support "chaining" transactions. So we
67 override the status-changed handler to only do that when we are
68 running the final transaction."""
69>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
4670
47 def __init__(self, transaction, terminal=True, final=False):71 def __init__(self, transaction, terminal=True, final=False):
48 super().__init__(transaction, terminal)72 super().__init__(transaction, terminal)
@@ -71,7 +95,11 @@ class UpdateManagerExpander(AptDetailsExpander):
7195
7296
73class AptStackedProgressBar(Gtk.ProgressBar):97class AptStackedProgressBar(Gtk.ProgressBar):
98<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
74 """A GtkProgressBar which represents the state of many aptdaemon99 """A GtkProgressBar which represents the state of many aptdaemon
100=======
101 """ A GtkProgressBar which represents the state of many aptdaemon
102>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
75 transactions.103 transactions.
76104
77 aptdaemon provides AptProgressBar for the state of *one* transaction to105 aptdaemon provides AptProgressBar for the state of *one* transaction to
@@ -322,12 +350,130 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
322 )350 )
323 raise351 raise
324352
353 def _show_transaction_error(self, trans, action):
354 error_string = get_error_string_from_enum(trans.error.code)
355 error_desc = get_error_description_from_enum(trans.error.code)
356 if self.trans_failed_msg:
357 trans_failed = True
358 error_desc = error_desc + "\n" + self.trans_failed_msg
359 else:
360 trans_failed = None
361 self._action_done(action,
362 authorized=True, success=False,
363 error_string=error_string,
364 error_desc=error_desc,
365 trans_failed=trans_failed)
366
367 def _update_next_package(self, trans, status, action):
368 if status == EXIT_FAILED:
369 self._show_transaction_error(trans, action)
370 return
371 self._apt_update_oem()
372
373 @inline_callbacks
374 def _apt_update_oem(self):
375 assert self._oem_packages_to_update
376 elem = self._oem_packages_to_update.pop()
377 sources_list_file = f'/etc/apt/sources.list.d/{elem}.list'
378
379 try:
380 if os.path.exists(sources_list_file):
381 trans = yield self.client.update_cache(
382 sources_list=sources_list_file
383 )
384 if self._oem_packages_to_update:
385 finished_handler = self._update_next_package
386 else:
387 finished_handler = self._on_finished
388
389 yield self._show_transaction(
390 trans,
391 self.ACTION_PRE_INSTALL,
392 _("Installing updates…"), True,
393 on_finished_handler=finished_handler,
394 progress_bar_max=0.1 / self._len_oem_updates
395 )
396 except errors.NotAuthorizedError:
397 self._action_done(self.ACTION_PRE_INSTALL,
398 authorized=False, success=False,
399 error_string=None, error_desc=None)
400 except errors.TransactionFailed as e:
401 self.trans_failed_msg = str(e)
402 except dbus.DBusException as e:
403 if e.get_dbus_name() != "org.freedesktop.DBus.Error.NoReply":
404 raise
405 self._action_done(self.ACTION_PRE_INSTALL,
406 authorized=False, success=False,
407 error_string=None, error_desc=None)
408 except Exception:
409 self._action_done(self.ACTION_PRE_INSTALL,
410 authorized=True, success=False,
411 error_string=None, error_desc=None)
412 raise
413
414 def _update_oem(self, trans, status, action):
415 # This is the "finished" handler of installing an oem metapackage
416 # What we do now is:
417 # 1. update_cache() for the new sources.lists only
418
419 if status == EXIT_FAILED:
420 self._show_transaction_error(trans, action)
421 return
422
423 (install, _, _, _, _, _) = trans.packages
424
425 self._oem_packages_to_update = set(install)
426 self._len_oem_updates = len(install)
427
428 self._apt_update_oem()
429
430 @inline_callbacks
431 def commit_oem(self, pkgs_install_oem, pkgs_upgrade_oem):
432 self.all_oem_packages = set(pkgs_install_oem) | set(pkgs_upgrade_oem)
433 # Nothing to do? Go to the regular updates.
434 try:
435 if not pkgs_install_oem and not pkgs_upgrade_oem:
436 self._action_done(self.ACTION_PRE_INSTALL,
437 authorized=True, success=True,
438 error_string=None, error_desc=None,
439 trans_failed=None)
440 return
441
442 if pkgs_install_oem:
443 trans = yield self.client.install_packages(pkgs_install_oem,
444 defer=True)
445 yield self._show_transaction(
446 trans,
447 self.ACTION_PRE_INSTALL,
448 _("Installing updates…"), True,
449 on_finished_handler=self._update_oem,
450 progress_bar_max=0.1
451 )
452 except errors.NotAuthorizedError:
453 self._action_done(self.ACTION_PRE_INSTALL,
454 authorized=False, success=False,
455 error_string=None, error_desc=None)
456 except errors.TransactionFailed as e:
457 self.trans_failed_msg = str(e)
458 except dbus.DBusException as e:
459 if e.get_dbus_name() != "org.freedesktop.DBus.Error.NoReply":
460 raise
461 self._action_done(self.ACTION_PRE_INSTALL,
462 authorized=False, success=False,
463 error_string=None, error_desc=None)
464 except Exception:
465 self._action_done(self.ACTION_PRE_INSTALL,
466 authorized=True, success=False,
467 error_string=None, error_desc=None)
468 raise
469
325 @inline_callbacks470 @inline_callbacks
326 def commit(self, pkgs_install, pkgs_upgrade, pkgs_remove):471 def commit(self, pkgs_install, pkgs_upgrade, pkgs_remove):
327 """Commit a list of package adds and removes"""472 """Commit a list of package adds and removes"""
328 try:473 try:
329 reinstall = purge = downgrade = []474 reinstall = purge = downgrade = []
330 trans = yield self.client.commit_packages(475 trans = yield self.client.commit_packages(
476<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
331 pkgs_install,477 pkgs_install,
332 reinstall,478 reinstall,
333 pkgs_remove,479 pkgs_remove,
@@ -339,6 +485,12 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
339 yield self._show_transaction(485 yield self._show_transaction(
340 trans, self.ACTION_INSTALL, _("Installing updates…"), True486 trans, self.ACTION_INSTALL, _("Installing updates…"), True
341 )487 )
488=======
489 pkgs_install, reinstall, pkgs_remove, purge, pkgs_upgrade,
490 downgrade, defer=True)
491 yield self._show_transaction(trans, self.ACTION_INSTALL,
492 _("Installing updates…"), True)
493>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
342 except errors.NotAuthorizedError:494 except errors.NotAuthorizedError:
343 self._action_done(495 self._action_done(
344 self.ACTION_INSTALL,496 self.ACTION_INSTALL,
@@ -377,6 +529,7 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
377 label_details.set_label(get_status_string_from_enum(status))529 label_details.set_label(get_status_string_from_enum(status))
378 # Also resize the window if we switch from download details to530 # Also resize the window if we switch from download details to
379 # the terminal window531 # the terminal window
532<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
380 if (533 if (
381 status == STATUS_COMMITTING534 status == STATUS_COMMITTING
382 and self._expander535 and self._expander
@@ -394,6 +547,16 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
394 progress_bar_max=1,547 progress_bar_max=1,
395 on_finished_handler=None,548 on_finished_handler=None,
396 ):549 ):
550=======
551 if status == STATUS_COMMITTING and self._expander \
552 and self._expander.terminal.get_visible():
553 self._resize_to_show_details(self._expander)
554
555 @inline_callbacks
556 def _show_transaction(self, trans, action, header, show_details,
557 progress_bar_max=1,
558 on_finished_handler=None):
559>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
397560
398 if on_finished_handler is None:561 if on_finished_handler is None:
399 on_finished_handler = self._on_finished562 on_finished_handler = self._on_finished
@@ -423,7 +586,12 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
423 self._expander.set_vexpand(True)586 self._expander.set_vexpand(True)
424 self._expander.set_hexpand(True)587 self._expander.set_hexpand(True)
425 self._expander.show_all()588 self._expander.show_all()
589<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
426 self._expander.connect("notify::expanded", self._on_expanded)590 self._expander.connect("notify::expanded", self._on_expanded)
591=======
592 self._expander.connect("notify::expanded",
593 self._on_expanded)
594>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
427 self.expander_slot.add(self._expander)595 self.expander_slot.add(self._expander)
428 self.expander_slot.show()596 self.expander_slot.show()
429 else:597 else:
@@ -432,6 +600,7 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
432 elif self._expander:600 elif self._expander:
433 self._expander_slot.hide()601 self._expander_slot.hide()
434602
603<<<<<<< UpdateManager/backend/InstallBackendAptdaemon.py
435 trans.connect(604 trans.connect(
436 "status-details-changed",605 "status-details-changed",
437 self._on_details_changed,606 self._on_details_changed,
@@ -440,6 +609,12 @@ class InstallBackendAptdaemon(InstallBackend, BuilderDialog):
440 trans.connect(609 trans.connect(
441 "status-changed", self._on_status_changed, self.label_details610 "status-changed", self._on_status_changed, self.label_details
442 )611 )
612=======
613 trans.connect("status-details-changed", self._on_details_changed,
614 self.label_details)
615 trans.connect("status-changed", self._on_status_changed,
616 self.label_details)
617>>>>>>> UpdateManager/backend/InstallBackendAptdaemon.py
443 trans.connect("finished", on_finished_handler, action)618 trans.connect("finished", on_finished_handler, action)
444 trans.connect("medium-required", self._on_medium_required)619 trans.connect("medium-required", self._on_medium_required)
445 trans.connect("config-file-conflict", self._on_config_file_conflict)620 trans.connect("config-file-conflict", self._on_config_file_conflict)
diff --git a/UpdateManager/backend/__init__.py b/UpdateManager/backend/__init__.py
index 72a6031..66a950f 100644
--- a/UpdateManager/backend/__init__.py
+++ b/UpdateManager/backend/__init__.py
@@ -50,9 +50,17 @@ class InstallBackend(Dialog):
50 unfresh_pkg = unfresh_cache[pkg]50 unfresh_pkg = unfresh_cache[pkg]
51 fresh_pkg = fresh_cache[pkg]51 fresh_pkg = fresh_cache[pkg]
5252
53<<<<<<< UpdateManager/backend/__init__.py
53 if unfresh_pkg.marked_install and not fresh_pkg.is_installed:54 if unfresh_pkg.marked_install and not fresh_pkg.is_installed:
54 pkgs_install_oem.append(pkg)55 pkgs_install_oem.append(pkg)
55 elif unfresh_pkg.marked_upgrade and fresh_pkg.is_upgradable:56 elif unfresh_pkg.marked_upgrade and fresh_pkg.is_upgradable:
57=======
58 if (unfresh_pkg.marked_install
59 and not fresh_pkg.is_installed):
60 pkgs_install_oem.append(pkg)
61 elif (unfresh_pkg.marked_upgrade
62 and fresh_pkg.is_upgradable):
63>>>>>>> UpdateManager/backend/__init__.py
56 pkgs_upgrade_oem.append(pkg)64 pkgs_upgrade_oem.append(pkg)
57 self.commit_oem(pkgs_install_oem, pkgs_upgrade_oem)65 self.commit_oem(pkgs_install_oem, pkgs_upgrade_oem)
58 elif self.action == self.ACTION_INSTALL:66 elif self.action == self.ACTION_INSTALL:
@@ -95,6 +103,7 @@ class InstallBackend(Dialog):
95 raise NotImplementedError103 raise NotImplementedError
96104
97 def commit_oem(self, pkgs_install_oem, pkgs_upgrade_oem):105 def commit_oem(self, pkgs_install_oem, pkgs_upgrade_oem):
106<<<<<<< UpdateManager/backend/__init__.py
98 """Install these OEM packages"""107 """Install these OEM packages"""
99 self._action_done(108 self._action_done(
100 self.ACTION_PRE_INSTALL,109 self.ACTION_PRE_INSTALL,
@@ -104,6 +113,13 @@ class InstallBackend(Dialog):
104 error_desc=None,113 error_desc=None,
105 trans_failed=None,114 trans_failed=None,
106 )115 )
116=======
117 """ Install these OEM packages """
118 self._action_done(self.ACTION_PRE_INSTALL,
119 authorized=True, success=True,
120 error_string=None, error_desc=None,
121 trans_failed=None)
122>>>>>>> UpdateManager/backend/__init__.py
107123
108 def commit(self, pkgs_install, pkgs_upgrade, pkgs_remove):124 def commit(self, pkgs_install, pkgs_upgrade, pkgs_remove):
109 """Commit the cache changes"""125 """Commit the cache changes"""
@@ -379,18 +395,27 @@ class InstallBackend(Dialog):
379 # close_after_install = settings.get_boolean(395 # close_after_install = settings.get_boolean(
380 # "autoclose-install-window")396 # "autoclose-install-window")
381 # FIXME: confirm with mpt whether this should still be a setting397 # FIXME: confirm with mpt whether this should still be a setting
398<<<<<<< UpdateManager/backend/__init__.py
382 # close_after_install = False399 # close_after_install = False
400=======
401 #close_after_install = False
402>>>>>>> UpdateManager/backend/__init__.py
383403
384 if action == self.ACTION_PRE_INSTALL and success:404 if action == self.ACTION_PRE_INSTALL and success:
385 # Now do the regular updates405 # Now do the regular updates
386 self.action = self.ACTION_INSTALL406 self.action = self.ACTION_INSTALL
387 self.start()407 self.start()
388 elif action == self.ACTION_INSTALL:408 elif action == self.ACTION_INSTALL:
409<<<<<<< UpdateManager/backend/__init__.py
389 if (410 if (
390 success411 success
391 and os.path.exists("/usr/bin/snap")412 and os.path.exists("/usr/bin/snap")
392 and hasattr(self, "pane_update_progress")413 and hasattr(self, "pane_update_progress")
393 ):414 ):
415=======
416 if (success and os.path.exists("/usr/bin/snap")
417 and hasattr(self, 'pane_update_progress')):
418>>>>>>> UpdateManager/backend/__init__.py
394 Thread(target=self.update_snaps).start()419 Thread(target=self.update_snaps).start()
395 elif success:420 elif success:
396 self.window_main.start_available()421 self.window_main.start_available()
@@ -405,11 +430,16 @@ class InstallBackend(Dialog):
405 else:430 else:
406 if error_string:431 if error_string:
407 self.window_main.start_error(True, error_string, error_desc)432 self.window_main.start_error(True, error_string, error_desc)
433<<<<<<< UpdateManager/backend/__init__.py
408 elif (434 elif (
409 success435 success
410 and os.path.exists("/usr/bin/snap")436 and os.path.exists("/usr/bin/snap")
411 and hasattr(self, "pane_update_progress")437 and hasattr(self, "pane_update_progress")
412 ):438 ):
439=======
440 elif (success and os.path.exists("/usr/bin/snap")
441 and hasattr(self, 'pane_update_progress')):
442>>>>>>> UpdateManager/backend/__init__.py
413 self.window_main.duplicate_packages = self.get_deb2snap_dups()443 self.window_main.duplicate_packages = self.get_deb2snap_dups()
414 self.window_main.start_available()444 self.window_main.start_available()
415 else:445 else:
diff --git a/data/gtkbuilder/UpdateManager.ui b/data/gtkbuilder/UpdateManager.ui
index 39daaad..6b1747e 100644
--- a/data/gtkbuilder/UpdateManager.ui
+++ b/data/gtkbuilder/UpdateManager.ui
@@ -7,7 +7,11 @@
7 <property name="spacing">12</property>7 <property name="spacing">12</property>
8 <!--8 <!--
9 https://launchpad.net/bugs/20459189 https://launchpad.net/bugs/2045918
10<<<<<<< data/gtkbuilder/UpdateManager.ui
10 Old widgets from previous version need to be kept, even though invisible,11 Old widgets from previous version need to be kept, even though invisible,
12=======
13 Old widgets from 20.04.9 need to be kept, even though invisible, because
14>>>>>>> data/gtkbuilder/UpdateManager.ui
11 otherwise updating Update Manager itself via Update Manager will crash when15 otherwise updating Update Manager itself via Update Manager will crash when
12 Update Manager recalculates itself. That is because the old Update Manager16 Update Manager recalculates itself. That is because the old Update Manager
13 file is still the being executed, whereas this ui file will be the new one.17 file is still the being executed, whereas this ui file will be the new one.
diff --git a/debian/changelog b/debian/changelog
index d9b2db4..7fd23be 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,4 @@
1<<<<<<< debian/changelog
1update-manager (1:24.04.4) UNRELEASED; urgency=low2update-manager (1:24.04.4) UNRELEASED; urgency=low
23
3 * d/control: Depend on ubuntu-advantage-tools >= 30~.4 * d/control: Depend on ubuntu-advantage-tools >= 30~.
@@ -7,10 +8,22 @@ update-manager (1:24.04.4) UNRELEASED; urgency=low
7 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Mon, 22 Jan 2024 08:17:25 +01008 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Mon, 22 Jan 2024 08:17:25 +0100
89
9update-manager (1:24.04.3) noble; urgency=medium10update-manager (1:24.04.3) noble; urgency=medium
11=======
12update-manager (1:20.04.10.20) focal; urgency=medium
13
14 * The New Release dialog should take precedence over a list of updates dialog
15 if the latter would only show Ubuntu Pro updates in an unattached system.
16 (LP: #2051115).
17
18 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Thu, 25 Jan 2024 13:45:30 +0100
19
20update-manager (1:20.04.10.19) focal; urgency=medium
21>>>>>>> debian/changelog
1022
11 * Add back removed widgets to UI file to fix crash when updating23 * Add back removed widgets to UI file to fix crash when updating
12 Upgrade Manager from inside itself (LP: #2045918).24 Upgrade Manager from inside itself (LP: #2045918).
1325
26<<<<<<< debian/changelog
14 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Fri, 08 Dec 2023 11:25:51 +010027 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Fri, 08 Dec 2023 11:25:51 +0100
1528
16update-manager (1:24.04.2) noble; urgency=medium29update-manager (1:24.04.2) noble; urgency=medium
@@ -29,6 +42,33 @@ update-manager (1:24.04.1) noble; urgency=medium
29 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Wed, 15 Nov 2023 11:45:02 +010042 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Wed, 15 Nov 2023 11:45:02 +0100
3043
31update-manager (1:23.10.2) mantic; urgency=medium44update-manager (1:23.10.2) mantic; urgency=medium
45=======
46 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Fri, 08 Dec 2023 15:37:42 +0100
47
48update-manager (1:20.04.10.18) focal; urgency=medium
49
50 * Fix incorrect available version for Ubuntu Pro updates in unattached case
51 (LP: #2043425).
52
53 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Wed, 15 Nov 2023 11:28:54 +0100
54
55update-manager (1:20.04.10.17) focal; urgency=medium
56
57 * Ubuntu Pro (LP: #1990450):
58 - fix another linter error which was created while fixing a missing
59 space in the previous upload...
60
61 -- Sebastien Bacher <seb128@ubuntu.com> Fri, 06 Oct 2023 11:56:51 +0200
62
63update-manager (1:20.04.10.16) focal; urgency=medium
64
65 * Ubuntu Pro (LP: #1990450):
66 - Address linter errors that cause autopkgtest to fail.
67
68 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Wed, 04 Oct 2023 23:46:23 +0200
69
70update-manager (1:20.04.10.15) focal; urgency=medium
71>>>>>>> debian/changelog
3272
33 * Ubuntu Pro (LP: #1990450):73 * Ubuntu Pro (LP: #1990450):
34 - Show Ubuntu Pro packages, whether the system is attached to Ubuntu Pro74 - Show Ubuntu Pro packages, whether the system is attached to Ubuntu Pro
@@ -39,6 +79,7 @@ update-manager (1:23.10.2) mantic; urgency=medium
39 - Add News pane in a expander.79 - Add News pane in a expander.
40 - Replace notebook with Description and Changes tabs by a pane.80 - Replace notebook with Description and Changes tabs by a pane.
4181
82<<<<<<< debian/changelog
42 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Mon, 25 Sep 2023 17:03:10 +020083 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Mon, 25 Sep 2023 17:03:10 +0200
4384
44update-manager (1:23.10.1) mantic; urgency=medium85update-manager (1:23.10.1) mantic; urgency=medium
@@ -97,10 +138,35 @@ update-manager (1:22.10.4) kinetic; urgency=medium
97 -- Steve Langasek <steve.langasek@ubuntu.com> Sun, 16 Oct 2022 23:26:08 -0700138 -- Steve Langasek <steve.langasek@ubuntu.com> Sun, 16 Oct 2022 23:26:08 -0700
98139
99update-manager (1:22.10.3) kinetic; urgency=medium140update-manager (1:22.10.3) kinetic; urgency=medium
141=======
142 -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com> Tue, 29 Aug 2023 07:47:20 +0200
143
144update-manager (1:20.04.10.14) focal; urgency=medium
145
146 * Fix Ubuntu Pro updates checkbox and expander widget from overlapping
147 (LP: #1990450)
148
149 -- Robert Ancell <robert.ancell@canonical.com> Fri, 03 Feb 2023 14:43:45 +1300
150
151update-manager (1:20.04.10.13) focal; urgency=medium
152
153 * Update of the parsing for pro client changes (lp: #1990450)
154
155 -- Sebastien Bacher <seb128@ubuntu.com> Thu, 26 Jan 2023 11:56:31 +0100
156
157update-manager (1:20.04.10.12) focal; urgency=medium
158
159 * Show pending Ubuntu pro packages (LP: #1990450)
160
161 -- Robert Ancell <robert.ancell@canonical.com> Wed, 18 Jan 2023 15:03:27 +1300
162
163update-manager (1:20.04.10.11) focal; urgency=medium
164>>>>>>> debian/changelog
100165
101 [ Renan Rodrigo ]166 [ Renan Rodrigo ]
102 * ubuntu-security-status: Don't show ESM Apps information when the service167 * ubuntu-security-status: Don't show ESM Apps information when the service
103 is disabled, and prefer 'pro security-status' when it is available.168 is disabled, and prefer 'pro security-status' when it is available.
169<<<<<<< debian/changelog
104170
105 -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 03 Oct 2022 08:37:28 -0700171 -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 03 Oct 2022 08:37:28 -0700
106172
@@ -182,11 +248,28 @@ update-manager (1:22.04.1) jammy; urgency=medium
182 -- Brian Murray <brian@ubuntu.com> Mon, 18 Oct 2021 12:26:38 -0700248 -- Brian Murray <brian@ubuntu.com> Mon, 18 Oct 2021 12:26:38 -0700
183249
184update-manager (1:21.10.4) impish; urgency=medium250update-manager (1:21.10.4) impish; urgency=medium
251=======
252 (LP: #1991533)
253
254 -- Brian Murray <brian@ubuntu.com> Thu, 01 Dec 2022 11:10:57 -0800
255
256update-manager (1:20.04.10.10) focal; urgency=medium
257
258 * ubuntu-security-status: Check if ESM for Apps is enabled or if it is not
259 in beta before displaying information about the packages available from
260 there. Additionally, improve pluralization in a couple of locations.
261 (LP: #1955471)
262
263 -- Brian Murray <brian@ubuntu.com> Fri, 14 Jan 2022 10:28:42 -0800
264
265update-manager (1:20.04.10.9) focal; urgency=medium
266>>>>>>> debian/changelog
185267
186 * ubuntu-security-status: use ubuntu-advantage-tools to determine whether or268 * ubuntu-security-status: use ubuntu-advantage-tools to determine whether or
187 not livepatch or esm are enabled and if the system is attached. Thanks to269 not livepatch or esm are enabled and if the system is attached. Thanks to
188 Chad Smith for the patch. (LP: #1938043)270 Chad Smith for the patch. (LP: #1938043)
189271
272<<<<<<< debian/changelog
190 -- Brian Murray <brian@ubuntu.com> Fri, 03 Sep 2021 14:43:22 -0700273 -- Brian Murray <brian@ubuntu.com> Fri, 03 Sep 2021 14:43:22 -0700
191274
192update-manager (1:21.10.3) impish; urgency=medium275update-manager (1:21.10.3) impish; urgency=medium
@@ -277,11 +360,65 @@ update-manager (1:21.04.3) hirsute; urgency=medium
277 (LP: #1807900)360 (LP: #1807900)
278 * UpdateManager/backend/__init__.py: Resolve unbound local error crash with361 * UpdateManager/backend/__init__.py: Resolve unbound local error crash with
279 oem package lists. Thanks to Thomas Bechtold for the patch.362 oem package lists. Thanks to Thomas Bechtold for the patch.
363=======
364 -- Brian Murray <brian@ubuntu.com> Fri, 03 Sep 2021 15:17:22 -0700
365
366update-manager (1:20.04.10.8) focal; urgency=medium
367
368 * tests/test_meta_release_core.py: switch a test from using lucid to bionic
369 as precise was removed from the archive. (LP: #1929865)
370
371 -- Brian Murray <brian@ubuntu.com> Thu, 27 May 2021 13:36:54 -0700
372
373update-manager (1:20.04.10.7) focal; urgency=medium
374
375 * tests/test_update_list.py: rewrite how APT::VersionedKernelPackages is set.
376 (LP: #1924809)
377 * debian/tests/control: add apt to the list of Depends.
378
379 -- Brian Murray <brian@ubuntu.com> Fri, 16 Apr 2021 16:25:21 -0700
380
381update-manager (1:20.04.10.6) focal; urgency=medium
382
383 * UpdateManager/Core/UpdateList.py: change to a regex from a static list
384 of packages to be grouped under Ubuntu Base (LP: #1902025)
385 * Clean up apt cache binary files left behind by tests
386 * Rename meta_pkgs to ubuntu_base_pkgs to make it more clear to the
387 reader which packages should be included
388 * Add tests in to ensure Ubuntu base packages are not grouped when
389 staged for removal (LP: #1912718)
390
391 -- William 'jawn-smith' Wilson <william.wilson@canonical.com> Wed, 10 Feb 2021 14:39:27 -0600
392
393update-manager (1:20.04.10.5) focal; urgency=medium
394
395 * UpdateManager/backend/__init__.py: Really make commit_oem a no-op in the
396 base class to avoid crash when people force synaptic backend (LP: #1913732)
397 * Fix typo in previous changelog
398
399 -- Julian Andres Klode <juliank@ubuntu.com> Fri, 29 Jan 2021 17:43:01 +0100
400
401update-manager (1:20.04.10.4) focal; urgency=medium
402
403 * Revert previous change to UpdateList.py, as it breaks kernel
404 autoremoval (LP: #1912718)
405 * UpdateManager/backend/__init__.py: Make commit_oem a no-op in the base
406 class to avoid crash when people force synaptic backend (LP: #1913732)
407
408 -- Julian Andres Klode <juliank@ubuntu.com> Fri, 29 Jan 2021 12:50:23 +0100
409
410update-manager (1:20.04.10.3) focal; urgency=medium
411
412 [ Julian Andres Klode ]
413 * UpdateManager/backend/__init__.py: Fix unbound local variables regression
414 introduced by the previous SRU (See LP 1910556), and correct comment
415>>>>>>> debian/changelog
280416
281 [ William Wilson ]417 [ William Wilson ]
282 * UpdateManager/Core/UpdateList.py: change to a regex from a static list418 * UpdateManager/Core/UpdateList.py: change to a regex from a static list
283 of packages to be grouped under Ubuntu Base (LP: #1902025)419 of packages to be grouped under Ubuntu Base (LP: #1902025)
284420
421<<<<<<< debian/changelog
285 -- Brian Murray <brian@ubuntu.com> Fri, 08 Jan 2021 08:41:47 -0800422 -- Brian Murray <brian@ubuntu.com> Fri, 08 Jan 2021 08:41:47 -0800
286423
287update-manager (1:21.04.2) hirsute; urgency=medium424update-manager (1:21.04.2) hirsute; urgency=medium
@@ -297,10 +434,16 @@ update-manager (1:21.04.1) hirsute; urgency=medium
297 * UpdateManager/UpdatesAvailable.py: In the technical description portion of434 * UpdateManager/UpdatesAvailable.py: In the technical description portion of
298 the Software Update window display the package name in the Description435 the Software Update window display the package name in the Description
299 tab. Thanks to Jarkko Toivonen for the patch.436 tab. Thanks to Jarkko Toivonen for the patch.
437=======
438 -- Brian Murray <brian@ubuntu.com> Wed, 13 Jan 2021 08:35:58 -0800
439
440update-manager (1:20.04.10.2) focal; urgency=medium
441>>>>>>> debian/changelog
300442
301 [ Iain Lane & Julian Andres Klode ]443 [ Iain Lane & Julian Andres Klode ]
302 * Support post install enablement of OEM-enabled devices (LP: #1908050)444 * Support post install enablement of OEM-enabled devices (LP: #1908050)
303445
446<<<<<<< debian/changelog
304 -- Julian Andres Klode <juliank@ubuntu.com> Mon, 14 Dec 2020 11:32:03 +0100447 -- Julian Andres Klode <juliank@ubuntu.com> Mon, 14 Dec 2020 11:32:03 +0100
305448
306update-manager (1:20.10.1) groovy; urgency=medium449update-manager (1:20.10.1) groovy; urgency=medium
@@ -319,13 +462,25 @@ update-manager (1:20.04.12) groovy; urgency=medium
319 -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Thu, 28 May 2020 10:11:51 +0100462 -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Thu, 28 May 2020 10:11:51 +0100
320463
321update-manager (1:20.04.11) groovy; urgency=medium464update-manager (1:20.04.11) groovy; urgency=medium
465=======
466 -- Julian Andres Klode <juliank@ubuntu.com> Mon, 14 Dec 2020 12:24:18 +0100
467
468update-manager (1:20.04.10.1) focal; urgency=medium
469>>>>>>> debian/changelog
322470
323 * UpdateManager/UpdateManager.py: when refreshing the cache and encountering471 * UpdateManager/UpdateManager.py: when refreshing the cache and encountering
324 an error return rather than trying to use the undefined cache which causes472 an error return rather than trying to use the undefined cache which causes
325 crashes. Additionally, don't present the dialog with a "Try Again" button473 crashes. Additionally, don't present the dialog with a "Try Again" button
326 which won't do anything. (LP: #1826213)474 which won't do anything. (LP: #1826213)
475<<<<<<< debian/changelog
327476
328 -- Brian Murray <brian@ubuntu.com> Wed, 27 May 2020 13:29:24 -0700477 -- Brian Murray <brian@ubuntu.com> Wed, 27 May 2020 13:29:24 -0700
478=======
479 * Fix hang in apturl-gtk. (LP: #1874591)
480 * Fix crash in snap updates when refreshing the cache fails. (LP: #1880987)
481
482 -- Brian Murray <brian@ubuntu.com> Wed, 03 Jun 2020 10:18:00 -0700
483>>>>>>> debian/changelog
329484
330update-manager (1:20.04.10) focal; urgency=medium485update-manager (1:20.04.10) focal; urgency=medium
331486
diff --git a/debian/control b/debian/control
index 8acd880..27fbee5 100644
--- a/debian/control
+++ b/debian/control
@@ -23,6 +23,7 @@ XS-Testsuite: autopkgtest
23Package: update-manager-core23Package: update-manager-core
24Architecture: all24Architecture: all
25Section: admin25Section: admin
26<<<<<<< debian/control
26Depends: distro-info-data,27Depends: distro-info-data,
27 python3-distro-info,28 python3-distro-info,
28 python3-update-manager (= ${source:Version}),29 python3-update-manager (= ${source:Version}),
@@ -34,6 +35,20 @@ Recommends: libpam-modules (>= 1.0.1-9ubuntu3),
34Replaces: update-manager (<< 1:0.146.2),35Replaces: update-manager (<< 1:0.146.2),
35Breaks: computer-janitor (<= 1.11-0ubuntu1),36Breaks: computer-janitor (<= 1.11-0ubuntu1),
36 update-manager (<< 1:0.146.2),37 update-manager (<< 1:0.146.2),
38=======
39Depends: ${python3:Depends},
40 ${misc:Depends},
41 python3-update-manager (= ${source:Version}),
42 python3-distro-info,
43 distro-info-data,
44 lsb-release,
45 ubuntu-release-upgrader-core (>= 1:18.04.9),
46 ubuntu-advantage-tools
47Recommends: libpam-modules (>= 1.0.1-9ubuntu3)
48Replaces: update-manager (<< 1:0.146.2)
49Breaks: update-manager (<< 1:0.146.2),
50 computer-janitor (<= 1.11-0ubuntu1)
51>>>>>>> debian/control
37Description: manage release upgrades52Description: manage release upgrades
38 This is the core of update-manager and the release upgrader53 This is the core of update-manager and the release upgrader
3954
@@ -56,6 +71,7 @@ Description: Python 3.x module for update-manager
5671
57Package: update-manager72Package: update-manager
58Architecture: all73Architecture: all
74<<<<<<< debian/control
59Depends: gir1.2-gtk-3.0,75Depends: gir1.2-gtk-3.0,
60 gir1.2-handy-1 (>= 1.5.90),76 gir1.2-handy-1 (>= 1.5.90),
61 gir1.2-snapd-2,77 gir1.2-snapd-2,
@@ -64,17 +80,31 @@ Depends: gir1.2-gtk-3.0,
64 pkexec,80 pkexec,
65 polkitd,81 polkitd,
66 python3-aptdaemon.gtk3widgets (>= 1.1.1+bzr982-0ubuntu13) | synaptic,82 python3-aptdaemon.gtk3widgets (>= 1.1.1+bzr982-0ubuntu13) | synaptic,
83=======
84Depends: ${python3:Depends}, ${misc:Depends},
85 update-manager-core (= ${source:Version}),
86 libgtk3-perl,
87 python3-aptdaemon.gtk3widgets (>= 1.1.1+bzr982-0ubuntu13) | synaptic,
88 policykit-1,
89>>>>>>> debian/control
67 python3-dbus,90 python3-dbus,
68 python3-gi (>= 3.8),91 python3-gi (>= 3.8),
69 python3-yaml,92 python3-yaml,
70 ubuntu-release-upgrader-gtk,93 ubuntu-release-upgrader-gtk,
71 update-manager-core (= ${source:Version}),94 update-manager-core (= ${source:Version}),
72 update-notifier,95 update-notifier,
96<<<<<<< debian/control
73 ${misc:Depends},97 ${misc:Depends},
74 ${python3:Depends},98 ${python3:Depends},
75Breaks: update-notifier (<< 3.177),99Breaks: update-notifier (<< 3.177),
76Recommends: python3-launchpadlib,100Recommends: python3-launchpadlib,
77 software-properties-gtk (>= 0.71.2),101 software-properties-gtk (>= 0.71.2),
102=======
103 gnome-shell | policykit-1-gnome | polkit-kde-agent-1 | lxpolkit | lxqt-policykit | mate-polkit | polkit-1-auth-agent
104Breaks: update-notifier (<< 3.177)
105Recommends: software-properties-gtk (>= 0.71.2),
106 python3-launchpadlib
107>>>>>>> debian/control
78Suggests: gir1.2-dbusmenu-glib-0.4,108Suggests: gir1.2-dbusmenu-glib-0.4,
79 gir1.2-unity-5.0,109 gir1.2-unity-5.0,
80Description: GNOME application that manages apt updates110Description: GNOME application that manages apt updates
diff --git a/debian/tests/control b/debian/tests/control
index 53f3d17..560af6e 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,4 +1,5 @@
1Tests: nose-tests1Tests: nose-tests
2<<<<<<< debian/tests/control
2Depends: apt,3Depends: apt,
3 aptdaemon,4 aptdaemon,
4 pycodestyle,5 pycodestyle,
@@ -7,3 +8,6 @@ Depends: apt,
7 python3-nose,8 python3-nose,
8 xvfb,9 xvfb,
9 @,10 @,
11=======
12Depends: @, apt, aptdaemon, pycodestyle, pyflakes3, python3-mock, python3-nose, xvfb
13>>>>>>> debian/tests/control
diff --git a/tests/test_cache.py b/tests/test_cache.py
index 432de84..f842e43 100644
--- a/tests/test_cache.py
+++ b/tests/test_cache.py
@@ -36,7 +36,12 @@ class TestCache(unittest.TestCase):
3636
37 def tearDown(self):37 def tearDown(self):
38 try:38 try:
39<<<<<<< tests/test_cache.py
39 shutil.rmtree(os.path.join(self.aptroot, "var/cache/apt"))40 shutil.rmtree(os.path.join(self.aptroot, "var/cache/apt"))
41=======
42 shutil.rmtree(os.path.join(self.aptroot,
43 "var/cache/apt"))
44>>>>>>> tests/test_cache.py
40 except OSError:45 except OSError:
41 pass46 pass
4247
diff --git a/tests/test_changelog.py b/tests/test_changelog.py
index 41ced26..728fb29 100644
--- a/tests/test_changelog.py
+++ b/tests/test_changelog.py
@@ -7,6 +7,13 @@ import os
7import sys7import sys
8import unittest8import unittest
9import glob9import glob
10<<<<<<< tests/test_changelog.py
11=======
12try:
13 from urllib.error import HTTPError
14except ImportError:
15 from urllib2 import HTTPError
16>>>>>>> tests/test_changelog.py
1017
11from urllib.error import HTTPError18from urllib.error import HTTPError
12from UpdateManager.Core.MyCache import MyCache19from UpdateManager.Core.MyCache import MyCache
@@ -28,9 +35,14 @@ class TestChangelogs(unittest.TestCase):
2835
29 self.aptroot = os.path.join(CURDIR, "aptroot-changelog")36 self.aptroot = os.path.join(CURDIR, "aptroot-changelog")
3037
38<<<<<<< tests/test_changelog.py
31 self.cache = MyCache(39 self.cache = MyCache(
32 apt.progress.base.OpProgress(), rootdir=self.aptroot40 apt.progress.base.OpProgress(), rootdir=self.aptroot
33 )41 )
42=======
43 self.cache = MyCache(apt.progress.base.OpProgress(),
44 rootdir=self.aptroot)
45>>>>>>> tests/test_changelog.py
34 self.cache.open()46 self.cache.open()
3547
36 def tearDown(self):48 def tearDown(self):
diff --git a/tests/test_meta_release_core.py b/tests/test_meta_release_core.py
index 954a0ba..7d15aa8 100644
--- a/tests/test_meta_release_core.py
+++ b/tests/test_meta_release_core.py
@@ -9,6 +9,14 @@ import os
9import random9import random
10import sys10import sys
11import tempfile11import tempfile
12<<<<<<< tests/test_meta_release_core.py
13=======
14import glob
15try:
16 from test.support import EnvironmentVarGuard
17except ImportError:
18 from test.test_support import EnvironmentVarGuard
19>>>>>>> tests/test_meta_release_core.py
12import time20import time
13import unittest21import unittest
1422
@@ -81,9 +89,15 @@ class TestMetaReleaseCore(unittest.TestCase):
81 self.httpd_process.join()89 self.httpd_process.join()
82 install_opener(None)90 install_opener(None)
8391
92<<<<<<< tests/test_meta_release_core.py
84 bin_list = glob.glob(93 bin_list = glob.glob(
85 os.path.join(CURDIR, "aptroot-changelog/var/cache/apt/*.bin")94 os.path.join(CURDIR, "aptroot-changelog/var/cache/apt/*.bin")
86 )95 )
96=======
97 bin_list = glob.glob(os.path.join(CURDIR,
98 "aptroot-changelog/"
99 "var/cache/apt/*.bin"))
100>>>>>>> tests/test_meta_release_core.py
87 for bin_file in bin_list:101 for bin_file in bin_list:
88 try:102 try:
89 os.remove(bin_file)103 os.remove(bin_file)
@@ -186,7 +200,11 @@ class TestMetaReleaseCore(unittest.TestCase):
186 supported for supported in di.supported() if di.is_lts(supported)200 supported for supported in di.supported() if di.is_lts(supported)
187 ]201 ]
188 with EnvironmentVarGuard() as environ:202 with EnvironmentVarGuard() as environ:
203<<<<<<< tests/test_meta_release_core.py
189 environ["META_RELEASE_FAKE_CODENAME"] = ltses[-2]204 environ["META_RELEASE_FAKE_CODENAME"] = ltses[-2]
205=======
206 environ["META_RELEASE_FAKE_CODENAME"] = "bionic"
207>>>>>>> tests/test_meta_release_core.py
190 meta = MetaReleaseCore(forceDownload=True)208 meta = MetaReleaseCore(forceDownload=True)
191 while meta.downloading:209 while meta.downloading:
192 time.sleep(0.1)210 time.sleep(0.1)
diff --git a/tests/test_update_list.py b/tests/test_update_list.py
index 93dfe66..ebd2b60 100644
--- a/tests/test_update_list.py
+++ b/tests/test_update_list.py
@@ -34,7 +34,12 @@ class PhasedTestCase(unittest.TestCase):
3434
35 def tearDown(self):35 def tearDown(self):
36 try:36 try:
37<<<<<<< tests/test_update_list.py
37 shutil.rmtree(os.path.join(self.aptroot, "var/cache/apt"))38 shutil.rmtree(os.path.join(self.aptroot, "var/cache/apt"))
39=======
40 shutil.rmtree(os.path.join(self.aptroot,
41 "var/cache/apt"))
42>>>>>>> tests/test_update_list.py
38 except OSError:43 except OSError:
39 pass44 pass
4045
@@ -129,8 +134,12 @@ class GroupingTestCase(unittest.TestCase):
129 real_arch = apt.apt_pkg.config.find("APT::Architecture")134 real_arch = apt.apt_pkg.config.find("APT::Architecture")
130 apt.apt_pkg.config.set("APT::Architecture", "amd64")135 apt.apt_pkg.config.set("APT::Architecture", "amd64")
131 self.addCleanup(136 self.addCleanup(
137<<<<<<< tests/test_update_list.py
132 lambda: apt.apt_pkg.config.set("APT::Architecture", real_arch)138 lambda: apt.apt_pkg.config.set("APT::Architecture", real_arch)
133 )139 )
140=======
141 lambda: apt.apt_pkg.config.set("APT::Architecture", real_arch))
142>>>>>>> tests/test_update_list.py
134143
135 def set_versioned_kernel_pkgs(real_versioned_kernel_pkgs):144 def set_versioned_kernel_pkgs(real_versioned_kernel_pkgs):
136 apt.apt_pkg.config.clear("APT::VersionedKernelPackages")145 apt.apt_pkg.config.clear("APT::VersionedKernelPackages")
@@ -141,6 +150,7 @@ class GroupingTestCase(unittest.TestCase):
141 real_versioned_kernel_pkgs = apt.apt_pkg.config.value_list()150 real_versioned_kernel_pkgs = apt.apt_pkg.config.value_list()
142 set_versioned_kernel_pkgs(["linux-.*"])151 set_versioned_kernel_pkgs(["linux-.*"])
143 self.addCleanup(152 self.addCleanup(
153<<<<<<< tests/test_update_list.py
144 lambda: set_versioned_kernel_pkgs(real_versioned_kernel_pkgs)154 lambda: set_versioned_kernel_pkgs(real_versioned_kernel_pkgs)
145 )155 )
146156
@@ -148,11 +158,20 @@ class GroupingTestCase(unittest.TestCase):
148 self.cache = MyCache(158 self.cache = MyCache(
149 apt.progress.base.OpProgress(), rootdir=self.aptroot159 apt.progress.base.OpProgress(), rootdir=self.aptroot
150 )160 )
161=======
162 lambda: set_versioned_kernel_pkgs(real_versioned_kernel_pkgs))
163
164 self.aptroot = os.path.join(CURDIR,
165 "aptroot-grouping-test")
166 self.cache = MyCache(apt.progress.base.OpProgress(),
167 rootdir=self.aptroot)
168>>>>>>> tests/test_update_list.py
151 self.cache.open()169 self.cache.open()
152 self.cache["linux-generic-to-remove"].mark_auto(True)170 self.cache["linux-generic-to-remove"].mark_auto(True)
153 self.cache["linux-headers-to-remove"].mark_auto(True)171 self.cache["linux-headers-to-remove"].mark_auto(True)
154 mock_installed.__get__ = self.fake_installed_files172 mock_installed.__get__ = self.fake_installed_files
155 mock_desktop.side_effect = self.fake_desktop173 mock_desktop.side_effect = self.fake_desktop
174<<<<<<< tests/test_update_list.py
156 self.updates_list = UpdateList.UpdateList(parent=None, dist="lucid")175 self.updates_list = UpdateList.UpdateList(parent=None, dist="lucid")
157 self.updates_list.update(176 self.updates_list.update(
158 self.cache,177 self.cache,
@@ -162,6 +181,17 @@ class GroupingTestCase(unittest.TestCase):
162 def tearDown(self):181 def tearDown(self):
163 try:182 try:
164 shutil.rmtree(os.path.join(self.aptroot, "var/cache/apt"))183 shutil.rmtree(os.path.join(self.aptroot, "var/cache/apt"))
184=======
185 self.updates_list = UpdateList.UpdateList(parent=None, dist='lucid')
186 self.updates_list.update(self.cache,
187 duplicate_packages=["linux-generic-dup1",
188 "linux-generic-dup2"])
189
190 def tearDown(self):
191 try:
192 shutil.rmtree(os.path.join(self.aptroot,
193 "var/cache/apt"))
194>>>>>>> tests/test_update_list.py
165 except OSError:195 except OSError:
166 pass196 pass
167197
@@ -219,22 +249,35 @@ class GroupingTestCase(unittest.TestCase):
219 group = self.updates_list.update_groups[3]249 group = self.updates_list.update_groups[3]
220 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)250 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)
221 self.assertIsNotNone(group.core_item)251 self.assertIsNotNone(group.core_item)
252<<<<<<< tests/test_update_list.py
222 self.assertEqual(group.core_item.pkg.name, "linux-show-player")253 self.assertEqual(group.core_item.pkg.name, "linux-show-player")
223 self.assertListEqual(254 self.assertListEqual(
224 [x.pkg.name for x in group.items], ["linux-show-player"]255 [x.pkg.name for x in group.items], ["linux-show-player"]
225 )256 )
257=======
258 self.assertEqual(group.core_item.pkg.name, 'linux-show-player')
259 self.assertListEqual([x.pkg.name for x in group.items],
260 ['linux-show-player'])
261>>>>>>> tests/test_update_list.py
226262
227 def test_pkg_multiple_deps(self):263 def test_pkg_multiple_deps(self):
228 self.assertGreater(len(self.updates_list.update_groups), 4)264 self.assertGreater(len(self.updates_list.update_groups), 4)
229 group = self.updates_list.update_groups[4]265 group = self.updates_list.update_groups[4]
230 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)266 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)
231 self.assertIsNotNone(group.core_item)267 self.assertIsNotNone(group.core_item)
268<<<<<<< tests/test_update_list.py
232 self.assertEqual(269 self.assertEqual(
233 group.core_item.pkg.name, "installed-pkg-multiple-deps"270 group.core_item.pkg.name, "installed-pkg-multiple-deps"
234 )271 )
235 self.assertListEqual(272 self.assertListEqual(
236 [x.pkg.name for x in group.items], ["installed-pkg-multiple-deps"]273 [x.pkg.name for x in group.items], ["installed-pkg-multiple-deps"]
237 )274 )
275=======
276 self.assertEqual(group.core_item.pkg.name,
277 'installed-pkg-multiple-deps')
278 self.assertListEqual([x.pkg.name for x in group.items],
279 ['installed-pkg-multiple-deps'])
280>>>>>>> tests/test_update_list.py
238281
239 def test_security(self):282 def test_security(self):
240 self.assertEqual(len(self.updates_list.security_groups), 1)283 self.assertEqual(len(self.updates_list.security_groups), 1)
@@ -291,6 +334,49 @@ class GroupingTestCase(unittest.TestCase):
291 [x.pkg.name for x in group.items], ["linux-generic-dup2"]334 [x.pkg.name for x in group.items], ["linux-generic-dup2"]
292 )335 )
293336
337 def test_base_grouping(self):
338 self.assertEqual(len(self.updates_list.update_groups), 6)
339 group = self.updates_list.update_groups[5]
340 self.assertIsInstance(group, UpdateList.UpdateSystemGroup)
341 self.assertIsNone(group.core_item)
342 self.assertListEqual([x.pkg.name for x in group.items],
343 ['ubuntu-minimal',
344 'linux-test-hwe'])
345
346 def test_autoremove_grouping(self):
347 # test that packages staged for removal aren't grouped if they are
348 # kernel autoremove packages (LP: #1912718)
349 self.assertGreater(len(self.updates_list.kernel_autoremove_groups), 0)
350 group = self.updates_list.kernel_autoremove_groups[0]
351 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)
352 self.assertIsNotNone(group.core_item)
353 self.assertListEqual([x.pkg.name for x in group.items],
354 ['linux-generic-to-remove'])
355
356 self.assertEqual(len(self.updates_list.kernel_autoremove_groups), 2)
357 group = self.updates_list.kernel_autoremove_groups[1]
358 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)
359 self.assertIsNotNone(group.core_item)
360 self.assertListEqual([x.pkg.name for x in group.items],
361 ['linux-headers-to-remove'])
362
363 def test_duplicate_grouping(self):
364 # test that packages staged for removal aren't grouped if they are
365 # duplicate packages (LP: #1912718)
366 self.assertGreater(len(self.updates_list.duplicate_groups), 0)
367 group = self.updates_list.duplicate_groups[0]
368 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)
369 self.assertIsNotNone(group.core_item)
370 self.assertListEqual([x.pkg.name for x in group.items],
371 ['linux-generic-dup1'])
372
373 self.assertEqual(len(self.updates_list.duplicate_groups), 2)
374 group = self.updates_list.duplicate_groups[1]
375 self.assertIsInstance(group, UpdateList.UpdatePackageGroup)
376 self.assertIsNotNone(group.core_item)
377 self.assertListEqual([x.pkg.name for x in group.items],
378 ['linux-generic-dup2'])
379
294380
295if __name__ == "__main__":381if __name__ == "__main__":
296 unittest.main()382 unittest.main()

Subscribers

People subscribed via source and target branches