From 2d0f6c61e49bf4695ee3037c5a9b66c73eaf59b6 Mon Sep 17 00:00:00 2001 From: Marco Magdy Date: Wed, 22 May 2019 17:17:10 +0000 Subject: [PATCH] Fix off-by-one bug when rpm is installed on non-RHEL systems In 02c35e4 we removed the --quiet flag because it printed nothing on RHEL systems regardless if the package existed or not. However, on Debian systems without --quiet we get at least a single line if the package is not installed "package glibc is not installed". This patch fixes this off by one error and fixes issue #41 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --- packaging/packager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/packager b/packaging/packager index f92f10d..b1f3c40 100755 --- a/packaging/packager +++ b/packaging/packager @@ -73,7 +73,7 @@ function package_libc_via_dpkg() { function package_libc_via_rpm() { if type rpm > /dev/null 2>&1; then - if [ $(rpm --query --list glibc | wc -l) -gt 0 ]; then + if [ $(rpm --query --list glibc | wc -l) -gt 1 ]; then rpm --query --list glibc | sed -E '/\.so$|\.so\.[0-9]+$/!d' fi fi