[LON-CAPA-cvs] cvs: modules /TexConvert/tthperl commands loncom/build distprobe

raeburn raeburn@source.lon-capa.org
Sun, 28 Jun 2009 14:22:09 -0000


raeburn		Sun Jun 28 14:22:09 2009 EDT

  Modified files:              
    /loncom/build	distprobe 
    /modules/TexConvert/tthperl	commands 
  Log:
  - Support for Debian/Ubuntu
    - get dist from /etc/issue or /etc/debian_version
    - get arch from uname -m    
  
  
Index: loncom/build/distprobe
diff -u loncom/build/distprobe:1.14 loncom/build/distprobe:1.15
--- loncom/build/distprobe:1.14	Thu Jun 28 13:30:06 2007
+++ loncom/build/distprobe	Sun Jun 28 14:22:04 2009
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network with CAPA
 #
-# $Id: distprobe,v 1.14 2007/06/28 13:30:06 raeburn Exp $
+# $Id: distprobe,v 1.15 2009/06/28 14:22:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,13 +61,40 @@
         warn('Unable to interpret /etc/redhat-release '.
              'to determine system type');
     }
+} elsif (-e '/etc/issue') {
+    open(IN,'</etc/issue');
+    my $versionstring=<IN>;
+    chomp($versionstring);
+    close(IN);
+    if ($versionstring =~ /^Ubuntu (\d+)\.\d+/i) {
+        $dist = 'ubuntu'.$1;
+    } elsif ($versionstring =~ /^Debian\s+GNU\/Linux\s+(\d+)\.\d+/i) {
+        $dist = 'debian'.$1;
+    } elsif (-e '/etc/debian_version') {
+        open(IN,'</etc/debian_version');
+        my $version=<IN>;
+        chomp($version);
+        close(IN);
+        if ($version =~  /^(\d+)\.\d+\.?\d*/) {
+            $dist='debian'.$1;
+        } else {
+            warn('Unable to interpret /etc/debian_version '.
+                 'to determine system type');
+        }
+    } else {
+        warn('Unable to interpret /etc/issue '.
+             'to determine system type');
+    }
 } 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';
+    if ($version =~  /^(\d+)\.\d+\.?\d*/) {
+        $dist='debian'.$1;
+    } else {
+        warn('Unable to interpret /etc/debian_version '.
+             'to determine system type');
     }
 } elsif (-e '/etc/SuSE-release') {
     open(IN,'</etc/SuSE-release');
Index: modules/TexConvert/tthperl/commands
diff -u modules/TexConvert/tthperl/commands:1.15 modules/TexConvert/tthperl/commands:1.16
--- modules/TexConvert/tthperl/commands:1.15	Thu Jul 14 18:53:52 2005
+++ modules/TexConvert/tthperl/commands	Sun Jun 28 14:22:09 2009
@@ -1,5 +1,13 @@
 dist=`perl ../../../loncom/build/distprobe`
 arch=`uname -i`
+if [[ $arch == "unknown" ]];
+then
+    arch=`uname -m`
+    if [[ $arch == i*86 ]];
+    then
+        arch="i386";
+    fi
+fi
 if test ! -f ../tthdynamic/tthfunc.c
 then
 	if test -f compiles/tth.so.$arch.$dist