From 14dfd0597c38183d264d570949463e4e5fad2bef Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Tue, 14 Jan 2025 01:30:10 -0800 Subject: [PATCH] Genericize the post-install and post-uninstall scripts more accurately --- script/post-install.sh | 4 ++-- script/post-uninstall-rpm.sh | 13 +++++++++++-- script/post-uninstall.sh | 13 +++++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/script/post-install.sh b/script/post-install.sh index 727bec57db..860268408d 100644 --- a/script/post-install.sh +++ b/script/post-install.sh @@ -1,6 +1,6 @@ #!/bin/sh -FILESOURCE='/opt/${executable}/resources/${executable}.sh' +FILESOURCE='/opt/${sanitizedProductName}/resources/${executable}.sh' FILEDEST='/usr/bin/${executable}' if [ -f "$FILEDEST" ] @@ -18,7 +18,7 @@ case $executable in ;; esac -SYMLINK_TARGET='/opt/${executable}/resources/app/ppm/bin/${ppm_executable}' +SYMLINK_TARGET='/opt/${sanitizedProductName}/resources/app/ppm/bin/${ppm_executable}' SYMLINK_PATH='/usr/bin/${ppm_executable}' if [ -L "$SYMLINK_PATH" ] diff --git a/script/post-uninstall-rpm.sh b/script/post-uninstall-rpm.sh index f68d62c968..434c16e3e9 100644 --- a/script/post-uninstall-rpm.sh +++ b/script/post-uninstall-rpm.sh @@ -7,14 +7,23 @@ if [ $1 -ge 1 ]; then exit 0 fi -PULSAR_SCRIPT_PATH='/usr/bin/pulsar' +PULSAR_SCRIPT_PATH='/usr/bin/${executable}' if [ -f "$PULSAR_SCRIPT_PATH" ] then rm "$PULSAR_SCRIPT_PATH" fi -PPM_SYMLINK_PATH='/usr/bin/ppm' +case $executable in + pulsar-next) + ppm_executable=ppm-next + ;; + *) + ppm_executable=ppm + ;; +esac + +PPM_SYMLINK_PATH='/usr/bin/${ppm_executable}' if [ -L "$PPM_SYMLINK_PATH" ] then diff --git a/script/post-uninstall.sh b/script/post-uninstall.sh index cba294dbab..c05afa5095 100644 --- a/script/post-uninstall.sh +++ b/script/post-uninstall.sh @@ -1,13 +1,22 @@ #!/bin/sh -PULSAR_SCRIPT_PATH='/usr/bin/pulsar' +PULSAR_SCRIPT_PATH='/usr/bin/${executable}' if [ -f "$PULSAR_SCRIPT_PATH" ] then rm "$PULSAR_SCRIPT_PATH" fi -PPM_SYMLINK_PATH='/usr/bin/ppm' +case $executable in + pulsar-next) + ppm_executable=ppm-next + ;; + *) + ppm_executable=ppm + ;; +esac + +PPM_SYMLINK_PATH='/usr/bin/${ppm_executable}' if [ -L "$PPM_SYMLINK_PATH" ] then