From 8e16710b96a0e168a5711fa5a785bdbfe4b72353 Mon Sep 17 00:00:00 2001 From: modric Date: Sat, 24 Sep 2022 06:45:56 +0000 Subject: [PATCH] The postun script should distinguish uninstall and upgrade scenarios Signed-off-by: modric --- linux-sgx.spec | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/linux-sgx.spec b/linux-sgx.spec index f5884ea..98b2027 100644 --- a/linux-sgx.spec +++ b/linux-sgx.spec @@ -1,6 +1,6 @@ Name: linux-sgx Version: 2.15.1 -Release: 7 +Release: 8 Summary: Intel(R) Software Guard Extensions for Linux* OS ExclusiveArch: x86_64 License: BSD-3-Clause @@ -887,25 +887,27 @@ echo -e "Installation succeed!" systemctl start mpa_registration_tool.service %postun -n sgx-ra-service -# Generate the script to setup environment variables -MPA_DST_PATH=/opt/intel/sgx-ra-service +if [ "$1" = "0" ]; then + # Generate the script to setup environment variables + MPA_DST_PATH=/opt/intel/sgx-ra-service -# Disable service -if [ -d /run/systemd/users ]; then - systemctl disable mpa_registration_tool.service -fi + # Disable service + if [ -d /run/systemd/users ]; then + systemctl disable mpa_registration_tool.service + fi -# Removing MPA configuration file -rm -f /etc/init/mpa_registration_tool.conf -rm -f /lib/systemd/system/mpa_registration_tool.service -rm -f /usr/lib/systemd/system/mpa_registration_tool.service -rm -f /etc/systemd/system/mpa_registration_tool.service + # Removing MPA configuration file + rm -f /etc/init/mpa_registration_tool.conf + rm -f /lib/systemd/system/mpa_registration_tool.service + rm -f /usr/lib/systemd/system/mpa_registration_tool.service + rm -f /etc/systemd/system/mpa_registration_tool.service -# Removing MPA folder -rm -rf $MPA_DST_PATH + # Removing MPA folder + rm -rf $MPA_DST_PATH -#Removing log file -rm -f /var/log/mpa_registration.log + #Removing log file + rm -f /var/log/mpa_registration.log +fi echo -e "Uninstallation succeed!" @@ -1030,6 +1032,9 @@ fi %files -n libsgx-headers -f %{LINUX_INSTALLER_RPM_DIR}/libsgx-headers/build/list-libsgx-headers %changelog +* Sat Sep 24 2022 wangyu - 2.15.1-8 +- The postun script should distinguish uninstall and upgrade scenarios + * Tue Sep 20 2022 wangyu - 2.15.1-7 - add strip compilation option for pck-id-retrieval-tool -- Gitee