diff options
author | Pascal Terjan <pterjan@mandriva.org> | 2009-12-01 18:45:47 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mandriva.org> | 2009-12-01 18:45:47 +0000 |
commit | 595de8349165867187bc3b1c87a2da01dd5a9893 (patch) | |
tree | 9436d396e6965f114c3078f990015392d0c0fc9a /iurt2 | |
parent | 6b2e47d098665bfe3ca8ac3693e475ee4ca6ac49 (diff) | |
download | iurt-595de8349165867187bc3b1c87a2da01dd5a9893.tar iurt-595de8349165867187bc3b1c87a2da01dd5a9893.tar.gz iurt-595de8349165867187bc3b1c87a2da01dd5a9893.tar.bz2 iurt-595de8349165867187bc3b1c87a2da01dd5a9893.tar.xz iurt-595de8349165867187bc3b1c87a2da01dd5a9893.zip |
Add a --delete-on-success for the cases where we only want failure logs
Diffstat (limited to 'iurt2')
-rwxr-xr-x | iurt2 | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -266,6 +266,9 @@ $run{todo} = []; [ "", "no_rsync", 0, "", "Do not send build log to the distant rsync server", sub { $run{no_rsync} = 1 }, "Setting the no rsync warn flag" ], + [ "", "delete-on-success", 0, "", + "Don't keep generated packages and their logs", + sub { $run{delete_on_success} = 1 }, "Setting the delete on success flag" ], [ "", "use-system-distrib", 1, "<media>", "Use the current system urpmi configuration", sub { $run{use_system_distrib} = shift; 1 }, "Setting system distrib for urpmi configuration" ], @@ -1056,9 +1059,14 @@ retry: $run{done}{$srpm} = $done; $urpmi->add_to_local_media($chroot_tmp, $srpm, $luser); } else { - plog('OK', "build successful, copying packages to $local_spool."); + # drop packages and logs if we only want failure logs + if($run{delete_on_success}) { + system("rm -rf $local_spool/log/$srpm/"); + } else { + plog('OK', "build successful, copying packages to $local_spool."); - system("cp $chroot_tmp/home/$luser/rpm/RPMS/*/*.rpm $local_spool &>/dev/null") and plog('ERR', "ERROR: could not copy rpm files from $chroot_tmp/home/$luser/rpm/RPMS/ to $local_spool ($!)"); + system("cp $chroot_tmp/home/$luser/rpm/RPMS/*/*.rpm $local_spool &>/dev/null") and plog('ERR', "ERROR: could not copy rpm files from $chroot_tmp/home/$luser/rpm/RPMS/ to $local_spool ($!)"); + } if ($run{copy_srpm}) { # replace the old srpm |