diff options
Diffstat (limited to 'lib/Iurt')
-rw-r--r-- | lib/Iurt/Chroot.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 4949828..d87a6b9 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -344,7 +344,15 @@ sub create_build_chroot_tar { $clean->(); return; } + my $tmp_tar = mktemp("$chroot_tar.tmp.XXXXXX"); sudo($config, "--tar", $chroot_tar, $tmp_chroot); + if (rename($tmp_tar, $chroot_tar)) { + plog('NOTIFY', "archive creation failed."); + unlink($tmp_tar); + $clean->(); + return; + } + } if (!-d $chroot) { |