File tree Expand file tree Collapse file tree 4 files changed +14
-11
lines changed
debian/arduino-app-cli/DEBIAN Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ cleanup_arduino_examples() {
1313 local EXAMPLES=$( find " ${EXAMPLES_DIR} " -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
1414 echo " Stopping apps and clearing cache in: ${EXAMPLES_DIR} "
1515 for dir_path in ${EXAMPLES} ; do
16- echo " -> Stopping app/removing cache in: ${dir_path} "
17-
1816 # 1. Stop the application (suppress output and errors)
1917 sudo -u arduino /usr/bin/arduino-app-cli app stop " ${dir_path} " > /dev/null 2>&1 || true
2018
Original file line number Diff line number Diff line change @@ -5,3 +5,10 @@ chown -R arduino:arduino /var/lib/arduino-app-cli
55systemctl enable arduino-app-cli
66systemctl enable arduino-burn-bootloader
77systemctl enable arduino-avahi-serial.service
8+
9+ if [ " $1 " = " configure" ]; then
10+ if dpkg --compare-versions " $2 " lt " 0.9.0" ; then
11+ echo " Running pre-0.9.0 legacy migration..."
12+ rm -rf /home/arduino/.local/share/arduino-app-cli/examples
13+ fi
14+ fi
Original file line number Diff line number Diff line change @@ -28,12 +28,11 @@ usermod -aG "$SYSUPGRADE_GROUP" "$APP_USER"
2828# SHARED_FUNCTIONS
2929
3030if [ " $1 " = " upgrade" ]; then
31- # if $2 is not empty, this is an upgrade
32- if [ -n " $2 " ]; then
33- # check if this is an upgrade from an old version
34- if dpkg --compare-versions " $2 " lt " 0.9.0" ; then
35- echo " Running pre-0.9.0 legacy cleanup/migration..."
36- cleanup_arduino_examples /home/arduino/.local/share/arduino-app-cli/examples
37- fi
31+ # check if this is an upgrade from an old version
32+ if dpkg --compare-versions " $2 " lt " 0.9.0" ; then
33+ echo " Running pre-0.9.0 legacy migration..."
34+ cleanup_arduino_examples /home/arduino/.local/share/arduino-app-cli/examples
35+ mkdir -p /var/lib/arduino-app-cli
36+ cp -rf /home/arduino/.local/share/arduino-app-cli/examples /var/lib/arduino-app-cli
3837 fi
3938fi
Original file line number Diff line number Diff line change 11#! /bin/sh
22
33set -e
4+
45systemctl disable arduino-app-cli
56systemctl disable arduino-burn-bootloader
67systemctl disable arduino-avahi-serial.service
78
89# SHARED_FUNCTIONS
910
10- echo " Running pre-0.8.0 legacy cleanup/migration..."
11- cleanup_arduino_examples /home/arduino/.local/share/arduino-app-cli/examples
1211echo " Cache cleanup..."
1312cleanup_arduino_examples /var/lib/arduino-app-cli/examples
You can’t perform that action at this time.
0 commit comments