Skip to content

Commit

Permalink
Merge pull request #440 from cPholloway/RE-132
Browse files Browse the repository at this point in the history
Have pre_leapp component remove packages that leapp will remove
  • Loading branch information
toddr authored May 23, 2024
2 parents 1bf6405 + 1ffb7f0 commit 3656137
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
19 changes: 19 additions & 0 deletions elevate-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -4964,6 +4964,17 @@ EOS
our @ISA;
BEGIN { push @ISA, qw(Elevate::Components::Base); }

use constant OBSOLETE_PACKAGES => (
'compat-db',
'gd-progs',
'python-tools',
'python2-dnf',
'python2-libcomps',
'tcp_wrappers-devel',
'tkinter',
'yum-plugin-universal-hooks',
);

sub pre_leapp ($self) {

$self->run_once("_cleanup_rpms");
Expand All @@ -4975,6 +4986,14 @@ EOS

$self->rpm->remove_cpanel_arch_rpms();

$self->_remove_obsolete_packages();

return;
}

sub _remove_obsolete_packages ($self) {
my @pkgs_to_remove = OBSOLETE_PACKAGES();
$self->yum->remove(@pkgs_to_remove);
return;
}

Expand Down
23 changes: 23 additions & 0 deletions lib/Elevate/Components/RpmDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ use Cpanel::Yum::Vars ();

use parent qw{Elevate::Components::Base};

use constant OBSOLETE_PACKAGES => (
'compat-db',
'gd-progs',
'python-tools',
'python2-dnf',
'python2-libcomps',
'tcp_wrappers-devel',
'tkinter',
'yum-plugin-universal-hooks',
);

sub pre_leapp ($self) {

$self->run_once("_cleanup_rpms");
Expand All @@ -36,6 +47,18 @@ sub _cleanup_rpms ($self) {
# potential to remove other things, but the goal here to remove cpanel packages provided by rpm.versions
$self->rpm->remove_cpanel_arch_rpms();

# These packages are not available on 8 variants and will be removed by
# leapp if we do not remove them manually. Not necessarily a bug per se,
# but it is better if we go ahead and handle removing these packages before
# starting leapp
$self->_remove_obsolete_packages();

return;
}

sub _remove_obsolete_packages ($self) {
my @pkgs_to_remove = OBSOLETE_PACKAGES();
$self->yum->remove(@pkgs_to_remove);
return;
}

Expand Down

0 comments on commit 3656137

Please sign in to comment.