diff options
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r-- | lib/Iurt/Chroot.pm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index d80fc1b..93c63cd 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -70,13 +70,22 @@ sub clean_chroot { mkdir $chroot; # various integrity checking - return 1 if $o_only_tar && -f "$chroot/home/builder/.rpmmacros" && -d "$chroot/home/builder" && -d "$chroot/proc"; + if ($o_only_tar + && -f "$chroot/home/builder/.rpmmacros" + && -d "$chroot/home/builder" + && -d "$chroot/proc") { + return 1; + } - chdir $chroot; - - system($sudo, 'tar', 'xf', $chroot_tar) and create_build_chroot($chroot, $chroot_tar, $run, $config); + # First try + if (system($sudo, 'tar', '-C', $chroot, '-xf', $chroot_tar)) { + create_build_chroot($chroot, $chroot_tar, $run, $config); + } - create_build_chroot($chroot, $chroot_tar, $run, $config) if !-d "$chroot/proc" || !-d "$chroot/home/builder"; + # <mrl> 20071106 Second try? + if (!-d "$chroot/proc" || !-d "$chroot/home/builder") { + create_build_chroot($chroot, $chroot_tar, $run, $config) + } if (!dump_rpmmacros($run, $config, "$chroot/home/builder/.rpmmacros")) { plog ('ERROR', "Failed to dump macros"); |