aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rwxr-xr-xiurt3
-rw-r--r--lib/Iurt/Config.pm45
-rw-r--r--lib/Iurt/RPM.pm55
-rwxr-xr-xulri5
5 files changed, 62 insertions, 48 deletions
diff --git a/NEWS b/NEWS
index 1304e13..6b2aee5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- iurt: allow building arm v5 and v7 on armv8l
+- move check_{no,}arch from Config into a new RPM module. They have nothing
+ to do with the config and work on an RPM file.
0.7.10
- ulri: allow - in host when parsing lock file name
diff --git a/iurt b/iurt
index d7d72e3..fd01672 100755
--- a/iurt
+++ b/iurt
@@ -34,7 +34,7 @@
use strict;
use RPM4::Header;
-use Iurt::Config qw(config_usage get_date get_prefix config_init get_maint check_arch %arch_comp get_package_prefix);
+use Iurt::Config qw(config_usage get_date get_prefix config_init get_maint %arch_comp get_package_prefix);
use Data::Dumper;
use URPM;
@@ -42,6 +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::Util qw(plog_init plog);
use File::NCopy qw(copy);
use File::Path qw(mkpath);
diff --git a/lib/Iurt/Config.pm b/lib/Iurt/Config.pm
index 1600e5b..3b8bbe1 100644
--- a/lib/Iurt/Config.pm
+++ b/lib/Iurt/Config.pm
@@ -1,7 +1,6 @@
package Iurt::Config;
use base qw(Exporter);
-use RPM4::Header;
use Data::Dumper;
use MDK::Common;
use Iurt::Util qw(plog);
@@ -17,8 +16,6 @@ our @EXPORT = qw(
get_date
get_prefix
get_author_email
- check_arch
- check_noarch
get_package_prefix
get_mandatory_arch
get_target_arch
@@ -149,48 +146,6 @@ sub get_author_email {
return $authoremail;
}
-sub check_noarch {
- my ($rpm) = @_;
- my $hdr = RPM4::Header->new($rpm);
-
- # Stupid rpm doesn't return an empty list so we must check for (none)
-
- my ($build_archs) = $hdr->queryformat('%{BUILDARCHS}');
-
- if ($build_archs ne '(none)') {
- ($build_archs) = $hdr->queryformat('[%{BUILDARCHS} ]');
- my @list = split ' ', $build_archs;
- return 1 if member('noarch', @list);
- }
-
- return 0;
-}
-
-sub check_arch {
- my ($rpm, $arch) = @_;
- my $hdr = RPM4::Header->new($rpm);
-
- # Stupid rpm doesn't return an empty list so we must check for (none)
-
- my ($exclusive_arch) = $hdr->queryformat('%{EXCLUSIVEARCH}');
-
- if ($exclusive_arch ne '(none)') {
- ($exclusive_arch) = $hdr->queryformat('[%{EXCLUSIVEARCH} ]');
- my @list = split ' ', $exclusive_arch;
- return 0 unless member($arch, @list);
- }
-
- my ($exclude_arch) = $hdr->queryformat('[%{EXCLUDEARCH} ]');
-
- if ($exclude_arch ne '(none)') {
- ($exclude_arch) = $hdr->queryformat('[%{EXCLUDEARCH} ]');
- my @list = split ' ', $exclude_arch;
- return 0 if member($arch, @list);
- }
-
- return 1;
-}
-
sub get_mandatory_arch {
my ($config, $target) = @_;
find { ref($_) eq 'ARRAY' } $config->{mandatory_arch},
diff --git a/lib/Iurt/RPM.pm b/lib/Iurt/RPM.pm
new file mode 100644
index 0000000..de09ba4
--- /dev/null
+++ b/lib/Iurt/RPM.pm
@@ -0,0 +1,55 @@
+package Iurt::RPM;
+
+use base qw(Exporter);
+use RPM4::Header;
+use MDK::Common;
+use strict;
+
+our @EXPORT = qw(
+ check_arch
+ check_noarch
+);
+
+sub check_noarch {
+ my ($rpm) = @_;
+ my $hdr = RPM4::Header->new($rpm);
+
+ # Stupid rpm doesn't return an empty list so we must check for (none)
+
+ my ($build_archs) = $hdr->queryformat('%{BUILDARCHS}');
+
+ if ($build_archs ne '(none)') {
+ ($build_archs) = $hdr->queryformat('[%{BUILDARCHS} ]');
+ my @list = split ' ', $build_archs;
+ return 1 if member('noarch', @list);
+ }
+
+ return 0;
+}
+
+sub check_arch {
+ my ($rpm, $arch) = @_;
+ my $hdr = RPM4::Header->new($rpm);
+
+ # Stupid rpm doesn't return an empty list so we must check for (none)
+
+ my ($exclusive_arch) = $hdr->queryformat('%{EXCLUSIVEARCH}');
+
+ if ($exclusive_arch ne '(none)') {
+ ($exclusive_arch) = $hdr->queryformat('[%{EXCLUSIVEARCH} ]');
+ my @list = split ' ', $exclusive_arch;
+ return 0 unless member($arch, @list);
+ }
+
+ my ($exclude_arch) = $hdr->queryformat('[%{EXCLUDEARCH} ]');
+
+ if ($exclude_arch ne '(none)') {
+ ($exclude_arch) = $hdr->queryformat('[%{EXCLUDEARCH} ]');
+ my @list = split ' ', $exclude_arch;
+ return 0 if member($arch, @list);
+ }
+
+ return 1;
+}
+
+1;
diff --git a/ulri b/ulri
index 2c33ac6..7f61efb 100755
--- a/ulri
+++ b/ulri
@@ -21,11 +21,12 @@
use strict;
use MDK::Common qw(any cat_ if_ find);
-use Iurt::Config qw(config_usage get_date config_init get_author_email check_arch check_noarch get_target_arch get_mandatory_arch);
+use Iurt::Config qw(config_usage get_date config_init get_author_email get_target_arch get_mandatory_arch);
use Iurt::File qw(create_file);
+use Iurt::Mail qw(sendmail);
use Iurt::Process qw(check_pid);
use Iurt::Queue qw(check_if_mandatory_arch_failed cleanup_failed_build get_upload_tree_state);
-use Iurt::Mail qw(sendmail);
+use Iurt::RPM qw(check_arch check_noarch);
use Iurt::Util qw(plog_init plog ssh_setup ssh sout sget sput);
use Iurt::Ulri qw(build_package warn_about_failure);
use File::Copy 'move';