X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a7f9e978a4e45440a965d94ff849f59508a5456a..dbd421c673da7199ceb3ed1d3398bd55d2707566:/build/go-python-package-scripts/prerm diff --git a/build/go-python-package-scripts/prerm b/build/go-python-package-scripts/prerm index b2908e2f31..c0f45d60c6 100755 --- a/build/go-python-package-scripts/prerm +++ b/build/go-python-package-scripts/prerm @@ -3,11 +3,11 @@ # # SPDX-License-Identifier: AGPL-3.0 +set -e + # Detect rpm-based systems: the exit code of the following command is zero # on rpm-based systems -/usr/bin/rpm -q -f /usr/bin/rpm >/dev/null 2>&1 - -if [ "$?" = "0" ]; then +if /usr/bin/rpm -q -f /usr/bin/rpm >/dev/null 2>&1; then # Red Hat ("%{...}" is interpolated at package build time) pkg="%{name}" pkgtype=rpm @@ -20,7 +20,6 @@ else prefix=/usr fi -set -e case "${pkgtype}-${1}" in deb-remove | rpm-0) if [ -e /run/systemd/system ]; then