已关闭
[Bug-Report|缺陷反馈]: 卸载脚本 custom_prerm.sh 存在 rm -rf 误删共享 python 目录及目录不存在时中止卸载问题 #4803
丛吉钰创建于  25 天前关闭于  22 天前
丛吉钰
丛吉钰成员
25 天前 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

ops-nn 的 RPM/DEB 卸载脚本 scripts/package/ops_nn/rpm_deb/custom_prerm.sh 存在两个缺陷:

rm -rf "${parent}" 中的 parent 可能是与其他软件共享的 python 安装目录,使用 rm -rf 存在误删共享目录的风险;
多个 rmdir / rm 操作未做目录存在性判断,当目录不存在时命令返回非零,导致卸载流程中止。

Environment / 环境信息 (Mandatory / 必填)

昇腾硬件型号:不限定
CANN版本:ops-nn(RPM/DEB 包)
操作系统:Linux
其他相关软件版本:RPM / dpkg 包管理工具

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

构建并安装 ops-nn 的 RPM/DEB 包;
卸载该软件包;
观察卸载脚本行为:若 WHL_INSTALL_DIR_PATH 的父目录为共享 python 目录,可能被 rm -rf 误删;若某目录已不存在,脚本可能提前中止卸载。

Describe the expected behavior / 预期结果 (Mandatory / 必填)

卸载仅清理 ops-nn 自身安装的目录,不误删共享 python 目录;
目录不存在时跳过清理步骤,不中止卸载流程。

Special notes for this issue/备注 (Optional / 选填)

likedislike
丛吉钰丛吉钰成员
25 天前 添加了label:bug-report
丛吉钰丛吉钰成员
25 天前 将 cong-jiyu 设为负责人
CANN-robotCANN-robot成员
22 天前 关闭了 issue
CANN-robotCANN-robot成员
22 天前 添加了label:resolved