check return from find_latest_pkg

This commit is contained in:
nott 2013-10-18 07:57:49 -04:00
parent 059a4fd6f6
commit 9f53a3c4e6

View File

@ -3131,7 +3131,7 @@ sub kit_addpkgs
return 1;
}
print "Extracting tar file $kittarfile.\n";
print "Extracting tar file $kittarfile. Please wait.\n";
if ( system("cd $tmpdir_base; tar -jxf $kittarfile ") ) {
print "Error extracting tarfile $kittarfile \n";
@ -3526,15 +3526,16 @@ sub NEW_kit_addpkgs
my $ext_reponames = $kp->{kitreponame};
my $files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename);
my @fromfiles=@$files;
if (scalar(@fromfiles) ==0 ) {
if (!defined($files) ) {
print "Error: The product package file $ext_filename was not found in the package directory(s) @pkgdirlist.\n";
# Cleanup
system ("rm -Rf $tmpdir_base");
return 1;
}
my @fromfiles=@$files;
foreach my $repo (split(/,/, $ext_reponames)) {
my $repodir = $::base_repodir."/".$repo;
if ( ! -d ($repodir) && (! mkpath($repodir)) ) {