Skip to content

Commit

Permalink
fix for patch revoke older addon version
Browse files Browse the repository at this point in the history
  • Loading branch information
jp112sdl committed Jun 27, 2022
1 parent 37a2294 commit 0edc720
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/rc.d/jp-hb-devices-addon
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RL_FILE=/lib/udev/rules.d/99-hmip-rfusb.rules
CK_FIRMWARE_FILE=${FIRMWARE_DIR}/hb-uni-sen-cap-moist.xml

PATCHSUBDIR_COMMON=common
PATCHSUBDIR_VERSION=le_363

check_ccu_fw_version()
{
model=`grep VERSION /boot/VERSION | awk -F'[=.]' {'print $2'}`
Expand All @@ -35,6 +35,8 @@ check_ccu_fw_version()

if [ $model -ge 2 ] && [ $version -ge 65 ]; then
PATCHSUBDIR_VERSION=ge_365
else
PATCHSUBDIR_VERSION=le_363
fi

echo "Found firmware version $model.$version.$build - using patch subdirectory version ${PATCHSUBDIR_VERSION}" | tee -a $TMP_LOGFILE | tee -a $TMP_ERRFILE
Expand Down Expand Up @@ -156,9 +158,16 @@ case "$1" in

### revoke patches from currently installed addon version
if [ -f ${CK_FIRMWARE_FILE} ] && [ -d ${PATCH_DIR} ]; then
currentversion=`cat ${ADDON_DIR}/VERSION`
echo "Revoking current addon V $currentversion patch files." | tee $TMP_LOGFILE | tee $TMP_ERRFILE
currentversion_major=`cat /usr/local/addons/jp-hb-devices-addon/VERSION | awk -F'[=.]' {'print $1'}`
currentversion_minor=`cat /usr/local/addons/jp-hb-devices-addon/VERSION | awk -F'[=.]' {'print $2'}`

if [ $currentversion_major -eq 5 ]; then
PATCHSUBDIR_VERSION=ge_345
fi

echo "Revoking current addon V $currentversion_major.$currentversion_minor patch files." | tee $TMP_LOGFILE | tee $TMP_ERRFILE
patcher "REVOKE"
check_ccu_fw_version
fi

### delete the old (current) addon directory and rename the newly uploaded
Expand Down

0 comments on commit 0edc720

Please sign in to comment.