diskimage-builder/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf
Ian Wienand b57714af75 Use $YUM instead of direct calls in more places
A few places we either assume centos uses "yum" directly, or have
switching based on the distro type.

In both cases, we can use ${YUM} directly to avoid ambiguity

Change-Id: I71095a9bd1862f8956b5982fbbb3e1d213926c14
2019-10-03 00:22:18 +00:00

19 lines
325 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ ${YUM} == "dnf" ]]; then
cfg=/etc/dnf/dnf.conf
cachedir=/var/cache/dnf
else
cfg=/etc/yum.conf
cachedir=/var/cache/yum
fi
sed -i "/^keepcache/c\keepcache=0" $cfg
sed -i "/^cachedir/c\cachedir=${cachedir}" $cfg