Skip to content

Commit d4f6512

Browse files
committed
kbuild: rpm-pkg: use a dummy string for _arch when undefined
If this affects only %{buildroot}, it should be enough to use a fixed string for _arch when it is undefined. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent d5d2d4c commit d4f6512

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/package/mkspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
3636
%define ARCH ${ARCH}
3737
%define KERNELRELEASE ${KERNELRELEASE}
3838
39+
# _arch is undefined if /usr/lib/rpm/platform/*/macros was not included.
40+
%{!?_arch: %define _arch dummy}
3941
%{!?make: %define make make}
4042
%define makeflags %{?_smp_mflags} ARCH=%{ARCH}
4143
@@ -55,9 +57,6 @@ $S BuildRequires: bc binutils bison dwarves
5557
$S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
5658
$S BuildRequires: gcc make openssl openssl-devel perl python3 rsync
5759
58-
# $UTS_MACHINE as a fallback of _arch in case
59-
# /usr/lib/rpm/platform/*/macros was not included.
60-
%{!?_arch: %define _arch $UTS_MACHINE}
6160
%define __spec_install_post /usr/lib/rpm/brp-compress || :
6261
%define debug_package %{nil}
6362

0 commit comments

Comments
 (0)