return 0
}
+REMOVE_ISU_PKG()
+{
+ local PKG_NAME=$1
+ rm -rf "/opt/isu/$PKG_NAME"
+}
+
REMOVE_UNNECESSARY_ISU_PKGS()
{
+ local OS_RELEASE_NAME
+ OS_RELEASE_NAME=$(grep TZ_BUILD_RELEASE_NAME /etc/tizen-build.conf | awk -F '"' '{print $2}')
+
for ISUCFG in $(find /etc/isu/ -type f -name isu.cfg); do
PKG_NAME=$(basename "$(dirname "$ISUCFG")")
if [ ! -d "/opt/isu/$PKG_NAME" ]; then
fi
CUR_IMG_VERSION=$(grep -e "^version" "/etc/isu/$PKG_NAME/isu.cfg" | awk -F "=" '{ gsub(/[ ]+/, ""); print $2}')
INSTALLED_VERSION=$(grep -e "^version" "/opt/isu/$PKG_NAME/isu.cfg" | awk -F "=" '{ gsub(/[ ]+/, ""); print $2}')
+ ISU_RELEASE_NAME=$(grep -e "^tz_build_release_name" "/opt/isu/$PKG_NAME/isu.cfg" | awk -F "=" '{ gsub(/[ ]+/, ""); print $2}')
+
+ if [ "$OS_RELEASE_NAME" != "$ISU_RELEASE_NAME" ]; then
+ # Release name of the current image and package are different.
+ # In that case we remove the ISU package because it may
+ # not be compatible with this version of the system.
+ REMOVE_ISU_PKG "$PKG_NAME"
+ continue
+ fi
VERSION_COMPARE "$CUR_IMG_VERSION" "$INSTALLED_VERSION"
if [[ $? != 2 ]]; then
# Package from the current image is newer than the one installed
# so we can remove the installed one
- rm -rf "/opt/isu/$PKG_NAME"
+ REMOVE_ISU_PKG "$PKG_NAME"
fi
done
}