Annotation of loncom/build/distprobe, revision 1.4
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.4 ! albertel 16: } elsif ($version=~/^9/) {
! 17: $dist='redhat9';
1.1 harris41 18: }
19: }
20: elsif (-e '/etc/debian_version') {
21: open(IN,'</etc/debian_version');
22: my $version=<IN>;
23: chomp($version);
24: close(IN);
25: if ($version eq '2.2') {
26: $dist='debian2.2';
27: }
28: }
29: else {
30: warn('Unknown installation filesystem; expecting debian version 2.2 '.
31: 'or redhat 6.* or 7.*');
32: }
33: print $dist;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>