X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/44c95f99098fa6c6acbfa82d4b6cbc6015eb6e39..a7f9e978a4e45440a965d94ff849f59508a5456a:/build/go-python-package-scripts/prerm diff --git a/build/go-python-package-scripts/prerm b/build/go-python-package-scripts/prerm index d840ee1bd1..b2908e2f31 100755 --- a/build/go-python-package-scripts/prerm +++ b/build/go-python-package-scripts/prerm @@ -3,9 +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 [ "%{name}" != "%\{name\}" ]; then +if [ "$?" = "0" ]; then # Red Hat ("%{...}" is interpolated at package build time) pkg="%{name}" pkgtype=rpm @@ -18,6 +20,7 @@ else prefix=/usr fi +set -e case "${pkgtype}-${1}" in deb-remove | rpm-0) if [ -e /run/systemd/system ]; then