aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-12-19 17:24:04 +0000
committerPascal Terjan <pterjan@mageia.org>2020-12-19 17:28:16 +0000
commit2dd2e2c578c528e6ba1b36de8afb560145708f10 (patch)
tree5f1019a87dff301312e222995d96336cf0226a7e
parentab4ad3363efedf629f47100634a5b8d0a66b7fbf (diff)
downloadiurt-2dd2e2c578c528e6ba1b36de8afb560145708f10.tar
iurt-2dd2e2c578c528e6ba1b36de8afb560145708f10.tar.gz
iurt-2dd2e2c578c528e6ba1b36de8afb560145708f10.tar.bz2
iurt-2dd2e2c578c528e6ba1b36de8afb560145708f10.tar.xz
iurt-2dd2e2c578c528e6ba1b36de8afb560145708f10.zip
iurt: use --target noarch for noarch packages
We were using --target <arch of the chroot used to build>
-rw-r--r--NEWS3
-rwxr-xr-xiurt8
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);