19015: installer fix: work around a Passenger issue with the detection of RVM
[arvados.git] / build / go-python-package-scripts / postinst
index 729855a8806faa938bda6e9d3a95a3159eca08b5..ab2568ab9b8f940a07aa83e86ad7b45ba6501ab1 100755 (executable)
@@ -1,8 +1,13 @@
 #!/bin/sh
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
 
 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