File:  [LON-CAPA] / loncom / build / distprobe
Revision 1.3: download - view: text, annotated - select for diffs
Tue Apr 15 15:25:51 2003 UTC (21 years, 8 months ago) by albertel
Branches: MAIN
CVS tags: version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, conference_2003, HEAD
-rh8 support

#!/usr/bin/perl

# YEAR=2002

my $dist='default';
if (-e '/etc/redhat-release') {
    open(IN,'</etc/redhat-release');
    my $versionstring=<IN>;
    chomp($versionstring);
    close(IN);
    my $version=(split(/\s+/,$versionstring))[4];
    if ($version=~/^7\./) {
	$dist='redhat7';
    } elsif ($version=~/^8\./) {
	$dist='redhat8';
    }
}
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';
    }
}
else {
    warn('Unknown installation filesystem; expecting debian version 2.2 '.
	 'or redhat 6.* or 7.*');
}
print $dist;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>