version 1.15, 2019/07/02 19:40:27
|
version 1.16, 2019/10/02 22:28:24
|
Line 37 B<modify_config_files.pl>
|
Line 37 B<modify_config_files.pl>
|
=head1 SYNOPSIS |
=head1 SYNOPSIS |
|
|
This script modifies /etc/my.cnf and one of: /etc/yum.conf |
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), |
(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 |
=head1 DESCRIPTION |
|
|
Line 116 if ($dist =~ /^fedora(\d+)$/) {
|
Line 117 if ($dist =~ /^fedora(\d+)$/) {
|
my $type = $1; |
my $type = $1; |
my $ver = $2; |
my $ver = $2; |
my $longver = $ver; |
my $longver = $ver; |
|
my $nobackup; |
if ($type eq 'rhes') { |
if ($type eq 'rhes') { |
if ($ver == 4) { |
if ($ver == 4) { |
$longver = '4ES'; |
$longver = '4ES'; |
Line 151 if ($dist =~ /^fedora(\d+)$/) {
|
Line 153 if ($dist =~ /^fedora(\d+)$/) {
|
); |
); |
if (ref($info{$type}) eq 'HASH') { |
if (ref($info{$type}) eq 'HASH') { |
if ($ver > 4) { |
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 = |
$yum_status = |
&update_file('/etc/yum.conf', |
&update_file($file, |
[{section => 'loncapa-updates-basearch', |
[{section => 'loncapa-updates-basearch', |
key => 'name=', |
key => 'name=', |
value => $info{$type}{title}.' $releasever LON-CAPA $basearch Updates', |
value => $info{$type}{title}.' $releasever LON-CAPA $basearch Updates', |
Line 177 if ($dist =~ /^fedora(\d+)$/) {
|
Line 184 if ($dist =~ /^fedora(\d+)$/) {
|
}, {section => 'loncapa-updates-noarch', |
}, {section => 'loncapa-updates-noarch', |
key => 'gpgkey=', |
key => 'gpgkey=', |
value => "$loninst/$info{$type}{gpg}", |
value => "$loninst/$info{$type}{gpg}", |
}]); |
}],$nobackup); |
} elsif (($type eq 'rhes') && ($ver == 4)) { |
} elsif (($type eq 'rhes') && ($ver == 4)) { |
my %rhn = ( |
my %rhn = ( |
basearch => { |
basearch => { |