i don't even know at this point

This commit is contained in:
Neil Hanlon 2023-11-21 20:56:09 -05:00
parent 16026735e5
commit d17d7b15f9
Signed by untrusted user: neil
GPG Key ID: 705BC21EC3C70F34
8 changed files with 23 additions and 17 deletions

View File

@ -34,9 +34,9 @@ else
fi
if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then
if [[ ${YUM} == "dnf" ]]; then
if [[ ${YUM} =~ "dnf" ]]; then
rpm -q dnf-plugins-core || dnf install -y dnf-plugins-core
dnf config-manager --set-disabled "epel*"
${YUM} config-manager --set-disabled "epel*"
else
# Cannot rely on package-installs, it is executed later
rpm -q yum-utils || yum install -y yum-utils

View File

@ -13,12 +13,12 @@ fi
YUM=${YUM:-yum}
if [[ ${YUM} == "dnf" ]]; then
if [[ ${YUM} =~ "dnf" ]]; then
# cribbed from
# http://dnf.readthedocs.org/en/latest/cli_vs_yum.html
_old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)"
if [[ -n "${_old_kernels}" ]]; then
dnf remove -y --setopt=protect_running_kernel=False ${_old_kernels}
${YUM} remove -y --setopt=protect_running_kernel=False ${_old_kernels}
fi
else
install-packages yum-utils

View File

@ -25,7 +25,7 @@ else
exit 1
fi
if [[ ${YUM} == "dnf" ]]; then
if [[ ${YUM} =~ "dnf" ]]; then
mkdir -p /etc/dnf/vars
echo $basearch > /etc/dnf/vars/basearch
echo $arch > /etc/dnf/vars/arch

View File

@ -110,8 +110,8 @@ if [ -n "$WHITELIST" ]; then
if [ "$ACTION" == "download" ]; then
mkdir -p $DOWNLOAD_PATH
if [ ${YUM} == "dnf" ]; then
dnf download --destdir=$DOWNLOAD_PATH $PKGS
if [ ${YUM} =~ "dnf" ]; then
${YUM} download --destdir=$DOWNLOAD_PATH $PKGS
else
# note; you don't want to use yum --download only here.
# Firstly that only puts things in the yum cache
@ -135,12 +135,18 @@ if [ -n "$WHITELIST" ]; then
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567
set -o xtrace
${YUM} -v -y $ACTION $EXTRA_ARGS $PKGS
if [ "$YUM" == "microdnf" ]; then
EXTRA_ARGS=" "
else
EXTRA_ARGS="-v"
fi
${YUM} -y $ACTION $EXTRA_ARGS $PKGS
if [ "$ACTION" == "install" ]; then
if [ ${YUM} == "dnf" ]; then
if [ ${YUM} =~ "dnf" ]; then
# Make sure dnf won't autoremove these packages
dnf mark install $PKGS
${YUM} mark install $PKGS
fi
fi
$_xtrace

View File

@ -7,12 +7,12 @@ 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
mv /etc/dnf/vars/contentdir.bak /etc/dnf/vars/contentdir
sed -i -e 's,^#mirrorlist,mirrorlist,' -e 's,^baseurl,#baseurl,' /etc/yum.repos.d/*.repo
fi
if [[ ${YUM} == "dnf" ]]; then
if [[ ${YUM} =~ "dnf" ]]; then
cfg=/etc/dnf/dnf.conf
cachedir=/var/cache/dnf
else

View File

@ -6,7 +6,7 @@ fi
set -eu
set -o pipefail
if [[ ${YUM} == "dnf" ]]; then
if [[ ${YUM} =~ "dnf" ]]; then
# dnf is slightly different; doesn't have these by default
cfg=/etc/dnf/dnf.conf
echo "keepcache=1" >> $cfg

View File

@ -20,8 +20,8 @@ if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 7 ]]; then
yum install -y ${DIB_CENTOS_7_PREINSTALL_EPEL_URL_PACKAGE:-https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm}
yum install -y python36-PyYAML
yum remove -y epel-release
elif [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} > 7 ]]; then
elif [[ ${DISTRO_NAME} =~ (centos|rhel|rocky) && ${DIB_RELEASE} > 7 ]]; then
# For 8 and above ensure the "user" python3 package is installed
# so we have /usr/bin/python3 and pyyaml.
dnf install -y python3 python3-pyyaml
${YUM} install -y python3 python3-pyyaml
fi

View File

@ -16,7 +16,7 @@ set -o pipefail
export DIB_DNF_MODULE_STREAMS=${DIB_DNF_MODULE_STREAMS:-}
if [ "${YUM}" == "dnf" ]; then
if [ "${YUM}" =~ "dnf" ]; then
for m in ${DIB_DNF_MODULE_STREAMS}; do
${YUM} -y module disable ${m/:*/}
${YUM} -y module enable ${m}