summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2024-07-01 02:05:36 +0000
committersongyanchao <[email protected]>2024-07-01 02:05:36 +0000
commitb17ec1dc37a3e78574682798faf71fde1bb471f8 (patch)
treeb90cc77b19d86fc077e9bc45cd719465c336ff7f /cmake
parent06f515f5fee9457b99841cfd3bb42bcf31f91f7d (diff)
🐞 fix: Correct error where rpm -u unintentionally triggers update-alternatives.v4.7.8-20240701
Correct error where rpm -u unintentionally triggers update-alternatives.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/PostInstall.in2
-rw-r--r--cmake/PostUninstall.in4
2 files changed, 5 insertions, 1 deletions
diff --git a/cmake/PostInstall.in b/cmake/PostInstall.in
index 4e9d5e3..eed699c 100644
--- a/cmake/PostInstall.in
+++ b/cmake/PostInstall.in
@@ -9,6 +9,7 @@ if [ ! -d "$mrzcpd_bin_path" ]; then
mkdir -p "$mrzcpd_bin_path"
fi
+if [ $1 -eq 1 ]; then
command="update-alternatives --altdir @CMAKE_INSTALL_PREFIX@/altdir \
--install \
@MR_ALTERNATIVE_BINDIR@/mrzcpd \
@@ -88,6 +89,7 @@ command="update-alternatives --altdir @CMAKE_INSTALL_PREFIX@/altdir \
mrzcpd.service \
@CMAKE_INSTALL_PREFIX@/@MR_INSTALL_SYSTEM@/mrzcpd.service "
eval $command
+fi
%systemd_post mrenv.service mrzcpd.service mrtunnat.service mrzcpd_hwdb_setup.service mrzcpd_hugepages_setup.service
/sbin/ldconfig
diff --git a/cmake/PostUninstall.in b/cmake/PostUninstall.in
index 13f0a89..dc3bb52 100644
--- a/cmake/PostUninstall.in
+++ b/cmake/PostUninstall.in
@@ -1,5 +1,7 @@
%systemd_postun_with_restart mrenv.service mrzcpd.service mrtunnat.service
/sbin/ldconfig
-command="update-alternatives --remove mrzcpd @CMAKE_INSTALL_PREFIX@/@MR_INSTALL_BINDIR@/mrzcpd --altdir @CMAKE_INSTALL_PREFIX@/altdir"
+if [ $1 -eq 0 ]; then
+ command="update-alternatives --remove mrzcpd @CMAKE_INSTALL_PREFIX@/@MR_INSTALL_BINDIR@/mrzcpd --altdir @CMAKE_INSTALL_PREFIX@/altdir"
eval $command
+fi