From ceb602cab1a10b888403b0528de2c2285c10a4ac Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 10 Feb 2020 11:14:53 +0100 Subject: [PATCH] contrib/REQUIRED_PACKAGES: fix script to work without GNU `which` installed `which` is convenient, but not installed in Fedora container images. Fix detection of whether to use `dnf` or `yum`. (cherry picked from commit 5cc8ca4038454bdf5c7be205396433362d12b839) (cherry picked from commit 68fa338e34d64f6f8e5e8b293f8318d79e743805) --- contrib/fedora/REQUIRED_PACKAGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES index fb6e173a56..803cb87f21 100755 --- a/contrib/fedora/REQUIRED_PACKAGES +++ b/contrib/fedora/REQUIRED_PACKAGES @@ -12,7 +12,7 @@ set -xe -DNF="$(which dnf &>/dev/null && echo dnf || echo yum)" +DNF="$( ( which dnf || dnf --version ) &>/dev/null && echo dnf || echo yum)" install() { if [ "$NM_INSTALL" != "" ]; then @@ -83,6 +83,7 @@ install \ vala-devel \ vala-tools \ valgrind \ + which \ "${EXTRA_PACKAGES[@]}" # some packages don't exist in certain distributions. Install them one-by-one, and ignore errors.