17417: add --only-build flag to the
[arvados.git] / build / go-python-package-scripts / prerm
index 49bd7fc881c0832d64a65c6c39fe57174495c284..c0f45d60c698cb77f9c2472d7d18b5d3715b33c9 100755 (executable)
@@ -5,10 +5,13 @@
 
 set -e
 
-if [ "%{name}" != "%\{name\}" ]; then
+# Detect rpm-based systems: the exit code of the following command is zero
+# on rpm-based systems
+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
+    prefix="${RPM_INSTALL_PREFIX}"
 else
     # Debian
     script="$(basename "${0}")"