diff options
author | Terje Rosten <terje.rosten@oracle.com> | 2016-10-24 13:11:34 +0200 |
---|---|---|
committer | Terje Rosten <terje.rosten@oracle.com> | 2016-10-24 13:11:34 +0200 |
commit | 63b2c9765068d82fc1ee3932ce21f9330eef4b55 (patch) | |
tree | 8744a8bbc7a6dbc1ce2b2a392b8e42aa85092f28 /packaging | |
parent | 149212772804e93983f80b63099ba9e1241ddf4f (diff) | |
download | mariadb-git-63b2c9765068d82fc1ee3932ce21f9330eef4b55.tar.gz |
Bug#24925181 INCORRECT ISA DETECTION CODE IN OEL RPM SPEC
Wrapper for mysql_config used in multilib installs modified to work as
intended, added more archs (aarch64, ppc64le, s390x, s390, sparc and
sparc64) to lists in fallback mode and use same script for EL and
Fedora.
Thanks to Alexey Kopytov for report and fix.
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/rpm-oel/mysql_config.sh | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/packaging/rpm-oel/mysql_config.sh b/packaging/rpm-oel/mysql_config.sh index abe46e0ed74..8044ed44164 100644 --- a/packaging/rpm-oel/mysql_config.sh +++ b/packaging/rpm-oel/mysql_config.sh @@ -2,22 +2,30 @@ # # Wrapper script for mysql_config to support multilib # -# Only works on OEL6/RHEL6 and similar # -# This command respects setarch +# This command respects setarch, works on OL6/RHEL6 and later bits=$(rpm --eval %__isa_bits) case $bits in - 32|64) status=known ;; - *) status=unknown ;; + 32|64) ;; + *) bits=unknown ;; esac -if [ "$status" = "unknown" ] ; then - echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits" - exit 1 +# Try mapping by uname if rpm command failed +if [ "$bits" = "unknown" ] ; then + arch=$(uname -m) + case $arch in + x86_64|ppc64|ppc64le|aarch64|s390x|sparc64) bits=64 ;; + i386|i486|i586|i686|pentium3|pentium4|athlon|ppc|s390|sparc) bits=32 ;; + *) bits=unknown ;; + esac fi +if [ "$bits" == "unknown" ] ; then + echo "$0: error: failed to determine isa bits on your arch." + exit 1 +fi if [ -x /usr/bin/mysql_config-$bits ] ; then /usr/bin/mysql_config-$bits "$@" @@ -25,4 +33,3 @@ else echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation." exit 1 fi - |