aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2014-10-12 22:31:31 +0000
committerPascal Terjan <pterjan@gmail.com>2014-10-12 22:31:31 +0000
commite0663c12dc0dbe367566ba3544b1afa0ee8c965d (patch)
tree6fe8d1360510921f3596048abcdc5022d0cd677b
parentab201ebc3d8b92a77f204634e22566b8351f9319 (diff)
downloadiurt-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--NEWS2
-rwxr-xr-xiurt15
2 files changed, 14 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 05b9c8b..f0c3dfa 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/iurt b/iurt
index 25ea5f2..1227d29 100755
--- a/iurt
+++ b/iurt
@@ -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);
}