aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2025-03-24 19:41:27 +0000
committerPascal Terjan <pterjan@mageia.org>2025-03-24 19:41:27 +0000
commit59d7c30435f20597d410d4ba79639ce67ad2adfa (patch)
tree5da51288ad740caf34a7970d23c9041d54b44df7 /lib
parentbaee8fd172f2996b361ad68002476a7460f3e406 (diff)
downloadiurt-master.tar
iurt-master.tar.gz
iurt-master.tar.bz2
iurt-master.tar.xz
iurt-master.zip
Iurt: Fix getting srpm when stdout is pollutedHEADmaster
If parsing the spec causes something to be printed, it ends up in stdout together with the result of the query: rpmspec -q --qf %{NVR}.src.rpm --srpm SPECS/golang-x-vuln.spec 2>/dev/null Setting %{thisgofilelist} = devel.file-list Setting %{currentgoipath} = golang.org/x/vuln Setting %{currentgosourcedir} = /home/pterjan/rpmbuild/BUILD/golang-x-vuln-1.1.4-build/vuln-1.1.4 Setting %{currentgofilelist} = devel.file-list Setting %{currentversion} = 1.1.4 Setting %{currentgoldflags} =  -X golang.org/x/vuln/version=1.1.4 golang-x-vuln-1.1.4-1.mga10.src.rpm Work around this by keeping only the last line
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Urpmi.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index aa14c57..a5162ce 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -449,7 +449,7 @@ sub get_srpm_name {
$log_spool_existed = 0;
mkdir $log_spool;
}
- 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"),
+ if (!perform_command(qq(chroot $chroot_tmp su $luser -c "rpmspec -q --qf %{NVR}.src.rpm --srpm /home/$luser/rpmbuild/SPECS/$spec | tail -n1 > /home/$luser/rpmbuild/SPECS/$spec.srpm_name"),
$run, $config,
use_iurt_root_command => 1,
log => $log_spool,
@@ -596,7 +596,6 @@ sub install_dynamic_buildrequires {
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.
# We can however tell it that error 11 (missing BuildRequires) is ok so
@@ -631,7 +630,7 @@ sub install_dynamic_buildrequires {
unlink("$chroot_tmp/home/$luser/rpmbuild/SRPMS/$nosrc");
} else {
# This was a failure for another reason, no point retrying
- plog('ERROR', "Failed to generate dynamic BuildRequires.");
+ plog('ERROR', "Failed to generate dynamic BuildRequires ($chroot_tmp/home/$luser/rpmbuild/SRPMS/$nosrc does not exist).");
$run->{status}{$srpm} = 'build_failure';
return 0;
}