From 2a5fbb97b9008457fca9b57ee3cc816dcd960e43 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 22 Nov 2021 17:04:16 -0800 Subject: [PATCH] bootstrap: rpm systems: use --whatprovides to test for package presence the package name isn't necessarily the name of the dependency Signed-off-by: Dan Mick --- bootstrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap b/bootstrap index 385c05768c..8a7cf189ff 100755 --- a/bootstrap +++ b/bootstrap @@ -61,7 +61,7 @@ Linux) RedHatEnterpriseWorkstation|RedHatEnterpriseServer|RedHatEnterprise|CentOS) deps=(python3-pip python3-devel mariadb-devel libev-devel libvirt-devel libffi-devel) for package in ${deps[@]}; do - if [ "$(rpm -q $package)" == "package $package is not installed" ]; then + if ! rpm -q --whatprovides $package ; then missing="${missing:+$missing }$package" fi done @@ -81,7 +81,7 @@ Linux) CentOSStream) deps=(python3-pip python39-devel mariadb-devel libev-devel libvirt-devel libffi-devel) for package in ${deps[@]}; do - if [ "$(rpm -q $package)" == "package $package is not installed" ]; then + if ! rpm -q --whatprovides $package ; then missing="${missing:+$missing }$package" fi done @@ -101,7 +101,7 @@ Linux) Fedora) deps=(python3-pip python3-devel libev-devel libvirt-devel libffi-devel) for package in ${deps[@]}; do - if [ "$(rpm -q $package)" == "package $package is not installed" ]; then + if ! rpm -q --whatprovides $package; then missing="${missing:+$missing }$package" fi done @@ -126,7 +126,7 @@ Linux) "openSUSE project"|"SUSE LINUX"|"openSUSE") deps=(python3-pip python3-devel python3 libev-devel libvirt-devel libffi-devel) for package in ${deps[@]}; do - if [ "$(rpm -q $package)" == "package $package is not installed" ]; then + if ! rpm -q --whatprovides $package; then if [ "$(rpm -q --whatprovides $package)" == "no package provides $package" ]; then missing="${missing:+$missing }$package" fi -- 2.39.5