Skip Menu |

This queue is for tickets about the Linux-Distribution CPAN distribution.

Report information
The Basics
Id: 44037
Status: resolved
Priority: 0/
Queue: Linux-Distribution

People
Owner: Nobody in particular
Requestors: XSAWYERX [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 0.14
  • 0.14_01
Fixed in: 0.20



Subject: can't identify CentOS
The hash is backwards so it doesn't identify according to OS, but according to release file and the hash value is not a arrayref so it cannot include other operating systems on the same release file. To allow Fedora (from another bug report), the 0.14_01 developer version seems hacked together. Included is yet another hack to allow CentOS since it uses the same file. I would advice to reversing the hash to check according to OS name or to simply put an array ref in the value and have another check to see if it validates to which of the array values in the array ref. Good luck, Sawyer.
Subject: identify_centos.patch
--- /usr/lib/perl5/site_perl/5.8.8/Linux/Distribution.pm 2006-02-16 07:35:02.000000000 +0000 +++ Linux-Distribution-0.14/lib/Linux/Distribution.pm 2009-03-11 13:55:11.000000000 +0000 @@ -48,7 +48,8 @@ 'fedora' => 'Fedora Core release (\d+) \(', 'redflag' => 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)', 'redhat' => 'Red Hat Linux release (.*) \(', - 'slackware' => '^Slackware (.+)$' + 'slackware' => '^Slackware (.+)$', + 'centos' => '^CentOS release (.+)(?:\s\(Final\))', ); @@ -79,8 +80,24 @@ foreach (keys %release_files) { if (-f "/etc/$_" && !-l "/etc/$_"){ if (-f "/etc/$_" && !-l "/etc/$_"){ + # ugly hack to include CentOS + # if what we found is redhat + if ( $release_files{$_} eq 'redhat' ) { + # we try the CentOS pattern + $self->{'release_file'} = 'redhat-release'; + $self->{'pattern'} = $version_match{'centos'}; + if ( $self->_get_file_info() ) { + # if we success, we return with it + $self->{'DISTRIB_ID'} = 'centos'; + $self->{'release_file'} = $_; + return $self->{'DISTRIB_ID'}; + } + } + $self->{'DISTRIB_ID'} = $release_files{$_}; $self->{'release_file'} = $_; + $self->{'pattern'} = ''; + return $self->{'DISTRIB_ID'}; } }
I should probably add that this patch is against version 0.14, NOT 0.14_1.
hi xsawyerx, Thanks for the report. Your issue has been fixed in the current (0.20) release of Linux::Distribution. -- Michiel