diskimage-builder/diskimage_builder/elements/yum/pre-install.d/00-01-yum-keepcache

20 lines
425 B
Plaintext
Raw Normal View History

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
2023-11-22 01:56:09 +00:00
if [[ ${YUM} =~ "dnf" ]]; then
# dnf is slightly different; doesn't have these by default
cfg=/etc/dnf/dnf.conf
echo "keepcache=1" >> $cfg
echo "cachedir=/tmp/yum" >> $cfg
else
cfg=/etc/yum.conf
sed -i 's/keepcache=0/keepcache=1/' $cfg
sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' $cfg
fi