19070: Still trying to fix test_with_arvbox
[arvados.git] / build / go-python-package-scripts / postinst
index cc63f351f61b8b6cce3da4016015fc4a5ef97bf2..ab2568ab9b8f940a07aa83e86ad7b45ba6501ab1 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}")"