version 1.12, 2007/04/23 20:04:52
|
version 1.19, 2011/05/06 21:29:41
|
Line 42 if (-e '/etc/redhat-release') {
|
Line 42 if (-e '/etc/redhat-release') {
|
} elsif ($version=~/^9/) { |
} elsif ($version=~/^9/) { |
$dist='redhat9'; |
$dist='redhat9'; |
} |
} |
} elsif ($versionstring =~ /Fedora Core release ([\d\.]+) /) { |
} elsif ($versionstring =~ /Fedora( Core)? release ([\d\.]+) /) { |
my $version=$1; |
my $version=$2; |
if ($version - int($version) > .9) { |
if ($version - int($version) > .9) { |
$dist = 'fedora'.(int($version)+1); |
$dist = 'fedora'.(int($version)+1); |
} else { |
} else { |
Line 53 if (-e '/etc/redhat-release') {
|
Line 53 if (-e '/etc/redhat-release') {
|
$dist = 'rhes'.$1; |
$dist = 'rhes'.$1; |
} elsif ($versionstring =~ /Red Hat Enterprise Linux Server release (\d+)/) { |
} elsif ($versionstring =~ /Red Hat Enterprise Linux Server release (\d+)/) { |
$dist = 'rhes'.$1; |
$dist = 'rhes'.$1; |
|
} elsif ($versionstring =~ /CentOS release (\d+)/) { |
|
$dist = 'centos'.$1; |
|
} elsif ($versionstring =~ /Scientific Linux (?:SL )?release ([\d.]+) /) { |
|
my $ver = $1; |
|
$ver =~ s/\.\d+$//; |
|
$dist = 'scientific'.$ver; |
} else { |
} else { |
warn('Unable to interpret /etc/redhat-release '. |
warn('Unable to interpret /etc/redhat-release '. |
'to determine system type'); |
'to determine system type'); |
} |
} |
} elsif (-e '/etc/debian_version') { |
|
open(IN,'</etc/debian_version'); |
|
my $version=<IN>; |
|
chomp($version); |
|
close(IN); |
|
if ($version eq '2.2') { |
|
$dist='debian2.2'; |
|
} |
|
} elsif (-e '/etc/SuSE-release') { |
} elsif (-e '/etc/SuSE-release') { |
open(IN,'</etc/SuSE-release'); |
open(IN,'</etc/SuSE-release'); |
my $versionstring=<IN>; |
my $versionstring=<IN>; |
Line 80 if (-e '/etc/redhat-release') {
|
Line 78 if (-e '/etc/redhat-release') {
|
warn('Unable to interpret /etc/SuSE-release '. |
warn('Unable to interpret /etc/SuSE-release '. |
'to determine system type'); |
'to determine system type'); |
} |
} |
|
} elsif (-e '/etc/issue') { |
|
open(IN,'</etc/issue'); |
|
my $versionstring=<IN>; |
|
chomp($versionstring); |
|
close(IN); |
|
if ($versionstring =~ /^Ubuntu (\d+)\.\d+/i) { |
|
$dist = 'ubuntu'.$1; |
|
} elsif ($versionstring =~ /^Debian\s+GNU\/Linux\s+(\d+)\.\d+/i) { |
|
$dist = 'debian'.$1; |
|
} elsif (-e '/etc/debian_version') { |
|
open(IN,'</etc/debian_version'); |
|
my $version=<IN>; |
|
chomp($version); |
|
close(IN); |
|
if ($version =~ /^(\d+)\.\d+\.?\d*/) { |
|
$dist='debian'.$1; |
|
} else { |
|
warn('Unable to interpret /etc/debian_version '. |
|
'to determine system type'); |
|
} |
|
} else { |
|
warn('Unable to interpret /etc/issue '. |
|
'to determine system type'); |
|
} |
|
} elsif (-e '/etc/debian_version') { |
|
open(IN,'</etc/debian_version'); |
|
my $version=<IN>; |
|
chomp($version); |
|
close(IN); |
|
if ($version =~ /^(\d+)\.\d+\.?\d*/) { |
|
$dist='debian'.$1; |
|
} else { |
|
warn('Unable to interpret /etc/debian_version '. |
|
'to determine system type'); |
|
} |
} else { |
} else { |
warn('Unknown installation: expecting a debian, suse, or redhat system'); |
warn('Unknown installation: expecting a debian, suse, or redhat system'); |
} |
} |