tests: fix failure installing non-existing packages in REQUIRED_PACKAGES

Previously, dnf/yum used to ignore packages that didn't exist.
In Fedora 32, dnf starts to fail the entire command:

  No match for argument: python-gobject-base
  Error: Unable to find a match: python-gobject-base

Since this script is supposed to work with different RHEL/Fedora
versions, it's expected that not all packages are available everywhere.

Fix that, by installing packages that we know that they might be missing
one by one (and ignore the error).
This commit is contained in:
Thomas Haller 2019-09-25 07:15:57 +02:00
parent 97646d81ce
commit 185567559c

View file

@ -10,16 +10,25 @@
# Not all of these packages are strictly speaking necessary.
# This is a generous list of related packages.
set -xe
DNF="$(which dnf &>/dev/null && echo dnf || echo yum)"
install() {
if [ "$NM_INSTALL" != "" ]; then
$NM_INSTALL "$@"
else
sudo "$(which dnf &>/dev/null && echo dnf || echo yum)" install -y "$@"
sudo "$DNF" install -y "$@"
fi
}
install_ignore_missing() {
for p; do
install "$p" || :
done
}
install \
\
ModemManager-devel \
ModemManager-glib-devel \
mobile-broadband-provider-info-devel \
@ -56,7 +65,6 @@ install \
ppp \
ppp-devel \
pygobject3-base \
python-gobject-base \
python3-dbus \
python3-gobject \
qt-devel \
@ -68,5 +76,9 @@ install \
vala-tools \
valgrind \
wireless-tools-devel \
\
#end
# some packages don't exist in certain distributions. Install them one-by-one, and ignore errors.
install_ignore_missing \
python-gobject-base \
#end