aboutsummaryrefslogtreecommitdiffstats
path: root/ulri
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2022-04-26 13:25:56 +0000
committerPascal Terjan <pterjan@mageia.org>2022-04-26 15:22:14 +0000
commitc5778711ae16c34ba16e3ba87e1fff5e79587efc (patch)
treeae55c3974d6289dd20d46047ac6753dcf88f0951 /ulri
parentd8254dd4754100edff0269cac433faa2168be3fc (diff)
downloadiurt-c5778711ae16c34ba16e3ba87e1fff5e79587efc.tar
iurt-c5778711ae16c34ba16e3ba87e1fff5e79587efc.tar.gz
iurt-c5778711ae16c34ba16e3ba87e1fff5e79587efc.tar.bz2
iurt-c5778711ae16c34ba16e3ba87e1fff5e79587efc.tar.xz
iurt-c5778711ae16c34ba16e3ba87e1fff5e79587efc.zip
ulri: Remove duplication on loading lock file
Diffstat (limited to 'ulri')
-rwxr-xr-xulri12
1 files changed, 3 insertions, 9 deletions
diff --git a/ulri b/ulri
index aea8f68..bbce305 100755
--- a/ulri
+++ b/ulri
@@ -25,7 +25,7 @@ use Iurt::Config qw(config_usage get_date config_init get_author_email get_targe
use Iurt::File qw(create_file);
use Iurt::Mail qw(sendmail);
use Iurt::Process qw(check_pid);
-use Iurt::Queue qw(check_if_mandatory_arch_failed cleanup_failed_build get_upload_tree_state);
+use Iurt::Queue qw(check_if_mandatory_arch_failed cleanup_failed_build get_upload_tree_state load_lock_file_data remove_bot_from_package);
use Iurt::RPM qw(check_arch check_noarch);
use Iurt::Util qw(plog_init plog ssh_setup ssh sout sget sput);
use Iurt::Ulri qw(build_package warn_about_failure);
@@ -314,7 +314,7 @@ foreach my $prefix (keys %pkg_tree) {
unlink $lock_file;
$run{bot}{$host}{$bot} = 0;
- $ent->{media}{$media}{bot} = grep { $_->{pid} ne $pid || $_->{host} ne $host } @{$ent->{media}{$media}{bot}};
+ remove_bot_from_package($ent, $media, $host, $pid);
if (!$status) {
# TODO: fetch/clean the logs
@@ -543,13 +543,6 @@ foreach my $prefix (sort keys %pkg_tree) {
if ($pid) {
# Register that the package is building
$run{bot}{$host}{$bot} = $prefix;
- push @{$pkg_tree{$prefix}{media}{$media}{bot}}, {
- bot => $bot,
- host => $host,
- date => $fulldate,
- pid => $pid,
- 'arch' => $arch,
- };
$pkg_tree{$prefix}{media}{$media}{arch}{$noarch ? 'noarch' : $arch} = 1;
my $lock_arch = $noarch ? "$arch-noarch" : $arch;
@@ -557,6 +550,7 @@ foreach my $prefix (sort keys %pkg_tree) {
"$lock_arch.$bot.$host.$fulldate.$pid.lock";
plog('DEBUG', "create lock $lock_file");
create_file($lock_file, "$program_name $$", time());
+ load_lock_file_data(\%{$pkg_tree{$prefix}}, $lock_file, $media, $config);
last hosts;
}