Skip to content

Commit 63b2c97

Browse files
committed
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.
1 parent 1492127 commit 63b2c97

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

packaging/rpm-oel/mysql_config.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@
22
#
33
# Wrapper script for mysql_config to support multilib
44
#
5-
# Only works on OEL6/RHEL6 and similar
65
#
7-
# This command respects setarch
86

7+
# This command respects setarch, works on OL6/RHEL6 and later
98
bits=$(rpm --eval %__isa_bits)
109

1110
case $bits in
12-
32|64) status=known ;;
13-
*) status=unknown ;;
11+
32|64) ;;
12+
*) bits=unknown ;;
1413
esac
1514

16-
if [ "$status" = "unknown" ] ; then
17-
echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits"
18-
exit 1
15+
# Try mapping by uname if rpm command failed
16+
if [ "$bits" = "unknown" ] ; then
17+
arch=$(uname -m)
18+
case $arch in
19+
x86_64|ppc64|ppc64le|aarch64|s390x|sparc64) bits=64 ;;
20+
i386|i486|i586|i686|pentium3|pentium4|athlon|ppc|s390|sparc) bits=32 ;;
21+
*) bits=unknown ;;
22+
esac
1923
fi
2024

25+
if [ "$bits" == "unknown" ] ; then
26+
echo "$0: error: failed to determine isa bits on your arch."
27+
exit 1
28+
fi
2129

2230
if [ -x /usr/bin/mysql_config-$bits ] ; then
2331
/usr/bin/mysql_config-$bits "$@"
2432
else
2533
echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation."
2634
exit 1
2735
fi
28-

0 commit comments

Comments
 (0)