Skip to content

Commit

Permalink
Merge pull request #553 from cpanel/RE-964
Browse files Browse the repository at this point in the history
Avoid Perl error in 'Elevate::Components::Repositories'
  • Loading branch information
cPholloway authored Nov 18, 2024
2 parents e9f87eb + 8796189 commit a8ede6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion elevate-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -5588,7 +5588,7 @@ EOS
$self->{_yum_repos_path_using_invalid_syntax} = [];
$self->{_yum_repos_to_disable} = [];
$self->{_yum_repos_unsupported_with_packages} = [];
$self->{_duplicate_repoids} = [];
$self->{_duplicate_repoids} = {};

my @vetted_repos = Elevate::OS::vetted_yum_repo();

Expand Down Expand Up @@ -5716,6 +5716,7 @@ EOS
}

sub _autofix_duplicate_repoids ($self) {
return unless ref $self->{_duplicate_repoids} && ref $self->{_duplicate_repoids} eq 'HASH';
my %duplicate_ids = $self->{_duplicate_repoids}->%*;
foreach my $id ( keys %duplicate_ids ) {
if ( $id =~ m/^MariaDB[0-9]+/ ) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Elevate/Components/Repositories.pm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ sub _check_yum_repos ($self) {
$self->{_yum_repos_path_using_invalid_syntax} = [];
$self->{_yum_repos_to_disable} = [];
$self->{_yum_repos_unsupported_with_packages} = [];
$self->{_duplicate_repoids} = [];
$self->{_duplicate_repoids} = {};

my @vetted_repos = Elevate::OS::vetted_yum_repo();

Expand Down Expand Up @@ -458,6 +458,7 @@ sub _check_yum_repos ($self) {
}

sub _autofix_duplicate_repoids ($self) {
return unless ref $self->{_duplicate_repoids} && ref $self->{_duplicate_repoids} eq 'HASH';
my %duplicate_ids = $self->{_duplicate_repoids}->%*;
foreach my $id ( keys %duplicate_ids ) {
if ( $id =~ m/^MariaDB[0-9]+/ ) {
Expand Down

0 comments on commit a8ede6c

Please sign in to comment.