From ca7cc188a0138281a1b8975601311ea30798adf3 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Tue, 8 Jul 2014 21:30:56 +0100 Subject: [PATCH] add allowed entries for pkgdir to have http, so that we can have external repos * This will only work though has more than one repo defined, where the first one is the local one --- xCAT-server/lib/perl/xCAT/Template.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 523644b04..32e4e6caa 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -205,18 +205,23 @@ sub subvars { my $source_in_pre; my $c = 0; foreach my $pkgdir(@pkgdirs) { + my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir"; + my $http2 = "http://'\$nextserver'$pkgdir"; + if ( $pkgdir =~ /^http/ ) { + $http = $pkgdir; + $http2 = $pkgdir; + } if( $platform =~ /^(rh|SL|centos|fedora)$/ ) { if ( $c == 0 ) { # After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x # the rhels5.9 will not be installed successfully. So put in kickstart directly. - $source_in_pre .= "echo 'url --url http://'\$nextserver'/$pkgdir' >> /tmp/repos"; - $source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #For rhels5.9 + $source_in_pre .= "echo 'url --url $http2 >> /tmp/repos"; + $source .= "url --url $http\n"; #For rhels5.9 } else { - $source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'/$pkgdir' >> /tmp/repos"; - $source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #for rhels5.9 + $source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=$http2' >> /tmp/repos"; + $source .= "repo --name=pkg$c --baseurl=$http\n"; #for rhels5.9 } } elsif ($platform =~ /^(sles|suse)/) { - my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir"; $source .= " $http SuSE-Linux-pkg$c @@ -224,7 +229,7 @@ sub subvars { false SuSE-Linux-pkg$c "; - $source_in_pre .="http://'\$nextserver'$pkgdirSuSE-Linux-pkg$c/falseSuSE-Linux-pkg$c"; + $source_in_pre .="$http2SuSE-Linux-pkg$c/falseSuSE-Linux-pkg$c"; } $c++; }