--- loncom/debugging_tools/modify_config_files.pl 2004/11/19 20:46:07 1.5 +++ loncom/debugging_tools/modify_config_files.pl 2007/04/23 20:04:54 1.6 @@ -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 lib '/home/httpd/lib/perl/'; 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 = ; +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 @@ my $yum_status = 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',