From b8aca4e3f8ace07b7e520a8ae564264b27672312 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 11 Sep 2015 17:07:39 +0200 Subject: [PATCH] diskimage-create.sh: try harder with provides in rpm check When checking whether a package is installed using rpm, try harder using the wanted name as provides of a real package. This fixes the check for installed python-argparse on CentOS 7, as it is provided by the main python package. Thanks to: Brandon James. Closes-Bug: #1494790 Change-Id: I88d1d0293e3dde9c6087e6e0209f234e922f52ce --- diskimage-create/diskimage-create.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 7c6add85..b89faca2 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -301,7 +301,9 @@ is_installed() { dpkg -s "$1" &> /dev/null else # centos, fedora, opensuse, or rhel - rpm -q "$1" &> /dev/null + if ! rpm -q "$1" &> /dev/null; then + rpm -q "$(rpm -q --whatprovides "$1")" + fi fi }