Skip to content

Commit

Permalink
Swdev 362774 (#116)
Browse files Browse the repository at this point in the history
* ROCmCreatePackage: Bug fix in prerm scriptlet

Arguments to prerm script is referenced correctly inside the
function in the script.

Signed-off-by: Saravanan Solaiyappan <[email protected]>

* Update ROCMCreatePackage.cmake

Updated with comments.

Signed-off-by: Saravanan Solaiyappan <[email protected]>
  • Loading branch information
solaiys authored Nov 18, 2022
1 parent b7e2bc1 commit 88fd446
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion share/rocm/cmake/ROCMCreatePackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,13 @@ function(rocm_parse_python_syspath DIR_PATH PKG_NAME)
# NOT during upgrade operation.
# Since same prerm scriptlet is used for both DEB and RPM pkgs, adding both
# conditions for rpm and deb scriptlets for remove case.
# Arg value of the prerm script is saved in to a variable arg1 and used inside
# the rm_libdir() function as $1 inside the function will be empty as its not called with arguments.
file(APPEND ${PROJECT_BINARY_DIR}/debian/prerm
"
arg1=\"$1\"
rm_libdir(){
if [ \"$1\" = \"remove\" ] || [ $1 -eq 0 ]; then
if [ \"$arg1\" = \"remove\" ] || [ \"$arg1\" = \"0\" ]; then
")
foreach(PYTHON_SITE ${PYTHON_SITE_PACKAGES})
file(
Expand All @@ -174,6 +177,11 @@ function(rocm_parse_python_syspath DIR_PATH PKG_NAME)
}
set_libdir
")

# Keep the function call "rm_libdir" at the end of the prerm script and
# do not modify that line.
# This function call line of the prerm script will be removed
# during the versioned package rebuild using a sed command.
file(APPEND ${PROJECT_BINARY_DIR}/debian/prerm
"
fi
Expand Down

0 comments on commit 88fd446

Please sign in to comment.