Skip to content

Commit

Permalink
Add Oracle Linux, a Redhat derivative
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed May 20, 2024
1 parent 13c0289 commit c48d8a0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ lib/Devel/AssertOS/Linux/Rocky.pm
lib/Devel/AssertOS/Linux/PopOS.pm
lib/Devel/AssertOS/Linux/Slackware.pm
lib/Devel/AssertOS/Linux/Gentoo.pm
lib/Devel/AssertOS/Linux/Oracle.pm
35 changes: 35 additions & 0 deletions lib/Devel/AssertOS/Linux/Oracle.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package Devel::AssertOS::Linux::Oracle;

use Devel::CheckOS;
use strict;
use warnings;

use Devel::CheckOS::Helpers::LinuxOSrelease 'distributor_id';

no warnings 'redefine';

our $VERSION = '1.0';

sub os_is {
my $id = distributor_id;

Devel::CheckOS::os_is('Linux') &&
defined($id) &&
$id eq 'ol';
}

sub expn { "The operating system is Oracle Linux" }

Devel::CheckOS::die_unsupported() unless ( os_is() );

=head1 COPYRIGHT and LICENCE
Copyright 2024 David Cantrell
This software is free-as-in-speech software, and may be used, distributed, and modified under the terms of either the GNU General Public Licence version 2 or the Artistic Licence. It's up to you which one you use. The full text of the licences can be found in the files GPL2.txt and ARTISTIC.txt, respectively.
=cut

1;


2 changes: 1 addition & 1 deletion lib/Devel/AssertOS/Linux/Redhat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ no warnings 'redefine';

our $VERSION = '1.0';

sub matches { map { "Linux::$_" } qw(Centos Fedora Alma Rocky RHEL) }
sub matches { map { "Linux::$_" } qw(Centos Fedora Alma Rocky RHEL Oracle) }

sub os_is { Devel::CheckOS::os_is(matches()) }

Expand Down
2 changes: 1 addition & 1 deletion t/redhat.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Devel::CheckOS::Helpers::LinuxOSrelease 'distributor_id';

local $^O = 'linux';

my @candidates = qw(RHEL Fedora Centos Alma Rocky);
my @candidates = qw(RHEL Fedora Centos Alma Rocky Oracle);

foreach my $candidate (@candidates) {
Devel::CheckOS::Helpers::LinuxOSrelease::_set_file('t/etc-os-release/'.lc($candidate));
Expand Down

0 comments on commit c48d8a0

Please sign in to comment.