Skip to content

Commit fcbfc91

Browse files
committed
Handle rpm on Debian-based distributions
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
1 parent 2128979 commit fcbfc91

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packaging/packager

+6-2
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,17 @@ function package_libc_via_pacman {
6565

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

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

0 commit comments

Comments
 (0)