Skip to content

Commit

Permalink
Fix off-by-one bug when rpm is installed on non-RHEL systems
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marcomagdy committed May 24, 2019
1 parent 0aa9a66 commit 2d0f6c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packaging/packager
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d0f6c6

Please sign in to comment.