mirror-channel.pl: check if file is a bzip2 file

git-svn-id: https://nixos.org/repos/nix/release/trunk/channels@24362 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb
This commit is contained in:
Rob Vermaas 2010-10-19 11:39:24 +00:00
parent b3d95b30d8
commit bf23243d12

View file

@ -80,6 +80,7 @@ while (my ($storePath, $files) = each %narFiles) {
print "downloading $srcURL\n"; print "downloading $srcURL\n";
my $dstFileTmp = "$narPath/.tmp.$$.nar.$dstName"; my $dstFileTmp = "$narPath/.tmp.$$.nar.$dstName";
system("$curl '$srcURL' > $dstFileTmp") == 0 or die "failed to download `$srcURL'"; system("$curl '$srcURL' > $dstFileTmp") == 0 or die "failed to download `$srcURL'";
system("bunzip2 -t $dstFileTmp &> /dev/null") == 0 or die "downloaded file is not a bzip2 file!";
rename($dstFileTmp, $dstFile) or die "cannot rename $dstFileTmp"; rename($dstFileTmp, $dstFile) or die "cannot rename $dstFileTmp";
} }