From a0444be1ed4c2ff2bc1a2f856e951e4842f0276f Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 3 Apr 2012 23:01:57 +0000 Subject: Take tar out of build_chroot --- lib/Iurt/Chroot.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 5912e87..93b1363 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -308,12 +308,12 @@ sub create_chroot { if ($rebuild) { sudo($config, '--rm', '-r', $chroot); - if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) { + if (!build_chroot($run, $config, $tmp_chroot, $opt)) { plog('NOTIFY', "creating chroot failed."); $clean->(); - sudo($config, '--rm', '-r', $chroot_tar); return; } + sudo($config, "--tar", $chroot_tar, $tmp_chroot); } if (!-d $chroot) { @@ -330,7 +330,7 @@ sub create_chroot { } sub build_chroot { - my ($run, $config, $tmp_chroot, $chroot_tar, $opt) = @_; + my ($run, $config, $tmp_chroot, $opt) = @_; plog('DEBUG', "building the chroot with " . join(', ', @{$opt->{packages}})); @@ -407,7 +407,8 @@ sub build_chroot { if (-d "$tmp_chroot/urpmi_medias/") { sudo($config, "--umount", "$tmp_chroot/urpmi_medias"); } - return sudo($config, "--tar", $chroot_tar, $tmp_chroot); + + 1; } sub check_build_chroot { -- cgit v1.2.1