-
Notifications
You must be signed in to change notification settings - Fork 7
Move .local/share/arduino-app-cli in /var/lib #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
debian/arduino-app-cli/DEBIAN/prerm
Outdated
| echo "Running pre-0.8.0 legacy cleanup/migration..." | ||
| cleanup_arduino_examples /home/arduino/.local/share/arduino-app-cli/examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| echo "Running pre-0.8.0 legacy cleanup/migration..." | |
| cleanup_arduino_examples /home/arduino/.local/share/arduino-app-cli/examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the cleanup of old dir examples; leave the app shutdown and cache cleanup of /var/lib/arduino-app-cli
| cleanup_arduino_examples /home/arduino/.local/share/arduino-app-cli/examples | ||
| fi | ||
| fi | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| fi | |
| cp -r /home/arduino/.local/share/arduino-app-cli /examples /var/lib/arduino-app-cli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the copy of examples here; add the copy of properties.msgpack* and bootloader_burned.flag here;
add rm -rf of examples, properties.msgpack, properties.msgpack.lock and bootloader_burned.flag in postinst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Added file check to prevent "apt reinstall" from failing if the source is missing.
|
@martacarbone can you fix the conflict? |
eaca4c4 to
39345cd
Compare
40c9d62 to
7192278
Compare
dido18
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the /home/arduino/.local/share/arduino-app-cli there is also the default.app file containing the default app to be started.
When the default app is moved to the root, user data is preserved; however, the user loses the previously configured default app.
Is this what we want?
I think it is fine; in that case, we are updating the app-cli so that it could also change the way the default app works. |
| COPY ./debian/${DEB_NAME} /${DEB_NAME}/ | ||
| COPY --from=go /app/${BINARY_NAME} /${DEB_NAME}/usr/bin/${BINARY_NAME} | ||
|
|
||
| RUN (cd /${DEB_NAME}/DEBIAN && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this step is a bit magical.
Can we simply define the function where they are needed
cleanup_home_arduino_examplesthat has hardcoded/home/arduino/.local/share/arduino-app-cli/examplescleanup_root_arduino_examplesthat has hard coded/var/lib/arduino-app-cli/examples
like
cleanup_home_arduino_examples() {
if [ -d "/home/arduino/.local/share/arduino-app-cli/examples" ]; then
local EXAMPLES=$(find "/home/arduino/.local/share/arduino-app-cli/examples" -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
echo "Stopping apps and clearing cache in: ${EXAMPLES_DIR}"
for dir_path in ${EXAMPLES}; do
# Stop apps and cache cleanup
sudo -u arduino /usr/bin/arduino-app-cli app stop "${dir_path}" > /dev/null 2>&1 || true
local CACHE_PATH="${dir_path}/.cache"
if [ -d "${CACHE_PATH}" ]; then
rm -r "${CACHE_PATH}"
fi
done
fi
}
Motivation
Currently the examples (and other static data) are stored inside the arduino home folder.
Current location: ~/.local/share/arduino-app-cli
This is needed because at some point the arduino-flasher-cli will support keeping user data, by preserving the user partition (where the arduino home folder is mounted). And we cannot keep some static data in the preserved paths, otherwise that data would not match the software version that gets installed in the root partition (which is not preserved).
Change description
Additional Notes
The installation scripts try to gracefully stop any runner application and delete the .cache directory, allowing the packaging system to clean the installed files.
Test
Case test #1 fresh install
Case test #2 purge after a fresh install
Case test #3 upgrade from 0.8.0 to 0.9.0
Reviewer checklist
main.