[LON-CAPA-cvs] cvs: loncom /build distprobe

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 26 Oct 2004 19:45:57 -0000


albertel		Tue Oct 26 15:45:57 2004 EDT

  Modified files:              
    /loncom/build	distprobe 
  Log:
  - from Mike Edwards
  
  
Index: loncom/build/distprobe
diff -u loncom/build/distprobe:1.5 loncom/build/distprobe:1.6
--- loncom/build/distprobe:1.5	Mon Nov 24 11:56:47 2003
+++ loncom/build/distprobe	Tue Oct 26 15:45:57 2004
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network with CAPA
 #
-# $Id: distprobe,v 1.5 2003/11/24 16:56:47 matthew Exp $
+# $Id: distprobe,v 1.6 2004/10/26 19:45:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -56,7 +56,20 @@
     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 or redhat system');
+    warn('Unknown installation: expecting a debian, suse, or redhat system');
 }
 print $dist;