Annotation of loncom/build/distprobe, revision 1.3

1.1       harris41    1: #!/usr/bin/perl
                      2: 
                      3: # YEAR=2002
                      4: 
                      5: my $dist='default';
                      6: if (-e '/etc/redhat-release') {
                      7:     open(IN,'</etc/redhat-release');
                      8:     my $versionstring=<IN>;
                      9:     chomp($versionstring);
                     10:     close(IN);
                     11:     my $version=(split(/\s+/,$versionstring))[4];
                     12:     if ($version=~/^7\./) {
                     13: 	$dist='redhat7';
1.3     ! albertel   14:     } elsif ($version=~/^8\./) {
        !            15: 	$dist='redhat8';
1.1       harris41   16:     }
                     17: }
                     18: elsif (-e '/etc/debian_version') {
                     19:     open(IN,'</etc/debian_version');
                     20:     my $version=<IN>;
                     21:     chomp($version);
                     22:     close(IN);
                     23:     if ($version eq '2.2') {
                     24: 	$dist='debian2.2';
                     25:     }
                     26: }
                     27: else {
                     28:     warn('Unknown installation filesystem; expecting debian version 2.2 '.
                     29: 	 'or redhat 6.* or 7.*');
                     30: }
                     31: print $dist;

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