Skip to content

Commit

Permalink
Add detection for Arch Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed May 19, 2024
1 parent 71d2a25 commit 40e33f6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arch-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
export PERL5OPT=-Mlocal::lib
/usr/bin/site_perl/cpanm --installdeps .
ls -ld /run/systemd/system || true
perl makefile-expect-driver.pl Linux Unix OSFeatures::POSIXShellRedirection HWCapabilities::Int64
perl makefile-expect-driver.pl Linux Unix OSFeatures::POSIXShellRedirection HWCapabilities::Int64 Linux::Arch
make test
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ t/etc-os-release/pop
t/etc-os-release/ubuntu
t/etc-os-release/alma
t/etc-os-release/centos
t/etc-os-release/centos-stream
t/etc-os-release/opensuse-leap
t/etc-os-release/oracle
t/etc-os-release/rhel
Expand All @@ -158,3 +157,4 @@ lib/Devel/AssertOS/Linux/Fedora.pm
lib/Devel/AssertOS/Linux/RHEL.pm
lib/Devel/AssertOS/Linux/Redhat.pm
t/redhat.t
lib/Devel/AssertOS/Linux/Arch.pm
31 changes: 31 additions & 0 deletions lib/Devel/AssertOS/Linux/Arch.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package Devel::AssertOS::Linux::Arch;

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 'arch';
}

sub expn { "The operating system is some version of Arch 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;

0 comments on commit 40e33f6

Please sign in to comment.