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 5cc8ca4038)
This commit is contained in:
Thomas Haller 2020-02-10 11:14:53 +01:00
parent 27664ff425
commit 68fa338e34

View file

@ -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
@ -81,6 +81,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.