diff --git a/perl-xCAT/xCAT/Yum.pm b/perl-xCAT/xCAT/Yum.pm index 7ad5dcbd6..6ff90907b 100644 --- a/perl-xCAT/xCAT/Yum.pm +++ b/perl-xCAT/xCAT/Yum.pm @@ -57,16 +57,16 @@ sub fix_directory { chomp($oldsha); #update primary.xml.gz & primary.xml + if( -r "$dirlocation/primary.xml") + { + unlink("$dirlocation/primary.xml"); + } system("/bin/gunzip $dirlocation/primary.xml.gz"); $oldopensha=`/usr/bin/sha1sum $dirlocation/primary.xml`; $oldopensha =~ s/\s+.*//; chomp($oldopensha); - if( -r "$dirlocation/primary.xml") - { - unlink("$dirlocation/primary.xml"); - } open($primaryxml,"+<$dirlocation/primary.xml"); while (<$primaryxml>) { s!xml:base="media://[^"]*"!!g;