From 71d82a428eb2b5d937694015e0f5913fc1391c9a Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 12 Feb 2008 16:50:53 +0000 Subject: [PATCH] Fix yum local repo correction routine for distributions with multiple repodatas such as RHEL5.1, no longer write data from stale variable git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@452 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/Yum.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perl-xCAT-2.0/xCAT/Yum.pm b/perl-xCAT-2.0/xCAT/Yum.pm index 5752ac5e2..8cf67f479 100644 --- a/perl-xCAT-2.0/xCAT/Yum.pm +++ b/perl-xCAT-2.0/xCAT/Yum.pm @@ -9,7 +9,6 @@ sub localize_yumrepo { my $dosqlite = 0; my $repomdfile; my $primaryxml; - my @xmlines; my $dirlocation = "$installroot/$distname/$arch/"; find(\&check_tofix,$dirlocation); } @@ -22,6 +21,8 @@ sub fix_directory { my $dirlocation = shift; my $oldsha=`/usr/bin/sha1sum $dirlocation/primary.xml.gz`; my $olddbsha; + my @xmlines; + @xmlines = (); $oldsha =~ s/\s.*//; chomp($oldsha); unlink("$dirlocation/primary.xml"); @@ -82,6 +83,7 @@ sub fix_directory { print $primaryxml (@xmlines); truncate($primaryxml,tell($primaryxml)); close($primaryxml); + @xmlines=(); }