2013-11-07 04:25:34 +00:00
|
|
|
#!/bin/bash
|
2013-02-13 22:16:00 +00:00
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-04-03 02:24:15 +00:00
|
|
|
set -eu
|
2014-03-29 03:28:22 +00:00
|
|
|
set -o pipefail
|
|
|
|
|
2013-02-13 22:16:00 +00:00
|
|
|
if [ "i386" = "$ARCH" ]; then
|
2014-05-02 17:02:38 +00:00
|
|
|
basearch=i386
|
|
|
|
arch=i686
|
2016-11-01 14:19:44 +00:00
|
|
|
elif [[ "amd64 x86_64" =~ "$ARCH" ]]; then
|
2014-05-02 17:02:38 +00:00
|
|
|
basearch=x86_64
|
|
|
|
arch=x86_64
|
2015-01-22 06:34:27 +00:00
|
|
|
elif [[ "$ARCH" = "ppc64" ]]; then
|
|
|
|
basearch=ppc64
|
|
|
|
arch=ppc64
|
2017-04-12 05:26:27 +00:00
|
|
|
elif [[ "$ARCH" = "ppc64le" ]]; then
|
|
|
|
basearch=ppc64le
|
|
|
|
arch=ppc64le
|
2017-01-18 20:49:20 +00:00
|
|
|
elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then
|
2016-11-17 02:47:26 +00:00
|
|
|
basearch=aarch64
|
|
|
|
arch=aarch64
|
2013-02-13 22:16:00 +00:00
|
|
|
else
|
2014-05-02 17:02:38 +00:00
|
|
|
echo "********************"
|
|
|
|
echo "Unknown arch '$ARCH'"
|
|
|
|
echo "********************"
|
|
|
|
exit 1
|
2013-02-13 22:16:00 +00:00
|
|
|
fi
|
|
|
|
|
2019-09-25 04:05:18 +00:00
|
|
|
if [[ ${YUM} == "dnf" ]]; then
|
2015-05-27 04:53:04 +00:00
|
|
|
mkdir -p /etc/dnf/vars
|
|
|
|
echo $basearch > /etc/dnf/vars/basearch
|
2016-11-17 08:36:54 +00:00
|
|
|
echo $arch > /etc/dnf/vars/arch
|
2015-05-27 04:53:04 +00:00
|
|
|
else
|
|
|
|
echo $basearch > /etc/yum/vars/basearch
|
|
|
|
echo $arch > /etc/yum/vars/arch
|
|
|
|
fi
|
2018-05-14 03:30:52 +00:00
|
|
|
|
|
|
|
if [[ ${DISTRO_NAME} =~ "centos" ]]; then
|
|
|
|
if [[ ${arch} == "x86_64" ]]; then
|
|
|
|
contentdir=centos
|
|
|
|
else
|
|
|
|
contentdir=altarch
|
|
|
|
fi
|
2019-09-25 04:05:18 +00:00
|
|
|
echo $contentdir > /etc/${YUM}/vars/contentdir
|
2018-05-14 03:30:52 +00:00
|
|
|
fi
|