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 b388c2e8f0a798b1cb70383247c59e8ebdc2b616 Author: Mike <michiel.bei...@gmail.com> Date: Wed Jul 27 22:06:59 2011 +0200 Fix for RT#69847 - Centos6 detection does not work. --- lib/Linux/Distribution.pm | 3 ++- t/centos6.t | 14 ++++++++++++++ t/centos6/centos-release | 1 + t/centos6/files | 5 +++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Linux/Distribution.pm b/lib/Linux/Distribution.pm index b686adc..0d2ca63 100644 --- a/lib/Linux/Distribution.pm +++ b/lib/Linux/Distribution.pm @@ -18,6 +18,7 @@ our $standard_release_file = 'lsb-release'; our %release_files = ( 'gentoo-release' => 'gentoo', 'fedora-release' => 'fedora', + 'centos-release' => 'centos', 'turbolinux-release' => 'turbolinux', 'mandrake-release' => 'mandrake', 'mandrakelinux-release' => 'mandrakelinux', @@ -52,7 +53,7 @@ our %version_match = ( 'redhat' => 'Red Hat Linux release (.*) \(', 'slackware' => '^Slackware (.+)$', 'pardus' => '^Pardus (.+)$', - 'centos' => '^CentOS release (.+)(?:\s\(Final\))', + 'centos' => '^CentOS(?: Linux)? release (.+)(?:\s\(Final\))', ); diff --git a/t/centos6.t b/t/centos6.t new file mode 100644 index 0000000..bbd26c7 --- /dev/null +++ b/t/centos6.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='centos6/'; +my $linux = Linux::Distribution->new; +my $distro = $linux->distribution_name(); +is($distro,'centos'); +my $version = $linux->distribution_version(); +is ($version,'6.0'); diff --git a/t/centos6/centos-release b/t/centos6/centos-release new file mode 100644 index 0000000..8081330 --- /dev/null +++ b/t/centos6/centos-release @@ -0,0 +1 @@ +CentOS Linux release 6.0 (Final) diff --git a/t/centos6/files b/t/centos6/files new file mode 100644 index 0000000..63f81e3 --- /dev/null +++ b/t/centos6/files @@ -0,0 +1,5 @@ +exists: +centos-release +do not: +redhat_version +lsb-release -- 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