From cfcd4507544f1c57802925255ecdfb9234f1feee Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 13 Nov 2022 18:39:34 +0000 Subject: Increase robustness when scp fails Do not remove lock file and mark build as done until we copied all the files. --- lib/Iurt/Ulri.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Iurt/Ulri.pm') diff --git a/lib/Iurt/Ulri.pm b/lib/Iurt/Ulri.pm index 6d4e38f..f2e014c 100755 --- a/lib/Iurt/Ulri.pm +++ b/lib/Iurt/Ulri.pm @@ -12,6 +12,7 @@ use strict; our @EXPORT = qw( build_package + fetch_logs_and_cleanup warn_about_failure ); @@ -144,6 +145,13 @@ sub get_pid_from_file { $pid; } +sub fetch_logs_and_cleanup { + my ($remote, $remote_dir, $target_dir) = @_; + make_path($target_dir); + sget($remote, "$remote_dir/log/*", $target_dir); + ssh($remote, "rm -rf $remote_dir"); +} + sub warn_about_failure { my ($config, $user, $ent, $arch, $fail_dir, $path, $prefix) = @_; my $text = join("\n", "Build of the following packages failed:\n", map { "- $_" } @{$ent->{srpms}}) . "\n"; -- cgit v1.2.1