调整preInstall和preUninstall的位置

This commit is contained in:
liuxueli
2020-06-29 10:17:51 +08:00
parent 536aee91df
commit dde53a5200
3 changed files with 30 additions and 2 deletions

19
cmake/PreInstall.sh Normal file
View File

@@ -0,0 +1,19 @@
DST=${RPM_INSTALL_PREFIX}
mkdir -p ${DST}/plug/platform/
mkdir -p ${DST}/etc/
touch ${DST}/plug/conflist.inf
touch ${DST}/etc/project_list.conf
if [[ -z `grep -rn 'POLICY_PRIORITY' ${DST}/etc/project_list.conf` ]];then
echo 'POLICY_PRIORITY struct' >> ${DST}/etc/project_list.conf
fi
if [[ -z `grep -rn 'TSG_MASTER_INTERNAL_LABEL' ${DST}/etc/project_list.conf` ]];then
echo 'TSG_MASTER_INTERNAL_LABEL struct' >> ${DST}/etc/project_list.conf
fi
if [[ -z `grep -rn 'tsg_master.inf' ${DST}/plug/conflist.inf` ]];then
sed -i '/\[platform\]/a\./plug/platform/tsg_master/tsg_master.inf' ${DST}/plug/conflist.inf
fi

9
cmake/PreUninstall.sh Normal file
View File

@@ -0,0 +1,9 @@
if [ $1 == 0 ]; then
DST=${RPM_INSTALL_PREFIX}
mkdir -p ${DST}/plug/platform/
sed -i '/tsg_master.inf/d' ${DST}/plug/conflist.inf
sed -i '/POLICY_PRIORITY/d' ${DST}/etc/project_list.conf
sed -i '/TSG_MASTER_INTERNAL_LABEL/d' ${DST}/etc/project_list.conf
fi