From a44d50bf39d0594acd0fb9334263953d2600b7ef Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 3 Apr 2012 22:12:08 +0000 Subject: Slighty simplify and do not call clean_urpmi_process If this is needed this should be done before all rm -r $chroot of this function, not just the last one --- lib/Iurt/Chroot.pm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lib/Iurt') diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 9d9d2a0..6e9184a 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -307,20 +307,18 @@ sub create_chroot { } if ($rebuild) { - if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) { - plog('NOTIFY', "creating chroot failed."); - $clean->(); - sudo($config, '--rm', '-r', $chroot, $chroot_tar); - return; - } + sudo($config, '--rm', '-r', $chroot); + if (!build_chroot($run, $config, $tmp_chroot, $chroot_tar, $opt)) { + plog('NOTIFY', "creating chroot failed."); + $clean->(); + sudo($config, '--rm', '-r', $chroot_tar); + return; + } } - if (!-d $chroot || $rebuild) { + if (!-d $chroot) { plog('DEBUG', "recreate chroot $chroot"); plog('NOTIFY', "recreate chroot"); - my $urpmi = $run->{urpmi}; - $urpmi->clean_urpmi_process($chroot); - sudo($config, '--rm', '-r', $chroot); mkdir_p $chroot; sudo($config, '--untar', $chroot_tar, $chroot); plog('NOTIFY', "chroot recreated in $chroot_tar (live in $chroot)"); -- cgit v1.2.1