Skip to content

Commit

Permalink
Merge pull request #529 from cpanel/RE-812
Browse files Browse the repository at this point in the history
Ensure the epel.repo file is "clean"
  • Loading branch information
toddr authored Oct 24, 2024
2 parents 9be5f1c + c538ea1 commit 3c626d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions elevate-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -5138,6 +5138,7 @@ EOS

$self->run_once("_disable_yum_plugin_fastestmirror");
$self->run_once("_disable_known_yum_repositories");
$self->run_once("_fixup_epel_repo");

return;
}
Expand Down Expand Up @@ -5167,6 +5168,20 @@ EOS
return;
}

sub _fixup_epel_repo ($self) {

my $repo_file = Elevate::Constants::YUM_REPOS_D . '/epel.repo';

if ( -e $repo_file ) {
unlink($repo_file) or ERROR("Could not delete $repo_file: $!");
}

my $err = $self->ssystem(qw{/usr/bin/rpm -Uv --force https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm});
ERROR("Error installing epel-release: $err") if $err;

return;
}

sub _erase_package ( $self, $pkg ) {
return unless Cpanel::Pkgr::is_installed($pkg);
$self->rpm->remove_no_dependencies($pkg);
Expand Down
15 changes: 15 additions & 0 deletions lib/Elevate/Components/Repositories.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ sub pre_distro_upgrade ($self) {

$self->run_once("_disable_yum_plugin_fastestmirror");
$self->run_once("_disable_known_yum_repositories");
$self->run_once("_fixup_epel_repo");

return;
}
Expand Down Expand Up @@ -91,6 +92,20 @@ sub _disable_yum_plugin_fastestmirror ($self) {
return;
}

sub _fixup_epel_repo ($self) {

my $repo_file = Elevate::Constants::YUM_REPOS_D . '/epel.repo';

if ( -e $repo_file ) {
unlink($repo_file) or ERROR("Could not delete $repo_file: $!");
}

my $err = $self->ssystem(qw{/usr/bin/rpm -Uv --force https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm});
ERROR("Error installing epel-release: $err") if $err;

return;
}

sub _erase_package ( $self, $pkg ) {
return unless Cpanel::Pkgr::is_installed($pkg);
$self->rpm->remove_no_dependencies($pkg);
Expand Down

0 comments on commit 3c626d1

Please sign in to comment.