diff --git a/projects/rdc/CMakeLists.txt b/projects/rdc/CMakeLists.txt index 20361610b6..2a67d1358b 100755 --- a/projects/rdc/CMakeLists.txt +++ b/projects/rdc/CMakeLists.txt @@ -364,19 +364,19 @@ endif() set(INST_SCR_PERM OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) configure_file( "${PROJECT_SOURCE_DIR}/src/DEBIAN_postinst.in" - "${PROJECT_SOURCE_DIR}/DEBIAN/postinst" FILE_PERMISSIONS ${INST_SCR_PERM}) + "${PROJECT_SOURCE_DIR}/DEBIAN/postinst" FILE_PERMISSIONS ${INST_SCR_PERM} @ONLY) configure_file( "${PROJECT_SOURCE_DIR}/src/DEBIAN_prerm.in" - "${PROJECT_SOURCE_DIR}/DEBIAN/prerm" FILE_PERMISSIONS ${INST_SCR_PERM}) + "${PROJECT_SOURCE_DIR}/DEBIAN/prerm" FILE_PERMISSIONS ${INST_SCR_PERM} @ONLY) configure_file( "${PROJECT_SOURCE_DIR}/src/RPM_rpm_post.in" - "${PROJECT_SOURCE_DIR}/RPM/rpm_post" FILE_PERMISSIONS ${INST_SCR_PERM}) + "${PROJECT_SOURCE_DIR}/RPM/rpm_post" FILE_PERMISSIONS ${INST_SCR_PERM} @ONLY) configure_file( "${PROJECT_SOURCE_DIR}/src/RPM_preun.in" - "${PROJECT_SOURCE_DIR}/RPM/rpm_preun" FILE_PERMISSIONS ${INST_SCR_PERM}) + "${PROJECT_SOURCE_DIR}/RPM/rpm_preun" FILE_PERMISSIONS ${INST_SCR_PERM} @ONLY) configure_file( "${PROJECT_SOURCE_DIR}/src/RPM_postun.in" - "${PROJECT_SOURCE_DIR}/RPM/rpm_postun" FILE_PERMISSIONS ${INST_SCR_PERM}) + "${PROJECT_SOURCE_DIR}/RPM/rpm_postun" FILE_PERMISSIONS ${INST_SCR_PERM} @ONLY) if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}") message("Using CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}") diff --git a/projects/rdc/src/DEBIAN_postinst.in b/projects/rdc/src/DEBIAN_postinst.in index 9806e829cf..800b4dda55 100755 --- a/projects/rdc/src/DEBIAN_postinst.in +++ b/projects/rdc/src/DEBIAN_postinst.in @@ -34,9 +34,10 @@ do_update_alternatives(){ binaries=( rdcd + rdci ) - for i in $binaries + for i in "${binaries[@]}" do # No obvious recover strategy if things fail # No manual or other slave pages to install diff --git a/projects/rdc/src/DEBIAN_prerm.in b/projects/rdc/src/DEBIAN_prerm.in index 3281910430..2a2c456a3d 100644 --- a/projects/rdc/src/DEBIAN_prerm.in +++ b/projects/rdc/src/DEBIAN_prerm.in @@ -5,9 +5,10 @@ do_update_alternatives(){ command -v update-alternatives >/dev/null || return 0 binaries=( rdcd + rdci ) - for i in "$binaries" + for i in "${binaries[@]}" do update-alternatives --remove $i @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/$i done diff --git a/projects/rdc/src/RPM_postun.in b/projects/rdc/src/RPM_postun.in index ef855397aa..377f96a64c 100755 --- a/projects/rdc/src/RPM_postun.in +++ b/projects/rdc/src/RPM_postun.in @@ -2,13 +2,14 @@ do_update_alternatives(){ # skip update if program doesn't exist command -v update-alternatives >/dev/null || return 0 - binaries=( + binaries=( rdcd + rdci ) - for i in "$binaries" + for i in "${binaries[@]}" do - update-alternatives --remove $i @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/$i + update-alternatives --remove "$i" @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/$i done } @@ -35,7 +36,7 @@ reload_systemd() { return 0 } -if [ $1 -le 1 ]; then +if [ "$1" -le 1 ]; then # perform the below actions for rpm remove($1=0) or upgrade($1=1) operations stop_rdc rm_rdc_service diff --git a/projects/rdc/src/RPM_rpm_post.in b/projects/rdc/src/RPM_rpm_post.in index 88d3a3ebf4..ba972fa072 100755 --- a/projects/rdc/src/RPM_rpm_post.in +++ b/projects/rdc/src/RPM_rpm_post.in @@ -33,9 +33,10 @@ do_update_alternatives(){ altscore=$((altscore*1000000+(now-1600000000)/60)) binaries=( rdcd + rdci ) - for i in $binaries + for i in "${binaries[@]}" do # No obvious recover strategy if things fail # No manual or other slave pages to install