Skip to content

Commit

Permalink
Handle rpm on Debian-based distributions
Browse files Browse the repository at this point in the history
RPM can be installed as a dependency (or separately) in Debian-based
distros that ultimately use dpkg. In those cases, the packager script
should handle the case in which querying rpm returns nothing.

Fixes #15
  • Loading branch information
marcomagdy committed Dec 21, 2018
1 parent 2128979 commit fcbfc91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packaging/packager
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ function package_libc_via_pacman {

function package_libc_via_dpkg() {
if type dpkg-query > /dev/null 2>&1; then
dpkg-query --listfiles libc6 | sed -E '/\.so$|\.so\.[0-9]+$/!d'
if [ $(dpkg-query --listfiles libc6 | wc -l) -gt 0 ]; then
dpkg-query --listfiles libc6 | sed -E '/\.so$|\.so\.[0-9]+$/!d'
fi
fi
}

function package_libc_via_rpm() {
if type rpm > /dev/null 2>&1; then
rpm --query --list glibc | sed -E '/\.so$|\.so\.[0-9]+$/!d'
if [ $(rpm --query --list --quiet glibc | wc -l) -gt 0 ]; then
rpm --query --list glibc | sed -E '/\.so$|\.so\.[0-9]+$/!d'
fi
fi
}

Expand Down

0 comments on commit fcbfc91

Please sign in to comment.