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
This commit is contained in:
parent
72ce49431d
commit
71d82a428e
@ -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=();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user