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

raeburn raeburn at source.lon-capa.org
Wed Oct 2 18:28:24 EDT 2019


raeburn		Wed Oct  2 22:28:24 2019 EDT

  Modified files:              
    /loncom/debugging_tools	modify_config_files.pl 
  Log:
  - Oracle Linux and RHEL/CentOS 8 and newer use /etc/yum.repos.d/loncapa.repo
    instead of /etc/yum.conf
  
  
Index: loncom/debugging_tools/modify_config_files.pl
diff -u loncom/debugging_tools/modify_config_files.pl:1.15 loncom/debugging_tools/modify_config_files.pl:1.16
--- loncom/debugging_tools/modify_config_files.pl:1.15	Tue Jul  2 19:40:27 2019
+++ loncom/debugging_tools/modify_config_files.pl	Wed Oct  2 22:28:24 2019
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: modify_config_files.pl,v 1.15 2019/07/02 19:40:27 raeburn Exp $
+# $Id: modify_config_files.pl,v 1.16 2019/10/02 22:28:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -37,9 +37,10 @@
 =head1 SYNOPSIS
 
 This script modifies /etc/my.cnf and one of: /etc/yum.conf 
-(for CentOS/Scientific Linux/RHEL >=5), /etc/apt/sources.list
+(for CentOS/Scientific Linux/RHEL >=5 and <8), /etc/apt/sources.list
 (for Debian/Ubuntu), /etc/sysconfig/rhn/sources (for RHEL4),
-and /etc/yum.repos.d/loncapa.repo (Fedora >= 21).
+and /etc/yum.repos.d/loncapa.repo (Fedora >= 21; Oracle Linux; 
+CentOS/RHEL >= 8).
 
 =head1 DESCRIPTION
 
@@ -116,6 +117,7 @@
     my $type = $1;
     my $ver = $2;
     my $longver = $ver;
+    my $nobackup;
     if ($type eq 'rhes') {
         if ($ver == 4) {
             $longver = '4ES';
@@ -151,8 +153,13 @@
                );
     if (ref($info{$type}) eq 'HASH') {
         if ($ver > 4) {
+            my $file = '/etc/yum.conf';
+            if (($ver > 7) || ($type eq 'oracle')) {
+                $file = '/etc/yum.repos.d/loncapa.repo';
+                $nobackup = 1;
+            }
             $yum_status =
-                &update_file('/etc/yum.conf',
+                &update_file($file,
                      [{section => 'loncapa-updates-basearch',
                        key     => 'name=',
                        value   => $info{$type}{title}.' $releasever LON-CAPA $basearch Updates',
@@ -177,7 +184,7 @@
                       }, {section => 'loncapa-updates-noarch',
                           key     => 'gpgkey=',
                           value   => "$loninst/$info{$type}{gpg}",
-                      }]);
+                      }],$nobackup);
         } elsif (($type eq 'rhes') && ($ver == 4)) {
             my %rhn = (
                         basearch => { 




More information about the LON-CAPA-cvs mailing list