projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix the detection of rpm vs deb systems.
[arvados.git]
/
build
/
go-python-package-scripts
/
prerm
diff --git
a/build/go-python-package-scripts/prerm
b/build/go-python-package-scripts/prerm
index d840ee1bd16cbf272a7807a2b0b36310cbb466ba..b2908e2f31e7f1480674de7693e8bd4d03bf9f83 100755
(executable)
--- a/
build/go-python-package-scripts/prerm
+++ b/
build/go-python-package-scripts/prerm
@@
-3,9
+3,11
@@
#
# SPDX-License-Identifier: AGPL-3.0
#
# 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
# Red Hat ("%{...}" is interpolated at package build time)
pkg="%{name}"
pkgtype=rpm
@@
-18,6
+20,7
@@
else
prefix=/usr
fi
prefix=/usr
fi
+set -e
case "${pkgtype}-${1}" in
deb-remove | rpm-0)
if [ -e /run/systemd/system ]; then
case "${pkgtype}-${1}" in
deb-remove | rpm-0)
if [ -e /run/systemd/system ]; then