diskimage-builder/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf

19 lines
357 B
Plaintext
Raw Normal View History

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; 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