Issue 118 move examples #146
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
dpkg --install handle obsolete .local file deletion for upgrade from a version lower than the current on (0.7.0)
dpkg --remove delete the system files but the configuration files
dpkg --purge remove all packages related files from the system
Test
Test #1
The package status is purged (no file or configurations present on the system)
dpkg --install arduino-app-cli-0.8.0-1_arm64.deb
This is a fresh installation, no old files will be deleted because it is supposed they do no exists.
After the istallation examples are in /var/lib/arduino-app-cli and the application
configuration dir is created in /home/arduino/.config/arduino-app-cli
Test #2
The 0.8.0 package is installed over a previous 0.7.0 installation.
This is an upgrade, old files /home/arduino/.local will be deleted.
dpkg --install arduino-app-cli-0.8.0-1_arm64.debAfter the installation we should have the same results of Test#1
Test #3
dpkg --remove arduino-app-cli
All removed but the configuration file in /home/arduino/.config/arduino-app-cli
Test #4
dpkg --purge arduino-app-cli
All removed, no more trace of the package files in the system.
Reviewer checklist
main.