From fff6b7df49063a3f7cbd42c2c2f87a9b6563cab2 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Thu, 19 Jan 2023 23:57:33 +0000 Subject: [PATCH] iurt: Fix buildreqs.nosrc.rpm filename on Mageia build system --- NEWS | 2 ++ lib/Iurt/Urpmi.pm | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1c548ec..d60fdec 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- iurt: Fix buildreqs.nosrc.rpm filename on Mageia build system + 0.8.0 - iurt: Add support for DynamicBuildRequires - ulri: Do not remove lock file and mark build as done until we copied the diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index 0f084c9..aec4f87 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -566,7 +566,19 @@ sub install_dynamic_buildrequires { return 1; } - my $nosrc = $srpm =~ s/src.rpm$/buildreqs.nosrc.rpm/r; + if (!perform_command(qq(chroot $chroot_tmp su $luser -c "rpmspec -q --qf %{NVR}.src.rpm --srpm /home/$luser/rpmbuild/SPECS/$spec > /home/$luser/rpmbuild/SPECS/$spec.srpm_name"), + $run, $config, + use_iurt_root_command => 1, + hash => "identify_$srpm")) { + plog("ERROR: failed to get the name of the generated src.rpm"); + return; + } + my $new_srpm = cat_("$chroot_tmp/home/$luser/rpmbuild/SPECS/$spec.srpm_name"); + if (!$new_srpm) { + plog("ERROR: failed to get the name of the generated src.rpm"); + return; + } + my $nosrc = $new_srpm =~ s/src.rpm$/buildreqs.nosrc.rpm/r; while (1) { # There is no way with perform_command to get the actual error code. -- 2.39.1