version 1.14, 2018/10/26 21:39:44
|
version 1.17, 2021/03/13 18:10:00
|
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 112 if ($dist =~ /^fedora(\d+)$/) {
|
Line 113 if ($dist =~ /^fedora(\d+)$/) {
|
key => 'gpgkey=', |
key => 'gpgkey=', |
value => $gpg, |
value => $gpg, |
}],$nobackup); |
}],$nobackup); |
} elsif ($dist =~ /^(rhes|centos|scientific)(\d+)$/) { |
} elsif ($dist =~ /^(rhes|centos|scientific|oracle)(\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 142 if ($dist =~ /^fedora(\d+)$/) {
|
Line 144 if ($dist =~ /^fedora(\d+)$/) {
|
gpg => 'versions/scientific/RPM-GPG-KEY-loncapa', |
gpg => 'versions/scientific/RPM-GPG-KEY-loncapa', |
gpgchk => 1, |
gpgchk => 1, |
}, |
}, |
|
oracle => { |
|
title => 'Oracle Linux', |
|
path => 'oracle/loncapa', |
|
gpg => 'versions/oracle/RPM-GPG-KEY-loncapa', |
|
gpgchk => 1, |
|
}, |
); |
); |
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 171 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 => { |
Line 220 if ($dist =~ /^fedora(\d+)$/) {
|
Line 233 if ($dist =~ /^fedora(\d+)$/) {
|
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+bionic\s+main', |
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+bionic\s+main', |
text => "deb $loninst/ubuntu/ bionic main", |
text => "deb $loninst/ubuntu/ bionic main", |
}, |
}, |
|
ubuntu20 => { |
|
regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/\s+focal\s+main', |
|
text => "deb $loninst/ubuntu/ focal main", |
|
}, |
); |
); |
my $apt_status; |
my $apt_status; |
if (defined($apt_get_source{$dist})) { |
if (defined($apt_get_source{$dist})) { |