From 734e71dcdff4d0acd7e24582ac4a32d57a91caa0 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 25 Nov 2010 23:32:57 +0000 Subject: simplify --- lib/Iurt/Chroot.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 57b5a68..da590ab 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -425,7 +425,6 @@ sub create_chroot { plog('NOTIFY', "creating chroot"); plog('DEBUG', "... with packages " . join(', ', @{$opt->{packages}})); - if (!-f $chroot_tar || link $chroot_tar, $tmp_tar) { mkdir_p($tmp_chroot); if (!-f $chroot_tar) { plog("rebuild chroot tarball"); @@ -437,6 +436,8 @@ sub create_chroot { return; } } else { + link $chroot_tar, $tmp_tar or die "FATAL: could not initialize chroot ($!)\n"; + plog('DEBUG', "decompressing /var/log/qa from $chroot_tar in $tmp_chroot"); sudo($run, $config, '--untar', $chroot_tar, $tmp_chroot, "./var/log/qa"); @@ -473,9 +474,6 @@ sub create_chroot { } } link $tmp_tar, $chroot_tar; - } else { - die "FATAL: could not initialize chroot ($!)\n"; - } if (!-d $chroot || $rebuild) { plog('DEBUG', "recreate chroot $chroot"); -- cgit v1.2.1