From 69e09eb883ee3587d92596f281c88c6d999fdbc9 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 12 Oct 2014 23:36:02 +0000 Subject: Display errors before risking overwriting them --- iurt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iurt b/iurt index b8e9e1b..dea9b44 100755 --- a/iurt +++ b/iurt @@ -931,10 +931,10 @@ retry: plog('OK', "build successful, copying packages to $local_spool."); if (system("cp $chroot_tmp/home/$luser/rpmbuild/RPMS/*/*.rpm $local_spool &>/dev/null")) { # If copy fails (like disk full), report a failure and delete partially copied files + plog('ERROR', "ERROR: could not copy rpm files from $chroot_tmp/home/$luser/rpmbuild/RPMS/ to $local_spool ($!)"); for my $package (@packages) { unlink "$local_spool/$package"; } - plog('ERROR', "ERROR: could not copy rpm files from $chroot_tmp/home/$luser/rpmbuild/RPMS/ to $local_spool ($!)"); } } @@ -943,9 +943,9 @@ retry: unlink "$local_spool/$old_srpm"; if (system("cp $chroot_tmp/home/$luser/rpmbuild/SRPMS/$srpm $local_spool &>/dev/null")) { - # If copy fails (like disk full), remove partially copied file and report a failure - unlink "$local_spool/$srpm"; + # If copy fails (like disk full), remove partially copied file plog('ERROR', "ERROR: could not copy $srpm from $chroot_tmp/home/$luser/rpmbuild/SRPMS/ to $local_spool ($!)"); + unlink "$local_spool/$srpm"; } } process_queue($config, \%run, \@wrong_rpm, 1); -- cgit v1.2.1