diskimage-builder/elements/rpm-distro/pre-install.d/01-override-yum-arch
Ian Wienand b183e024ba Work around yum/dnf differences
Some minor workarounds for Fedora >= 22 where dnf is the default
package manager. The changes are documented on the Fedora release
notes https://fedoraproject.org/wiki/Changes/ReplaceYumWithDNF

Change-Id: I7d7d6f5d294980dcb217d6190a1efd9e0bbea9a6
2015-06-24 09:20:45 +10:00

36 lines
716 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [ "i386" = "$ARCH" ]; then
basearch=i386
arch=i686
elif [ "amd64" = "$ARCH" ]; then
basearch=x86_64
arch=x86_64
elif [[ "$ARCH" = "ppc64" ]]; then
basearch=ppc64
arch=ppc64
elif [[ "$ARCH" = "ppc64el" ]]; then
basearch=ppc64el
arch=ppc64el
else
echo "********************"
echo "Unknown arch '$ARCH'"
echo "********************"
exit 1
fi
if [ $DIB_RELEASE -ge 22 ]; then
mkdir -p /etc/dnf/vars
echo $basearch > /etc/dnf/vars/basearch
echo $arch > /etc/dnf/vars/basearch
else
echo $basearch > /etc/yum/vars/basearch
echo $arch > /etc/yum/vars/arch
fi