From b207fdf369fc8681f5991ad4b536cd81f0638256 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 11 Dec 2012 20:32:35 +0000 Subject: Update srpm name, rebuild_one may change it --- NEWS | 1 + iurt | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index 440537c..237ebca 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - fix chroot cleaning in parallel mode +- fix for some packages missing from status file 0.6.15 - fix status file in parallel mode diff --git a/iurt b/iurt index 11f7bf6..61d10c4 100755 --- a/iurt +++ b/iurt @@ -771,7 +771,7 @@ sub rebuild_one { # When rebuilding all the media, src.rpm can be removed from mirror before we work on them unless (-f "$dir/$srpm") { $run{status}{$srpm} = 'missing'; - return; + return $srpm; } # FIXME unfortunately urpmi stalls quite often my $retry = 0; @@ -781,14 +781,14 @@ retry: if (!$run{use_old_chroot}) { $chroot_tmp = create_temp_chroot(\%run, $config, - $chroot_tmp, $chroot_ref) or return; + $chroot_tmp, $chroot_ref) or return $srpm; } if (!$urpmi->urpmi_command($chroot_tmp)) { plog('DEBUG', "Creating chroot failed.\nCommand was: $chroot_tmp"); - return; + return $srpm; } - $srpm =~ /(.*)-[^-]+-[^-]+\.src\.rpm$/ or return; + $srpm =~ /(.*)-[^-]+-[^-]+\.src\.rpm$/ or return $srpm; my ($maintainer, $cc); if (!$run{warn}) { ($maintainer) = get_maint(\%run, $srpm); @@ -802,7 +802,7 @@ retry: #($maintainer, $cc) = ($config->{admin},''); plog('DEBUG', "creating user $luser in chroot"); - add_local_user($chroot_tmp, \%run, $config, $luser, $run{uid}) or return; + add_local_user($chroot_tmp, \%run, $config, $luser, $run{uid}) or return $srpm; my $old_srpm = $srpm; my ($ret, $spec); @@ -822,7 +822,7 @@ retry: # $srpm = $old_srpm; $run{status}{$srpm} = 'recreate_srpm_failure'; - return; + return $srpm; } (my $log_dirname = $srpm) =~ s/.*:(.*)\.src.rpm/$1/; @@ -842,7 +842,7 @@ retry: my $ok = $urpmi->install_packages($srpm, $chroot_tmp, $local_spool, \%pack_provide, 'install_deps', "[REBUILD] install of build dependencies of $srpm failed on $run{my_arch}", { maintainer => $maintainer }, "$path_srpm/$srpm"); if (!$ok) { $run{status}{$srpm} ||= 'install_deps_failure'; - return; + return $srpm; } # try to workarround the rpm -qa db4 error(2) from dbcursor->c_get: @@ -912,14 +912,14 @@ retry: $opt->{error} = "[MISSING_BUILD_REQUIRES_TAG] $missing-devel, needed to build $srpm, is not in buildrequires"; } $cache->{buildrequires}{$srpm}{$missing} = \@rpm; - return; + return $srpm; } 1; }, freq => 1)) { $run{status}{$srpm} = 'build_failure'; - return; + return $srpm; } # do some cleaning if the compilation is successful @@ -929,7 +929,7 @@ retry: opendir my $binfh, "$chroot_tmp/home/$luser/rpmbuild/RPMS/"; my @packages; foreach my $bindir (readdir $binfh) { - -d "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir" or return; + -d "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir" or return $srpm; opendir my $rpmfh, "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir"; push @packages, map { "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir/$_" } grep { !/src\.rpm$/ && /\.rpm$/ } readdir $rpmfh; } @@ -938,7 +938,7 @@ retry: # segfaulting when trying to install packages if ($config->{check_binary_file}) { - $urpmi->install_packages($srpm, $chroot_tmp, $local_spool, \%pack_provide, 'binary_test', "[REBUILD] binaries packages generated from $srpm do not install correctly", { maintainer => $maintainer } ,@packages) or return; + $urpmi->install_packages($srpm, $chroot_tmp, $local_spool, \%pack_provide, 'binary_test', "[REBUILD] binaries packages generated from $srpm do not install correctly", { maintainer => $maintainer } ,@packages) or return $srpm; } else { my $successfile = "$local_spool/log/$srpm/binary_test_$srpm-1.log"; open my $f, ">$successfile"; @@ -972,7 +972,7 @@ retry: } process_queue($config, \%run, \@wrong_rpm, 1); } - return 1; + return $srpm; } my $rebuild; @@ -1020,7 +1020,7 @@ do { $children{$pid} = 1; } elsif ($pid == 0) { #child $chroot_tmp .= "_" . int($i); - rebuild_one($dir, $srpm, $status); + $srpm = rebuild_one($dir, $srpm, $status); write_status($local_spool, \%run, $srpm); clean_chroot($chroot_tmp, \%run, $config); exit(); @@ -1028,8 +1028,8 @@ do { die "could not fork"; } } else { - rebuild_one($dir, $srpm, $status); - write_status($local_spool, \%run, $srpm); + $srpm = rebuild_one($dir, $srpm, $status); + write_status($local_spool, \%run, $new_srpm); } } if ($run{parallel}) { -- cgit v1.2.1