#4 Backport AlmaLinux and RockyLinux support
Merged a month ago by carlwgeorge. Opened 3 months ago by dherrera.
rpms/ dherrera/nagios-plugins-check-updates epel8  into  epel8

@@ -0,0 +1,75 @@ 

+ diff --git a/check_updates b/check_updates

+ index e0185a5..ce1c67c 100644

+ --- a/check_updates

+ +++ b/check_updates

+ @@ -1005,6 +1005,8 @@ sub get_updater {

+          || $name =~ /CloudLinux/mxs

+          || $name =~ /Scientific[ ]Linux/mxs

+          || $name =~ /Red[ ]Hat.*release[ ][56789]/mxs

+ +        || $name =~ /Rocky[ ]Linux/mxs

+ +        || $name =~ /AlmaLinux/mxs

+          || $name =~ /Oracle/mxs

+          || $name =~ /Amazon/mxs

+          || $name =~ /Sangoma/mxs )

+ diff --git a/t/01_functions.t b/t/01_functions.t

+ index 6ba4c16..a29962b 100644

+ --- a/t/01_functions.t

+ +++ b/t/01_functions.t

+ @@ -5,7 +5,7 @@ use 5.00800;

+  use strict;

+  use warnings;

+  

+ -use Test::More tests => 38;

+ +use Test::More tests => 42;

+  

+  use File::Spec;

+  

+ @@ -64,6 +64,16 @@ is(

+      'PUIAS Linux  release 6.2 (Pisa)',

+      '/etc/system-release PUIAS Linux 6.2'

+  );

+ +is(

+ +    get_os_name_and_version('t/examples/rocky_linux_8'),

+ +    'Rocky Linux release 8.4 (Green Obsidian)',

+ +    '/etc/system-release Rocky Linux 8.4'

+ +);

+ +is(

+ +    get_os_name_and_version('t/examples/almalinux_8'),

+ +    'AlmaLinux 8.4 (Electric Cheetah)',

+ +    '/etc/system-release AlmaLinux 8.4'

+ +);

+  

+  is( get_updater('Fedora release 14 (Laughlin)'), 'yum', 'updater Fedora' );

+  is( get_updater('Fedora release 15 (Lovelock)'), 'yum', 'updater Fedora' );

+ @@ -73,6 +83,10 @@ is( get_updater('Scientific Linux release 6.0 (Carbon)'),

+      'yum', 'updater Scientific Linux' );

+  is( get_updater('Red Hat Enterprise Linux AS release 4 (Nahant Update 9)'),

+      'up2date', 'updater RHEL 4' );

+ +is( get_updater('Rocky Linux release 8.4 (Green Obsidian)'),

+ +    'yum', 'updater Rocky Linux' );

+ +is( get_updater('AlmaLinux 8.4 (Electric Cheetah)'),

+ +    'yum', 'updater AlmaLinux' );

+  

+  # versioncmp

+  

+ @@ -124,4 +138,3 @@ test_versioncmp( '1.1.6', '1.1.5', 1 );

+  ## use critic (ProhibitMagicNumbers)

+  

+  1;

+ -

+ diff --git a/t/examples/almalinux_8 b/t/examples/almalinux_8

+ new file mode 100644

+ index 0000000..9aab017

+ --- /dev/null

+ +++ b/t/examples/almalinux_8

+ @@ -0,0 +1 @@

+ +AlmaLinux 8.4 (Electric Cheetah)

+ \ No newline at end of file

+ diff --git a/t/examples/rocky_linux_8 b/t/examples/rocky_linux_8

+ new file mode 100644

+ index 0000000..e79c566

+ --- /dev/null

+ +++ b/t/examples/rocky_linux_8

+ @@ -0,0 +1 @@

+ +Rocky Linux release 8.4 (Green Obsidian)

+ \ No newline at end of file

@@ -6,13 +6,16 @@ 

  

  Name:          nagios-plugins-check-updates

  Version:       1.7.10

- Release:       1%{?dist}

+ Release:       2%{?dist}

  Summary:       A Nagios plugin to check if Red Hat or Fedora system is up-to-date

  

  License:       GPLv3+

  URL:           https://github.com/matteocorti/check_updates

  Source:        https://github.com/matteocorti/check_updates/releases/download/v%{version}/check_updates-%{version}.tar.gz

  

+ # Backported from v1.8.5

+ Patch0:        nagios-plugins-check-updates-1.7.10-backport_distro_support.patch

+ 

  

  BuildRequires: perl-generators

  BuildRequires: perl(ExtUtils::MakeMaker)
@@ -44,6 +47,7 @@ 

  

  %prep

  %setup -q -n %{plugin}-%{version}

+ %patch0 -p1 -b .backport_distro_support

  

  %build

  %{__perl} Makefile.PL INSTALLDIRS=vendor \
@@ -70,6 +74,9 @@ 

  

  

  %changelog

+ * Fri Jul 29 2022 Diego Herrera <dherrera@redhat.com> - 1.7.10-2

+ - Backported support for AlmaLinux and RockyLinux

+ 

  * Fri May 08 2020 Martin Jackson <mhjacks@swbell.net> - 1.7.10-1

  - new version

  

Backported changes from v1.8.5 to add support for other distros to EPEL

Fixes bug 1941074

Pull-Request has been merged by carlwgeorge

a month ago