aboutsummaryrefslogtreecommitdiffstats
path: root/iurt2
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-12-01 18:45:47 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-12-01 18:45:47 +0000
commit595de8349165867187bc3b1c87a2da01dd5a9893 (patch)
tree9436d396e6965f114c3078f990015392d0c0fc9a /iurt2
parent6b2e47d098665bfe3ca8ac3693e475ee4ca6ac49 (diff)
downloadiurt-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-xiurt212
1 files changed, 10 insertions, 2 deletions
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, "<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