[ARVADOS] created: 1.2.0-205-gc4e313518
Git user
git at public.curoverse.com
Mon Oct 15 21:49:55 EDT 2018
at c4e3135187e0a2dd339a4e3dccb2441302e3f6ca (commit)
commit c4e3135187e0a2dd339a4e3dccb2441302e3f6ca
Author: Ward Vandewege <wvandewege at veritasgenetics.com>
Date: Mon Oct 15 21:49:30 2018 -0400
Fix the detection of rpm vs deb systems.
refs #14344
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege at veritasgenetics.com>
diff --git a/build/go-python-package-scripts/postinst b/build/go-python-package-scripts/postinst
index 6d303f2e3..095872fe2 100755
--- a/build/go-python-package-scripts/postinst
+++ b/build/go-python-package-scripts/postinst
@@ -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-configure | rpm-1)
dest_dir="/lib/systemd/system"
diff --git a/build/go-python-package-scripts/prerm b/build/go-python-package-scripts/prerm
index d840ee1bd..b2908e2f3 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
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list