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 f338c26e8f14c6cd0143a441fcd3886505dfdff4 Author: Mike <michiel.bei...@gmail.com> Date: Wed Jul 27 17:26:17 2011 +0200 Added patch for RT#69671 - Fedora version not returned for recent releases, kudos tlhackque. Included unit tests. --- lib/Linux/Distribution.pm | 4 ++-- t/fedora15.t | 14 ++++++++++++++ t/fedora15/fedora-release | 1 + t/fedora15/files | 6 ++++++ t/fedora15/redhat-release | 1 + 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/Linux/Distribution.pm b/lib/Linux/Distribution.pm index c8f0729..b686adc 100644 --- a/lib/Linux/Distribution.pm +++ b/lib/Linux/Distribution.pm @@ -47,7 +47,7 @@ our %version_match = ( 'gentoo' => 'Gentoo Base System release (.*)', 'debian' => '(.+)', 'suse' => 'VERSION = (.*)', - 'fedora' => 'Fedora Core release (\d+) \(', + 'fedora' => 'Fedora(?: Core)? release (\d+) \(', 'redflag' => 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)', 'redhat' => 'Red Hat Linux release (.*) \(', 'slackware' => '^Slackware (.+)$', @@ -195,7 +195,7 @@ This is a simple module that tries to guess on what linux distribution we are ru 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 and redflag. -It has function to get the version for debian, suse, redhat, gentoo, slackware, 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, redflag and ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-) =head2 EXPORT diff --git a/t/fedora15.t b/t/fedora15.t new file mode 100644 index 0000000..e2c72ce --- /dev/null +++ b/t/fedora15.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='fedora15/'; +my $linux = Linux::Distribution->new; +my $distro = $linux->distribution_name(); +is($distro,'fedora'); +my $version = $linux->distribution_version(); +is ($version,'15'); diff --git a/t/fedora15/fedora-release b/t/fedora15/fedora-release new file mode 100644 index 0000000..c9b52ed --- /dev/null +++ b/t/fedora15/fedora-release @@ -0,0 +1 @@ +Fedora release 15 (Lovelock) diff --git a/t/fedora15/files b/t/fedora15/files new file mode 100644 index 0000000..e4f623d --- /dev/null +++ b/t/fedora15/files @@ -0,0 +1,6 @@ +exists: +redhat-release +fedora-release +do not: +redhat_version +lsb-release diff --git a/t/fedora15/redhat-release b/t/fedora15/redhat-release new file mode 100644 index 0000000..c9b52ed --- /dev/null +++ b/t/fedora15/redhat-release @@ -0,0 +1 @@ +Fedora release 15 (Lovelock) -- 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