When updating, set PKG variable to dnf or yum at runtime

When updating RHEL7 containers from a RHEL8-based environment, the
update fails with the following messages:

    "stderr": "/tmp/yum_update.sh: line 18: /bin/dnf: No such file or directory",
    "stdout": "No packages were found for update...",

This patch reverts the PKG variable assignment to the way it used to be
so that the decision to use dnf or yum is made at runtime, within the
container.

Change-Id: I6a248b5277efd8707fc744292075949d94e3a05f
This commit is contained in:
Julie Pichon 2019-12-20 14:51:07 +00:00
parent c2a428db12
commit 8820e9493d
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
set -eou pipefail
PKG={{ pkg_mgr }}
PKG="$(command -v dnf || command -v yum)"
PKG_MGR="$(echo ${PKG:(-3)})"
if [ $PKG_MGR == "dnf" ]; then