Subject: | Fedora version not returned for recent releases |
Fedora has removed the word "Core" from it's version string, causing
Linux::Distribuion::distribution_version to fail.
The current code does work on FC 6, but definitely fails on FC 14 &
15. I don't know exactly where it broke...
Attached is a patch with the corrected regex to deal with this.
$ uname -a
Linux hagrid.example.com 2.6.35.13-91.fc14.x86_64 #1 SMP Tue May 3
13:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
$ perl -MLinux::Distribution -e'print
Linux::Distribution::distribution_version(),"\n"'
$
After patch:
$ perl -MLinux::Distribution -e'print
Linux::Distribution::distribution_version(),"\n"'
14
$
cat /etc/redhat-release
Fedora Core release 6 (Zod)
cat /etc/redhat-release
Fedora release 14 (Laughlin)
cat /etc/redhat-release
Fedora release 15 (Lovelock)
Subject: | ldfedora.patch |
--- /usr/local/share/perl5/Linux/Distribution.pm~ 2011-07-21 12:21:17.000000000 -0400
+++ /usr/local/share/perl5/Linux/Distribution.pm 2011-07-21 14:26:38.051037210 -0400
@@ -45,11 +45,11 @@
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 (.+)$',
'pardus' => '^Pardus (.+)$',
'centos' => '^CentOS release (.+)(?:\s\(Final\))',