From 10d914f5bb96fa3d2f1ee2a485c07071a1ab2126 Mon Sep 17 00:00:00 2001 From: Travis Holloway Date: Thu, 14 Nov 2024 16:53:47 -0600 Subject: [PATCH] Add 'sys-snap' to the list of packages that PackageRestore handles Case RE-952: This adds 'sys-snap' to the list of packages that the PackageRestore component handles. It also now explicitely removes the packages as it was previously relying on leapp to implicitely remove them. Changelog: Add 'sys-snap' to the list of packages that the PackageRestore component handles --- elevate-cpanel | 3 +++ lib/Elevate/Components/PackageRestore.pm | 3 +++ t/components-PackageRestore.t | 1 + 3 files changed, 7 insertions(+) diff --git a/elevate-cpanel b/elevate-cpanel index db38b62e..7f2d297b 100755 --- a/elevate-cpanel +++ b/elevate-cpanel @@ -4354,6 +4354,7 @@ EOS sub _get_packages_to_check () { return qw{ net-snmp + sys-snap }; } @@ -4368,6 +4369,8 @@ EOS } } + Elevate::PkgMgr::remove(@installed_packages); + my $config_files = Elevate::PkgMgr::get_config_files( \@installed_packages ); Elevate::StageFile::update_stage_file( diff --git a/lib/Elevate/Components/PackageRestore.pm b/lib/Elevate/Components/PackageRestore.pm index 6aaa72a1..c0761b21 100644 --- a/lib/Elevate/Components/PackageRestore.pm +++ b/lib/Elevate/Components/PackageRestore.pm @@ -35,6 +35,7 @@ use parent qw{Elevate::Components::Base}; sub _get_packages_to_check () { return qw{ net-snmp + sys-snap }; } @@ -49,6 +50,8 @@ sub pre_distro_upgrade ($self) { } } + Elevate::PkgMgr::remove(@installed_packages); + my $config_files = Elevate::PkgMgr::get_config_files( \@installed_packages ); Elevate::StageFile::update_stage_file( diff --git a/t/components-PackageRestore.t b/t/components-PackageRestore.t index 4fdf22ba..a41772c6 100644 --- a/t/components-PackageRestore.t +++ b/t/components-PackageRestore.t @@ -55,6 +55,7 @@ my $pkg_restore = cpev->new->get_component('PackageRestore'); $pkgs_checked_for_config_files = $_[1]; return \%config_files; }, + remove => 1, ); my $mock_upsf = Test::MockModule->new('Elevate::StageFile');