From 595de8349165867187bc3b1c87a2da01dd5a9893 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 1 Dec 2009 18:45:47 +0000 Subject: Add a --delete-on-success for the cases where we only want failure logs --- iurt2 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'iurt2') diff --git a/iurt2 b/iurt2 index 93b2b7c..08ee704 100755 --- a/iurt2 +++ b/iurt2 @@ -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, "", "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 -- cgit v1.2.1