diff --git a/perl-xCAT/xCAT/Yum.pm b/perl-xCAT/xCAT/Yum.pm index 6ff90907b..963b15b66 100644 --- a/perl-xCAT/xCAT/Yum.pm +++ b/perl-xCAT/xCAT/Yum.pm @@ -44,6 +44,15 @@ sub fix_directory { print $yumrepofile "enabled=1\n"; print $yumrepofile "gpgcheck=0\n\n"; + $grep_result = system("grep sha256 $dirlocation/repomd.xml|grep \\connect("dbi:SQLite:$dirlocation/primary.sqlite","","",{AutoCommit=>1}); $pdbh->do('UPDATE "packages" SET "location_base" = NULL'); $pdbh->disconnect; - $newdbopensha=`/usr/bin/sha1sum $dirlocation/primary.sqlite`; + $newdbopensha=`/usr/bin/$sha_command $dirlocation/primary.sqlite`; $newdbopensha =~ s/\s.*//; chomp($newdbopensha); system("/usr/bin/bzip2 $dirlocation/primary.sqlite"); - $newdbsha=`/usr/bin/sha1sum $dirlocation/primary.sqlite.bz2`; + $newdbsha=`/usr/bin/$sha_command $dirlocation/primary.sqlite.bz2`; $newdbsha =~ s/\s.*//; chomp($newdbsha); } @@ -130,6 +139,14 @@ sub fix_directory { #update repomd.xml open($primaryxml,"+<$dirlocation/repomd.xml"); while (<$primaryxml>) { + if($_ =~ m/\/) + { + next; + } + if($_ =~ m/\/) + { + next; + } s!xml:base="media://[^"]*"!!g; if(defined($oldsha)){ s!$oldsha!$newsha!g; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 976ebc106..d8394e49f 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1410,7 +1410,10 @@ sub copycd #my $rc = system("cd $path;rsync -a . $installroot/$distname/$arch/"); chmod 0755, "$installroot/$distname/$arch"; require xCAT::Yum; - xCAT::Yum->localize_yumrepo($installroot, $distname, $arch); + if($distname =~ /rhels5/) + { + xCAT::Yum->localize_yumrepo($installroot, $distname, $arch); + } if ($rc != 0) { $callback->({error => "Media copy operation failed, status $rc"});