From 5c0dc0f383750cd29058bbf7d5e9f6c5fa42c27d Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Wed, 23 Mar 2022 10:28:48 -0400 Subject: [PATCH 1/2] Remove python pyc file when uninstall Remove python pyc file when uninstall. Change-Id: I383faf8fcfaeeb346c9ee38c1aad8577a460281e [ROCm/rocm_smi_lib commit: c37d4bac8f37f46e7869796e1e0ff4c2def21563] --- projects/rocm-smi-lib/DEBIAN/prerm.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/rocm-smi-lib/DEBIAN/prerm.in b/projects/rocm-smi-lib/DEBIAN/prerm.in index b7bc04b85d..ed421211fa 100755 --- a/projects/rocm-smi-lib/DEBIAN/prerm.in +++ b/projects/rocm-smi-lib/DEBIAN/prerm.in @@ -10,9 +10,15 @@ rm_ldconfig() { fi } +rm_pyc() { + # remove pyc file generated by python + rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/rocm_smi/bin/__pycache__ +} + case "$1" in ( remove | upgrade) rm_ldconfig + rm_pyc ;; ( purge ) ;; From 2e2f757d9d0670af93435cbe9572cbe52c7247c9 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Thu, 24 Mar 2022 09:36:05 -0400 Subject: [PATCH 2/2] Correct the __pycache__ folder Remove the __pycache__ in the folder libexec/rocm_smi Change-Id: I0ad505ff7e7368d5fe86e1eee12080039edc7111 [ROCm/rocm_smi_lib commit: 9f814e150ef6f0dd1101880dfcb73f48aa1fda2a] --- projects/rocm-smi-lib/DEBIAN/prerm.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocm-smi-lib/DEBIAN/prerm.in b/projects/rocm-smi-lib/DEBIAN/prerm.in index ed421211fa..65ec3de3ad 100755 --- a/projects/rocm-smi-lib/DEBIAN/prerm.in +++ b/projects/rocm-smi-lib/DEBIAN/prerm.in @@ -12,7 +12,7 @@ rm_ldconfig() { rm_pyc() { # remove pyc file generated by python - rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/rocm_smi/bin/__pycache__ + rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/libexec/rocm_smi/__pycache__ } case "$1" in