[liblinux-distribution-perl] 24/34: Added detection for Oracle Enterprise Linux

gregor herrmann gregoa at debian.org
Thu Jun 4 21:35:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to annotated tag v0.22
in repository liblinux-distribution-perl.

commit ca2293aaf3715822d2b6256ac77e71f14f4f8ffa
Author: Mike <michiel.beijen at gmail.com>
Date:   Wed Dec 14 21:34:31 2011 +0100

    Added detection for Oracle Enterprise Linux
---
 Changes                   |  1 +
 README                    |  4 ++--
 lib/Linux/Distribution.pm |  8 +++++---
 t/oel6.t                  | 14 ++++++++++++++
 t/oel6/enterprise-release |  1 +
 t/oel6/files              |  6 ++++++
 t/oel6/redhat-release     |  1 +
 7 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/Changes b/Changes
index 7d3c664..111d024 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 * 2011-??-?? version 0.21
 
+Added OS and version detection for Oracle Enterprise Linux
 Fixed version detection for Fedora (reported by tlhackqueATyahoo.com, RT#69671)
 Fixed OS and version detection for CentOS6 (RT#69847)
 Added version detection for Scientific Linux
diff --git a/README b/README
index 326f4b4..62d4d15 100644
--- a/README
+++ b/README
@@ -7,9 +7,9 @@ rect and adds ubuntu support.  Secondly, it will look for the distro specific fi
 
 It currently recognizes slackware, debian, suse, fedora, redhat, turbolinux, yellowdog, knoppix,
 mandrake, conectiva, immunix, tinysofa, va-linux, trustix, adamantix, yoper, arch-linux, libranet,
-gentoo, ubuntu, scientific, and redflag.
+gentoo, ubuntu, scientific, oracle enterprise linux, and redflag.
 
-It has function to get the version for debian, suse, fedora, redhat, gentoo, slackware, scientific, redflag and
+It has function to get the version for debian, suse, fedora, redhat, gentoo, slackware, scientific, oracle enterprise linux, redflag and
 ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-)
 
 INSTALLATION
diff --git a/lib/Linux/Distribution.pm b/lib/Linux/Distribution.pm
index f747168..fc55397 100644
--- a/lib/Linux/Distribution.pm
+++ b/lib/Linux/Distribution.pm
@@ -19,6 +19,7 @@ our %release_files = (
     'gentoo-release'        => 'gentoo',
     'fedora-release'        => 'fedora',
     'centos-release'        => 'centos',
+    'enterprise-release'    => 'oracle enterprise linux',
     'turbolinux-release'    => 'turbolinux',
     'mandrake-release'      => 'mandrake',
     'mandrakelinux-release' => 'mandrakelinux',
@@ -51,6 +52,7 @@ our %version_match = (
     'fedora'                => 'Fedora(?: Core)? release (\d+) \(',
     'redflag'               => 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)',
     'redhat'                => 'Red Hat(?: Enterprise)? Linux(?: Server)? release (.*) \(',
+    'oracle enterprise linux' => 'Enterprise Linux Server release (.+) \(',
     'slackware'             => '^Slackware (.+)$',
     'pardus'                => '^Pardus (.+)$',
     'centos'                => '^CentOS(?: Linux)? release (.+)(?:\s\(Final\))',
@@ -83,7 +85,7 @@ sub distribution_name {
         return $distro if ($distro);
     }
 
-    foreach ('fedora-release') {
+    foreach (qw(enterprise-release fedora-release)) {
         if (-f "$release_files_directory/$_" && !-l "$release_files_directory/$_"){
             if (-f "$release_files_directory/$_" && !-l "$release_files_directory/$_"){
                 $self->{'DISTRIB_ID'} = $release_files{$_};
@@ -196,9 +198,9 @@ Linux::Distribution - Perl extension to detect on which Linux distribution we ar
 
 This is a simple module that tries to guess on what linux distribution we are running by looking for release's files in /etc.  It now looks for 'lsb-release' first as that should be the most correct and adds ubuntu support.  Secondly, it will look for the distro specific files.
 
-It currently recognizes slackware, debian, suse, fedora, redhat, turbolinux, yellowdog, knoppix, mandrake, conectiva, immunix, tinysofa, va-linux, trustix, adamantix, yoper, arch-linux, libranet, gentoo, ubuntu, scientific and redflag.
+It currently recognizes slackware, debian, suse, fedora, redhat, turbolinux, yellowdog, knoppix, mandrake, conectiva, immunix, tinysofa, va-linux, trustix, adamantix, yoper, arch-linux, libranet, gentoo, ubuntu, scientific, oracle enterprise linux and redflag.
 
-It has function to get the version for debian, suse, fedora, redhat, gentoo, slackware, scientific, redflag and ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-)
+It has function to get the version for debian, suse, fedora, redhat, gentoo, slackware, scientific, oracle enterprise linux, redflag and ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-)
 
 =head2 EXPORT
 
diff --git a/t/oel6.t b/t/oel6.t
new file mode 100644
index 0000000..d1aabbb
--- /dev/null
+++ b/t/oel6.t
@@ -0,0 +1,14 @@
+use 5.006000;
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+use lib '../lib/';
+use Linux::Distribution;
+
+local $Linux::Distribution::release_files_directory='t/oel6/';
+my $linux = Linux::Distribution->new;
+my $distro = $linux->distribution_name();
+is($distro,'oracle enterprise linux');
+my $version = $linux->distribution_version();
+is ($version,'5.6');
diff --git a/t/oel6/enterprise-release b/t/oel6/enterprise-release
new file mode 100644
index 0000000..9d53c26
--- /dev/null
+++ b/t/oel6/enterprise-release
@@ -0,0 +1 @@
+Enterprise Linux Enterprise Linux Server release 5.6 (Carthage)
diff --git a/t/oel6/files b/t/oel6/files
new file mode 100644
index 0000000..1475758
--- /dev/null
+++ b/t/oel6/files
@@ -0,0 +1,6 @@
+exists:
+enterprise-release
+redhat-release
+do not:
+redhat_version
+lsb-release
diff --git a/t/oel6/redhat-release b/t/oel6/redhat-release
new file mode 100644
index 0000000..1631934
--- /dev/null
+++ b/t/oel6/redhat-release
@@ -0,0 +1 @@
+Red Hat Enterprise Linux Server release 5.6 (Tikanga)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/liblinux-distribution-perl.git



More information about the Pkg-perl-cvs-commits mailing list