Skip to content

Commit

Permalink
fix upgrade package
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriiNazarenkoTine committed Mar 15, 2024
1 parent ad18a00 commit 6a096be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = rr-manager
SPK_VERS = 1.0
SPK_REV = 27
SPK_REV = 28
SPK_ICON = src/rr-manager.png

DSM_UI_DIR = app
Expand Down
16 changes: 12 additions & 4 deletions src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
PYTHON_DIR="/var/packages/python311/target/bin"
PATH="${SYNOPKG_PKGDEST}/env/bin:${SYNOPKG_PKGDEST}/bin:${SYNOPKG_PKGDEST}/usr/bin:${PYTHON_DIR}:${PATH}"
TMP_DIR="${SYNOPKG_PKGDEST}/../../tmp"
#PYTHON_DIR="/var/packages/python311/target/bin"
PACKAGE="rr-manager"
INSTALL_DIR="/usr/local/${PACKAGE}"
PYTHON_DIR="/usr/local/python"
PATH="${SYNOPKG_PKGDEST}/env/bin:${SYNOPKG_PKGDEST}/bin:${SYNOPKG_PKGDEST}/usr/bin:${PYTHON_DIR}:${PATH}"
TMP_DIR="${SYNOPKG_PKGDEST}/../../@tmp"

service_postinst ()
{
Expand All @@ -26,6 +28,7 @@ service_postinst ()
-e "s|@this_is_rr_tpm_dir@|${wizard_watch_dir}|g" \
"${SYNOPKG_PKGDEST}/app/config.txt"
fi
exit 0
}

preupgrade ()
Expand All @@ -35,11 +38,16 @@ preupgrade ()
mkdir -p ${TMP_DIR}/${PACKAGE}

# Save package config
mv "${SYNOPKG_PKGDEST}/app/config.txt" ${TMP_DIR}/${PACKAGE}
mv "${SYNOPKG_PKGDEST}/app/config.txt" "${TMP_DIR}/${PACKAGE}/config.txt"
exit 0
}

postupgrade ()
{
rm -f "${SYNOPKG_PKGDEST}/app/config.txt"
# Restore package config
mv "${TMP_DIR}/${PACKAGE}/config.txt" "${SYNOPKG_PKGDEST}/app/config.txt"
touch /tmp/rr_manager_installed
rm -fr ${TMP_DIR}/${PACKAGE}
exit 0
}

0 comments on commit 6a096be

Please sign in to comment.