Skip to content

Commit 88fd446

Browse files
authored
Swdev 362774 (#116)
* ROCmCreatePackage: Bug fix in prerm scriptlet Arguments to prerm script is referenced correctly inside the function in the script. Signed-off-by: Saravanan Solaiyappan <saravanan.solaiyappan@amd.com> * Update ROCMCreatePackage.cmake Updated with comments. Signed-off-by: Saravanan Solaiyappan <saravanan.solaiyappan@amd.com>
1 parent b7e2bc1 commit 88fd446

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

share/rocm/cmake/ROCMCreatePackage.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ function(rocm_parse_python_syspath DIR_PATH PKG_NAME)
149149
# NOT during upgrade operation.
150150
# Since same prerm scriptlet is used for both DEB and RPM pkgs, adding both
151151
# conditions for rpm and deb scriptlets for remove case.
152+
# Arg value of the prerm script is saved in to a variable arg1 and used inside
153+
# the rm_libdir() function as $1 inside the function will be empty as its not called with arguments.
152154
file(APPEND ${PROJECT_BINARY_DIR}/debian/prerm
153155
"
156+
arg1=\"$1\"
154157
rm_libdir(){
155-
if [ \"$1\" = \"remove\" ] || [ $1 -eq 0 ]; then
158+
if [ \"$arg1\" = \"remove\" ] || [ \"$arg1\" = \"0\" ]; then
156159
")
157160
foreach(PYTHON_SITE ${PYTHON_SITE_PACKAGES})
158161
file(
@@ -174,6 +177,11 @@ function(rocm_parse_python_syspath DIR_PATH PKG_NAME)
174177
}
175178
set_libdir
176179
")
180+
181+
# Keep the function call "rm_libdir" at the end of the prerm script and
182+
# do not modify that line.
183+
# This function call line of the prerm script will be removed
184+
# during the versioned package rebuild using a sed command.
177185
file(APPEND ${PROJECT_BINARY_DIR}/debian/prerm
178186
"
179187
fi

0 commit comments

Comments
 (0)