Skip to content

Commit

Permalink
Merge pull request #61 from mhjacks/add_dnf5
Browse files Browse the repository at this point in the history
Bump version and add support for dnf5 for fedora 41
  • Loading branch information
matteocorti authored Oct 14, 2024
2 parents e0176d8 + cc75780 commit 90eda01
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions check_updates
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use warnings;

no warnings 'once'; ## no critic (TestingAndDebugging::ProhibitNoWarnings)

our $VERSION = '2.0.5';
our $VERSION = '2.0.6';

use Carp;
use English qw(-no_match_vars);
Expand Down Expand Up @@ -57,6 +57,7 @@ use vars qw(
$threshold
$wrong_kernel
$yum_executable
$errorlevel
@status_lines
);
## use critic
Expand Down Expand Up @@ -546,11 +547,17 @@ sub run_yum {
$assume = 'assumeno';
}

if ( (-l $yum_executable) and (readlink($yum_executable) =~ /dnf5/) ) {
$errorlevel='';
} else {
$errorlevel = '--errorlevel=0';
}

# per default check updates
# --assumeno to avoid a timeout when the GPG key is not present
# we need to process STDERR to catch errors (e.g., missing GPG key)
if ( !defined $yum_command ) {
$yum_command = "check-update --$assume --errorlevel=0 -q";
$yum_command = "check-update --$assume $errorlevel -q";
}

my $OUTPUT_HANDLER;
Expand Down

0 comments on commit 90eda01

Please sign in to comment.