From 2dd2e2c578c528e6ba1b36de8afb560145708f10 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sat, 19 Dec 2020 17:24:04 +0000 Subject: iurt: use --target noarch for noarch packages We were using --target --- NEWS | 3 +++ iurt | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 3ff437d..ac84d10 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- iurt: use --target noarch for noarch packages rather than the arch used to + built them. + 0.7.15 - iurt: always use urpmi --urpmi-root - iurt: add arch to all log files diff --git a/iurt b/iurt index a47f8e7..e9952fc 100755 --- a/iurt +++ b/iurt @@ -42,7 +42,7 @@ use Iurt::Urpmi; use Iurt::Chroot qw(add_local_user create_temp_chroot remove_chroot create_build_chroot clean_chroot); use Iurt::Process qw(perform_command kill_for_good sudo); use Iurt::Mail qw(sendmail); -use Iurt::RPM qw(check_arch); +use Iurt::RPM qw(check_arch check_noarch); use Iurt::Util qw(plog_init plog); use File::NCopy qw(copy); use File::Path qw(mkpath); @@ -803,7 +803,11 @@ retry: debug_mail => $run{debug}, log => $log_dir); # or next; As this failed quite often, do not stop plog('NOTIFY', "Building $srpm"); - my $command = "rpmbuild --target $run{my_arch} --rebuild $run{with_flags} /home/$luser/rpmbuild/SRPMS/$srpm"; + my $target_arch = $run{my_arch}; + if (check_noarch("$path_srpm/$srpm")) { + $target_arch = 'noarch'; + } + my $command = "rpmbuild --target $target_arch --rebuild $run{with_flags} /home/$luser/rpmbuild/SRPMS/$srpm"; if ($run{stop}) { $urpmi->install_packages('chroot', $chroot_tmp, $local_spool, 'configure', "[ADMIN] installation of urpmi and sudo failed in the chroot $run{my_arch}", { check => 1, maintainer => $config->{admin} }, 'urpmi', 'sudo'); add_sudoers($chroot_tmp, $luser); -- cgit v1.2.1