26 lines
539 B
Bash
Executable File
26 lines
539 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
|
|
if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then
|
|
sudo mv /etc/dnf/vars/contentdir.bak /etc/dnf/vars/contentdir
|
|
sudo sed -i -e 's,^#mirrorlist,mirrorlist,' -e 's,^baseurl,#baseurl,' /etc/yum.repos.d/*.repo
|
|
fi
|
|
|
|
|
|
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
|