File:
[LON-CAPA] /
loncom /
build /
distprobe
Revision
1.7:
download - view:
text,
annotated -
select for diffs
Mon Nov 1 21:53:23 2004 UTC (19 years, 9 months ago) by
albertel
Branches:
MAIN
CVS tags:
version_1_99_2,
version_1_99_1_tmcc,
version_1_99_1,
version_1_99_0_tmcc,
version_1_99_0,
version_1_3_X,
version_1_3_3,
version_1_3_2,
version_1_3_1,
version_1_3_0,
version_1_2_99_1,
version_1_2_99_0,
HEAD
- make all fedora release numbers int, and round up things than high that X.90 ( this way FC3T3 (Fedora Core 2.92) gets a distprobe indentifier of fedora3)
#!/usr/bin/perl
#
# The LearningOnline Network with CAPA
#
# $Id: distprobe,v 1.7 2004/11/01 21:53:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#
my $dist='default';
if (-e '/etc/redhat-release') {
open(IN,'</etc/redhat-release');
my $versionstring=<IN>;
chomp($versionstring);
close(IN);
if ($versionstring =~ /^Red Hat Linux release ([\d\.]+) /) {
$version = $1;
if ($version=~/^7\./) {
$dist='redhat7';
} elsif ($version=~/^8\./) {
$dist='redhat8';
} elsif ($version=~/^9/) {
$dist='redhat9';
}
} elsif ($versionstring =~ /Fedora Core release ([\d\.]+) /) {
my $version=$1;
if ($version - int($version) > .9) {
$dist = 'fedora'.(int($version)+1);
} else {
$dist = 'fedora'.int($version);
}
} else {
warn('Unable to interpret /etc/redhat-release '.
'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') {
open(IN,'</etc/SuSE-release');
my $versionstring=<IN>;
chomp($versionstring);
close(IN);
if ($versionstring =~ /^SUSE LINUX Enterprise Server ([\d\.]+) /) {
$dist='sles'.$1;
} elsif ($versionstring =~ /^SuSE Linux ([\d\.]+) /) {
$dist = 'suse'.$1;
} else {
warn('Unable to interpret /etc/SuSE-release '.
'to determine system type');
}
} else {
warn('Unknown installation: expecting a debian, suse, or redhat system');
}
print $dist;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>