aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-04-03 22:12:08 +0000
committerPascal Terjan <pterjan@mageia.org>2012-04-03 22:12:08 +0000
commita44d50bf39d0594acd0fb9334263953d2600b7ef (patch)
treefca33c2078212c31eec7481cfd82ae48482b929f /lib
parent0eb4f2b8874981e3c04bc6d09856c2de269133d1 (diff)
downloadiurt-a44d50bf39d0594acd0fb9334263953d2600b7ef.tar
iurt-a44d50bf39d0594acd0fb9334263953d2600b7ef.tar.gz
iurt-a44d50bf39d0594acd0fb9334263953d2600b7ef.tar.bz2
iurt-a44d50bf39d0594acd0fb9334263953d2600b7ef.tar.xz
iurt-a44d50bf39d0594acd0fb9334263953d2600b7ef.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Chroot.pm18
1 files changed, 8 insertions, 10 deletions
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)");