diff options
author | Pascal Terjan <pterjan@gmail.com> | 2014-10-12 22:31:31 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2014-10-12 22:31:31 +0000 |
commit | e0663c12dc0dbe367566ba3544b1afa0ee8c965d (patch) | |
tree | 6fe8d1360510921f3596048abcdc5022d0cd677b | |
parent | ab201ebc3d8b92a77f204634e22566b8351f9319 (diff) | |
download | iurt-e0663c12dc0dbe367566ba3544b1afa0ee8c965d.tar iurt-e0663c12dc0dbe367566ba3544b1afa0ee8c965d.tar.gz iurt-e0663c12dc0dbe367566ba3544b1afa0ee8c965d.tar.bz2 iurt-e0663c12dc0dbe367566ba3544b1afa0ee8c965d.tar.xz iurt-e0663c12dc0dbe367566ba3544b1afa0ee8c965d.zip |
behave better when local_spool is out of space
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | iurt | 15 |
2 files changed, 14 insertions, 3 deletions
@@ -1,4 +1,6 @@ - remove old src.rpm before recreating it (mga#14243) +- delete potentially incomplete files when copying to local_spool + fails (like when disk is full) 0.6.22 - don't close stdin if --stop is used (mga#13318) @@ -929,15 +929,24 @@ retry: system("rm -rf $local_spool/log/$srpm/"); } elsif (!$run{discard_packages}) { plog('OK', "build successful, copying packages to $local_spool."); - - system("cp $chroot_tmp/home/$luser/rpmbuild/RPMS/*/*.rpm $local_spool &>/dev/null") and plog('ERROR', "ERROR: could not copy rpm files from $chroot_tmp/home/$luser/rpmbuild/RPMS/ 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 + 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 ($!)"); + } } if ($run{copy_srpm}) { # replace the old srpm unlink "$local_spool/$old_srpm"; - system("cp $chroot_tmp/home/$luser/rpmbuild/SRPMS/$srpm $local_spool &>/dev/null") and plog('ERROR', "ERROR: could not copy $srpm from $chroot_tmp/home/$luser/rpmbuild/SRPMS/ to $local_spool ($!)"); + 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"; + plog('ERROR', "ERROR: could not copy $srpm from $chroot_tmp/home/$luser/rpmbuild/SRPMS/ to $local_spool ($!)"); + } } process_queue($config, \%run, \@wrong_rpm, 1); } |