Reapply "Make sure dnf won't autoremove packages that we explicitly installed"

The revert of this caused CI failures for Ironic in the
Ironic-Python-Agent builds.

This reverts commit 4f2613d815.

Change-Id: I0963d3decefb62680f720bdc3dddd19ecb3bdfd4
This commit is contained in:
Jay Faulkner 2024-11-13 09:26:42 -08:00
parent fd8fae299e
commit e661a18c51
2 changed files with 19 additions and 0 deletions

View File

@ -135,6 +135,13 @@ 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 [ "$ACTION" == "install" ]; then
if [ ${YUM} == "dnf" ]; then
# Make sure dnf won't autoremove these packages
dnf mark install $PKGS
fi
fi
$_xtrace
# probably not the right place for this; but python-pip package on

View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -eq 22 ]]; then
# we need dnf mark command from dnf 1.1.1, which is pretty recent
dnf --refresh update -y dnf
fi