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

raeburn raeburn@source.lon-capa.org
Sun, 05 Jul 2009 23:58:38 -0000


raeburn		Sun Jul  5 23:58:38 2009 EDT

  Modified files:              
    /loncom/build	distprobe 
  Log:
  - Specific check for /etc/SuSE-release before check for /etc/issue 
     (/etc/issue exists on all distros).
  
  
Index: loncom/build/distprobe
diff -u loncom/build/distprobe:1.15 loncom/build/distprobe:1.16
--- loncom/build/distprobe:1.15	Sun Jun 28 14:22:04 2009
+++ loncom/build/distprobe	Sun Jul  5 23:58:38 2009
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network with CAPA
 #
-# $Id: distprobe,v 1.15 2009/06/28 14:22:04 raeburn Exp $
+# $Id: distprobe,v 1.16 2009/07/05 23:58:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,6 +61,21 @@
         warn('Unable to interpret /etc/redhat-release '.
              'to determine system type');
     }
+} elsif (-e '/etc/SuSE-release') {
+    open(IN,'</etc/SuSE-release');
+    my $versionstring=<IN>;
+    chomp($versionstring);
+    close(IN);
+    if ($versionstring =~ /^SUSE LINUX Enterprise Server ([\d\.]+) /i) {
+        $dist='sles'.$1;
+    } elsif ($versionstring =~ /^SuSE Linux ([\d\.]+) /i) {
+        $dist = 'suse'.$1;
+    } elsif ($versionstring =~ /^openSUSE ([\d\.]+) /i) {
+        $dist = 'suse'.$1;
+    } else {
+        warn('Unable to interpret /etc/SuSE-release '.
+             'to determine system type');
+    }
 } elsif (-e '/etc/issue') {
     open(IN,'</etc/issue');
     my $versionstring=<IN>;
@@ -96,21 +111,6 @@
         warn('Unable to interpret /etc/debian_version '.
              'to determine system type');
     }
-} elsif (-e '/etc/SuSE-release') {
-    open(IN,'</etc/SuSE-release');
-    my $versionstring=<IN>;
-    chomp($versionstring);
-    close(IN);
-    if ($versionstring =~ /^SUSE LINUX Enterprise Server ([\d\.]+) /i) {
-        $dist='sles'.$1;
-    } elsif ($versionstring =~ /^SuSE Linux ([\d\.]+) /i) {
-        $dist = 'suse'.$1;
-    } elsif ($versionstring =~ /^openSUSE ([\d\.]+) /i) {
-        $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');
 }