[LON-CAPA-cvs] cvs: loncom /build CHECKRPMS distprobe /debugging_tools modify_config_files.pl

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 23 Apr 2007 20:04:55 -0000


raeburn		Mon Apr 23 16:04:55 2007 EDT

  Modified files:              
    /loncom/build	CHECKRPMS distprobe 
    /loncom/debugging_tools	modify_config_files.pl 
  Log:
  - RHEL5 (CHECKRPMS uses yum instead of up2date)
  - Make modify_config_files.pl compatible with 64 bit
  
  
Index: loncom/build/CHECKRPMS
diff -u loncom/build/CHECKRPMS:1.6 loncom/build/CHECKRPMS:1.7
--- loncom/build/CHECKRPMS:1.6	Tue Oct 10 15:27:48 2006
+++ loncom/build/CHECKRPMS	Mon Apr 23 16:04:52 2007
@@ -39,7 +39,7 @@
 
 The utility which is used to complete the check depends on the distro:
 
-fedora - yum
+fedora, rhel 5/5+ - yum
 suse 9.X and sles9 - you
 suse 10.X and sles10 - rug
 rhel 4 - up2date
@@ -88,10 +88,17 @@
     $cmd = 'rug up';
     &prepare_msg($tmpfile,$cmd);
     ($send,$addsubj) = &check_with_rug($tmpfile);
-} elsif ($distro =~ /^rhes4$/) {
-    $cmd ='up2date -u --nox';
-    &prepare_msg($tmpfile,$cmd);
-    ($send,$addsubj) = &check_with_up2date($tmpfile);
+} elsif ($distro =~ /^rhes(\d+)$/) {
+    my $version = $1;
+    if ($version == 4) {
+        $cmd ='up2date -u --nox';
+        &prepare_msg($tmpfile,$cmd);
+        ($send,$addsubj) = &check_with_up2date($tmpfile);
+    } elsif ($version > 4) {
+        $cmd = 'yum update';
+        &prepare_msg($tmpfile,$cmd);
+        ($send,$addsubj) = &check_with_yum($tmpfile);
+    }
 } else {
     $cmd = '/usr/local/bin/check-rpms --update';
     ($send,$addsubj) = &check_with_checkrpms($tmpfile);
Index: loncom/build/distprobe
diff -u loncom/build/distprobe:1.11 loncom/build/distprobe:1.12
--- loncom/build/distprobe:1.11	Sun Apr 22 12:33:22 2007
+++ loncom/build/distprobe	Mon Apr 23 16:04:52 2007
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network with CAPA
 #
-# $Id: distprobe,v 1.11 2007/04/22 16:33:22 raeburn Exp $
+# $Id: distprobe,v 1.12 2007/04/23 20:04:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -51,6 +51,8 @@
 	}
     } elsif ($versionstring =~ /Red Hat Enterprise Linux [AE]S release ([\d\.]+) /) {
         $dist = 'rhes'.$1;
+    } elsif ($versionstring =~ /Red Hat Enterprise Linux Server release (\d+)/) {
+        $dist = 'rhes'.$1;
     } else {
         warn('Unable to interpret /etc/redhat-release '.
              'to determine system type');
Index: loncom/debugging_tools/modify_config_files.pl
diff -u loncom/debugging_tools/modify_config_files.pl:1.5 loncom/debugging_tools/modify_config_files.pl:1.6
--- loncom/debugging_tools/modify_config_files.pl:1.5	Fri Nov 19 15:46:07 2004
+++ loncom/debugging_tools/modify_config_files.pl	Mon Apr 23 16:04:54 2007
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: modify_config_files.pl,v 1.5 2004/11/19 20:46:07 matthew Exp $
+# $Id: modify_config_files.pl,v 1.6 2007/04/23 20:04:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,16 +53,23 @@
 use LONCAPA::Configuration;
 my $loncapa_config=LONCAPA::Configuration::read_conf('loncapa.conf');
 
-my $yum_status = 
-    &update_file('/etc/yum.conf',
-             [{section => 'loncapa-updates-i386',
+open(DSH,"$$loncapa_config{'lonDaemons'}/distprobe |");
+my $dist = <DSH>;
+chomp($dist);
+close(DSH);
+
+my $yum_status;
+if ($dist =~ /^fedora\d+$/) {
+    $yum_status =  
+        &update_file('/etc/yum.conf',
+             [{section => 'loncapa-updates-$basearch',
                key     => 'name=',
-               value   => 'Fedora Core $releasever LON-CAPA i386 Updates',
-           }, {section => 'loncapa-updates-i386',
+               value   => 'Fedora Core $releasever LON-CAPA $basearch Updates',
+           }, {section => 'loncapa-updates-$basearch',
                key     => 'baseurl=',
                value   => 'http://install.loncapa.org/fedora/linux/loncapa/'.
-                   '$releasever/i386',
-           }, {section => 'loncapa-updates-i386',
+                   '$releasever/$basearch',
+           }, {section => 'loncapa-updates-$basearch',
                key     => 'gpgcheck=',
                value   => '0',
            }, {section => 'loncapa-updates-noarch',
@@ -76,6 +83,41 @@
                key     => 'gpgcheck=',
                value   => '0',
            }]);
+} elsif ($dist =~ /^rhes(\d+)$/) {
+    if ($1 > 4) {
+        $yum_status =
+            &update_file('/etc/yum.conf',
+                 [{section => 'loncapa-updates-$basearch',
+                   key     => 'name=',
+                   value   => 'RHEL $releasever LON-CAPA $basearch Updates',
+               }, {section => 'loncapa-updates-$basearch',
+                   key     => 'baseurl=',
+                   value   => 'http://install.loncapa.org/redhat/linux/loncapa/'.
+                       '$releasever/$basearch',
+               }, {section => 'loncapa-updates-$basearch',
+                   key     => 'gpgcheck=',
+                   value   => '1',
+               }, {section => 'loncapa-updates-$basearch',
+                   key     => 'gpgkey=',
+                   value   => 'http://install.loncapa.org/versions/redhat/'.
+                              'RHEL/RPM-GPG-KEY-loncapa',
+               }, {section => 'loncapa-updates-noarch',
+                   key     => 'name=',
+                   value   => 'RHEL $releasever LON-CAPA noarch Updates',
+               }, {section => 'loncapa-updates-noarch',
+                   key     => 'baseurl=',
+                   value   => 'http://install.loncapa.org/redhat/linux/loncapa/'.
+                       '$releasever/noarch',
+               }, {section => 'loncapa-updates-noarch',
+                   key     => 'gpgcheck=',
+                   value   => '1',
+               }, {section => 'loncapa-updates-noarch',
+                   key     => 'gpgkey=',
+                   value   => 'http://install.loncapa.org/versions/redhat/'.
+                              'RHEL/RPM-GPG-KEY-loncapa',
+               }]);
+    }
+}
 
 my $mysql_global_status =
     &update_file('/etc/my.cnf',