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: neil
GPG Key ID: 705BC21EC3C70F34
8 changed files with 23 additions and 17 deletions

View File

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

View File

@ -13,12 +13,12 @@ fi
YUM=${YUM:-yum} YUM=${YUM:-yum}
if [[ ${YUM} == "dnf" ]]; then if [[ ${YUM} =~ "dnf" ]]; then
# cribbed from # cribbed from
# http://dnf.readthedocs.org/en/latest/cli_vs_yum.html # http://dnf.readthedocs.org/en/latest/cli_vs_yum.html
_old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)" _old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)"
if [[ -n "${_old_kernels}" ]]; then 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 fi
else else
install-packages yum-utils install-packages yum-utils

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ fi
set -eu set -eu
set -o pipefail set -o pipefail
if [[ ${YUM} == "dnf" ]]; then if [[ ${YUM} =~ "dnf" ]]; then
# dnf is slightly different; doesn't have these by default # dnf is slightly different; doesn't have these by default
cfg=/etc/dnf/dnf.conf cfg=/etc/dnf/dnf.conf
echo "keepcache=1" >> $cfg 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 ${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 install -y python36-PyYAML
yum remove -y epel-release 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 # For 8 and above ensure the "user" python3 package is installed
# so we have /usr/bin/python3 and pyyaml. # so we have /usr/bin/python3 and pyyaml.
dnf install -y python3 python3-pyyaml ${YUM} install -y python3 python3-pyyaml
fi fi

View File

@ -16,7 +16,7 @@ set -o pipefail
export DIB_DNF_MODULE_STREAMS=${DIB_DNF_MODULE_STREAMS:-} 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 for m in ${DIB_DNF_MODULE_STREAMS}; do
${YUM} -y module disable ${m/:*/} ${YUM} -y module disable ${m/:*/}
${YUM} -y module enable ${m} ${YUM} -y module enable ${m}