diff -Nru update-manager-20.04.10.2/debian/changelog update-manager-20.04.10.3/debian/changelog --- update-manager-20.04.10.2/debian/changelog 2020-12-14 11:24:18.000000000 +0000 +++ update-manager-20.04.10.3/debian/changelog 2021-01-13 16:35:58.000000000 +0000 @@ -1,3 +1,15 @@ +update-manager (1:20.04.10.3) focal; urgency=medium + + [ Julian Andres Klode ] + * UpdateManager/backend/__init__.py: Fix unbound local variables regression + introduced by the previous SRU (See LP 1910556), and correct comment + + [ William Wilson ] + * UpdateManager/Core/UpdateList.py: change to a regex from a static list + of packages to be grouped under Ubuntu Base (LP: #1902025) + + -- Brian Murray Wed, 13 Jan 2021 08:35:58 -0800 + update-manager (1:20.04.10.2) focal; urgency=medium [ Iain Lane & Julian Andres Klode ] diff -Nru update-manager-20.04.10.2/tests/aptroot-grouping-test/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-amd64_Packages update-manager-20.04.10.3/tests/aptroot-grouping-test/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-amd64_Packages --- update-manager-20.04.10.2/tests/aptroot-grouping-test/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-amd64_Packages 2020-12-14 11:24:18.000000000 +0000 +++ update-manager-20.04.10.3/tests/aptroot-grouping-test/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_lucid_main_binary-amd64_Packages 2021-01-13 16:34:26.000000000 +0000 @@ -78,3 +78,27 @@ Recommends: base-pkg Description: meta package Origin: Ubuntu + +Package: linux-test-hwe +Priority: optional +Section: admin +Installed-Size: 1 +Maintainer: Foo +Architecture: all +Version: 1 +Size: 1 +Recommends: base-pkg +Description: positive test for linux package names +Origin: Ubuntu + +Package: linux-show-player +Priority: optional +Section: admin +Installed-Size: 1 +Maintainer: Foo +Architecture: all +Version: 1 +Size: 1 +Recommends: base-pkg +Description: negative test for linux package names +Origin: Ubuntu diff -Nru update-manager-20.04.10.2/tests/aptroot-grouping-test/var/lib/dpkg/status update-manager-20.04.10.3/tests/aptroot-grouping-test/var/lib/dpkg/status --- update-manager-20.04.10.2/tests/aptroot-grouping-test/var/lib/dpkg/status 2020-12-14 11:24:18.000000000 +0000 +++ update-manager-20.04.10.3/tests/aptroot-grouping-test/var/lib/dpkg/status 2021-01-13 16:34:26.000000000 +0000 @@ -80,3 +80,33 @@ Architecture: all Version: 0.1 Description: an installed package that only one app depends on + +Package: ubuntu-minimal +Status: install ok installed +Priority: optional +Section: admin +Installed-Size: 1 +Maintainer: Ubuntu Developers +Architecture: all +Version: 0.1 +Description: meta package + +Package: linux-test-hwe +Status: install ok installed +Priority: optional +Section: admin +Installed-Size: 1 +Maintainer: Ubuntu Developers +Architecture: all +Version: 0.1 +Description: positive test for linux package names + +Package: linux-show-player +Status: install ok installed +Priority: optional +Section: admin +Installed-Size: 1 +Maintainer: Ubuntu Developers +Architecture: all +Version: 0.1 +Description: negative test for linux package names diff -Nru update-manager-20.04.10.2/tests/test_update_list.py update-manager-20.04.10.3/tests/test_update_list.py --- update-manager-20.04.10.2/tests/test_update_list.py 2020-12-14 11:24:18.000000000 +0000 +++ update-manager-20.04.10.3/tests/test_update_list.py 2021-01-13 16:34:26.000000000 +0000 @@ -166,11 +166,20 @@ self.assertListEqual([x.pkg.name for x in group.items], ['installed-pkg']) - def test_pkg_multiple_deps(self): - self.assertEqual(len(self.updates_list.update_groups), 4) + def test_negative_regex_match(self): + self.assertGreater(len(self.updates_list.update_groups), 3) group = self.updates_list.update_groups[3] self.assertIsInstance(group, UpdateList.UpdatePackageGroup) self.assertIsNotNone(group.core_item) + self.assertEqual(group.core_item.pkg.name, 'linux-show-player') + self.assertListEqual([x.pkg.name for x in group.items], + ['linux-show-player']) + + def test_pkg_multiple_deps(self): + self.assertGreater(len(self.updates_list.update_groups), 4) + group = self.updates_list.update_groups[4] + self.assertIsInstance(group, UpdateList.UpdatePackageGroup) + self.assertIsNotNone(group.core_item) self.assertEqual(group.core_item.pkg.name, 'installed-pkg-multiple-deps') self.assertListEqual([x.pkg.name for x in group.items], @@ -183,6 +192,15 @@ self.assertIsNone(group.core_item) self.assertListEqual([x.pkg.name for x in group.items], ['base-pkg']) + def test_base_grouping(self): + self.assertEqual(len(self.updates_list.update_groups), 6) + group = self.updates_list.update_groups[5] + self.assertIsInstance(group, UpdateList.UpdateSystemGroup) + self.assertIsNone(group.core_item) + self.assertListEqual([x.pkg.name for x in group.items], + ['ubuntu-minimal', + 'linux-test-hwe']) + if __name__ == "__main__": unittest.main() diff -Nru update-manager-20.04.10.2/UpdateManager/backend/__init__.py update-manager-20.04.10.3/UpdateManager/backend/__init__.py --- update-manager-20.04.10.2/UpdateManager/backend/__init__.py 2020-12-14 11:24:18.000000000 +0000 +++ update-manager-20.04.10.3/UpdateManager/backend/__init__.py 2021-01-11 09:59:13.000000000 +0000 @@ -43,12 +43,10 @@ if self.action == self.ACTION_PRE_INSTALL: unfresh_cache = self.window_main.cache fresh_cache = Cache(rootdir=self.window_main.cache.rootdir) - # Install OEM packages, update, figure out the kernel, then do - # ACTION_INSTALL + # Install OEM packages, update, then do ACTION_INSTALL + pkgs_install_oem = [] + pkgs_upgrade_oem = [] for pkg in self.window_main.oem_metapackages: - pkgs_install_oem = [] - pkgs_upgrade_oem = [] - unfresh_pkg = unfresh_cache[pkg] fresh_pkg = fresh_cache[pkg] diff -Nru update-manager-20.04.10.2/UpdateManager/Core/UpdateList.py update-manager-20.04.10.3/UpdateManager/Core/UpdateList.py --- update-manager-20.04.10.2/UpdateManager/Core/UpdateList.py 2020-12-14 11:24:18.000000000 +0000 +++ update-manager-20.04.10.3/UpdateManager/Core/UpdateList.py 2021-01-13 16:34:26.000000000 +0000 @@ -36,6 +36,7 @@ import os import random import glob +import re from gi.repository import Gio @@ -384,43 +385,6 @@ return True return False - def _get_linux_packages(self): - "Return all binary packages made by the linux-meta source package" - # Hard code this rather than generate from source info in cache because - # that might only be available if we have deb-src lines. I think we - # could also generate it by iterating over all the binary package info - # we have, but that is costly. These don't change often. - return ['linux', - 'linux-cloud-tools-generic', - 'linux-cloud-tools-lowlatency', - 'linux-cloud-tools-virtual', - 'linux-crashdump', - 'linux-generic', - 'linux-generic-lpae', - 'linux-headers-generic', - 'linux-headers-generic-lpae', - 'linux-headers-lowlatency', - 'linux-headers-lowlatency-lpae', - 'linux-headers-server', - 'linux-headers-virtual', - 'linux-image', - 'linux-image-extra-virtual', - 'linux-image-generic', - 'linux-image-generic-lpae', - 'linux-image-lowlatency', - 'linux-image-virtual', - 'linux-lowlatency', - 'linux-signed-generic', - 'linux-signed-image-generic', - 'linux-signed-image-lowlatency', - 'linux-signed-lowlatency', - 'linux-source', - 'linux-tools-generic', - 'linux-tools-generic-lpae', - 'linux-tools-lowlatency', - 'linux-tools-virtual', - 'linux-virtual'] - def _make_groups(self, cache, pkgs, eventloop_callback, to_remove=False): if not pkgs: return [] @@ -452,10 +416,30 @@ if ungrouped_pkgs: # Separate out system base packages. If we have already found an # application for all updates, don't bother. + linux_names = ("linux$", + "linux-.*-buildinfo.*", + "linux-.*-dev.*", + "linux-.*-generic.*", + "linux-.*-headers.*", + "linux-.*-hwe.*", + "linux-.*-gcp.*", + "linux-.*-kernel.*", + "linux-.*-lowlatency.*", + "linux-.*-modules.*", + "linux-.*-raspi.*", + "linux-.*-tools.*", + "linux-.*-virtual.*", + "linux-base.*", + "linux-crashdump.*", + "linux-doc.*") + linux_regexp = re.compile("(" + "|".join( + ["^" + n for n in linux_names]) + ")") meta_group = UpdateGroup(None, None, None, to_remove) flavor_package = utils.get_ubuntu_flavor_package(cache=cache) meta_pkgs = [flavor_package, "ubuntu-standard", "ubuntu-minimal"] - meta_pkgs.extend(self._get_linux_packages()) + for pkg in cache: + if linux_regexp.match(pkg.name): + meta_pkgs.append(pkg) for pkg in meta_pkgs: if pkg in cache: meta_group.add(cache[pkg])