From 185567559cd2d85ed44b99ccc433f83c3c8d3703 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 25 Sep 2019 07:15:57 +0200 Subject: [PATCH] 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). --- contrib/fedora/REQUIRED_PACKAGES | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES index 7579e9a983..b295d59315 100755 --- a/contrib/fedora/REQUIRED_PACKAGES +++ b/contrib/fedora/REQUIRED_PACKAGES @@ -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