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 ff9ab372d5a7778bc495d5e16ee0d26f4ffe88ee Author: Mike <michiel.bei...@gmail.com> Date: Mon Aug 8 15:49:48 2011 +0200 Fixed version detection on RHEL 6. --- lib/Linux/Distribution.pm | 2 +- t/rhel6.t | 14 ++++++++++++++ t/rhel6/files | 5 +++++ t/rhel6/redhat-release | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Linux/Distribution.pm b/lib/Linux/Distribution.pm index 0604efc..f747168 100644 --- a/lib/Linux/Distribution.pm +++ b/lib/Linux/Distribution.pm @@ -50,7 +50,7 @@ our %version_match = ( 'suse' => 'VERSION = (.*)', 'fedora' => 'Fedora(?: Core)? release (\d+) \(', 'redflag' => 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)', - 'redhat' => 'Red Hat Linux release (.*) \(', + 'redhat' => 'Red Hat(?: Enterprise)? Linux(?: Server)? release (.*) \(', 'slackware' => '^Slackware (.+)$', 'pardus' => '^Pardus (.+)$', 'centos' => '^CentOS(?: Linux)? release (.+)(?:\s\(Final\))', diff --git a/t/rhel6.t b/t/rhel6.t new file mode 100644 index 0000000..c17c1ef --- /dev/null +++ b/t/rhel6.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='rhel6/'; +my $linux = Linux::Distribution->new; +my $distro = $linux->distribution_name(); +is($distro,'redhat'); +my $version = $linux->distribution_version(); +is ($version,'6.1'); diff --git a/t/rhel6/files b/t/rhel6/files new file mode 100644 index 0000000..36395eb --- /dev/null +++ b/t/rhel6/files @@ -0,0 +1,5 @@ +exists: +redhat-release +do not: +redhat_version +lsb-release diff --git a/t/rhel6/redhat-release b/t/rhel6/redhat-release new file mode 100644 index 0000000..6fb129b --- /dev/null +++ b/t/rhel6/redhat-release @@ -0,0 +1,2 @@ +Red Hat Enterprise Linux Server release 6.1 (Santiago) + -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/liblinux-distribution-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits