libselinux/matchpathcon: Work around yum issue on CentOS 9

Fixes:
  # cd libselinux/setfiles-in-chroot-env
  # 1minutetip 1MT-CentOS-Stream-9
  # ./runtest.sh

  yum -y install filesystem libselinux libselinux-utils python3-libselinux policycoreutils --installroot=/tmp/tmp.WhKcf2BrOe  --skip-broken'
  Unable to detect release version (use '--releasever' to specify release version)
  Error: Failed to download metadata for repo 'epel': Cannot prepare internal mirrorlist: Status code: 404
  [   FAIL   ]

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
This commit is contained in:
Vit Mojzis 2024-08-15 23:34:18 +02:00
commit ab42eb9378

View file

@ -40,6 +40,10 @@ fi
if yum install --help | grep -q skip-unavailable ; then
INSTALL_OPTION="${INSTALL_OPTION} --skip-unavailable"
fi
# yum sometimes fails to detect the release version on CentOS 9
if rlIsCentOS 9 ; then
INSTALL_OPTION="${INSTALL_OPTION} --releasever 9"
fi
rlJournalStart
rlPhaseStartSetup