Or simple information where these data are, so the user can delete them manually as devel-su if wanted.
RPM %preun or %postun scripts can (and IMO should) be used for that. Just donāt forget the if [ "$1" == 0 ] check ($1 is 1 on upgrade). Thatās forbidden in Jolla Store though 
This is an important thing we devs have to start think about.
IMO a system package manager like rpm should not touch any data inside the user directory. This also became more difficult with multi user support.
I would prefer a āclear configā button inside the app itself, which also gives you feedback what is about to be deleted.
Itās not RPM, itās your script who does the cleaning. RPM itself doesnāt touch anything thatās not related to package management. With multiple users itās pretty much the only place where it can be done, actually. Apps have no access to other userās data, but scripts which are run by RPM with root privileges, do.
But how can the user decide whether or not to delete data?
Good point
Thereās no simple solution, it seems.
Maybe this helps? :
Uninstall packages with configuration files
Debian : dpkg --purge PaketName
Debian : apt-get purge PaketName
Debian : aptitude purge PaketName
Red Hat/CentOS : yum remove
Gentoo : ?
Zypper : zypper remove [12)]
[12)]Complete cleaning of the configuration only manually:
for package in package1 package2 package3
do
echo "removing config files for $package"
for file in $(rpm -q --configfiles $package)
do
echo " removing $file"
rm -f $file
done
rpm -e $package
done
Edit: This is a generic suggestion.
You mean like?
https://together.jolla.com/question/229207/zypper-remove-packages-including-configs-apt-purge/
Oh, surprise! Seems like an old problem.
This does never delete any user data & configuration! I only deletes system configuration/data (See also my other post here Deleting app does not delete (user) data)
Sure you are right. There is only one safe way to let developers clear the configuration files. Otherwise you have to search in /etc, /home, /opt and elsewhere yourself.
The suggestion from the internet is unsuccessful. My uninstallation experiences with āsynapticā on a Debian system rarely work. Itās just theory. I gave up looking for a solution a long time ago.
so we are talking a that this is a huge problem of Linux, where we cant delete the data so it can be track ?
why android can do it then when it is a linux kernel?
Not the Linux Kernel is the problem, but the packaging of the Apps. While Sailfish uses RPM (but it would be the same with AUR, deb, etc), Android uses a completely different concept for apps.
ookay!! hope that that will change it is important that we like users have the control of what we need to delete and what we wanna keep, and it has to be in a easy way, where you dont need to be master IT class for doing it.
I donāt know of any operating system that fulfills this requirement. We can only remind the developers to delete all data when uninstalling.
In Android this would be clear cache and clear userdata in settings -> Apps -> [appname] -> Storage.
EDIT: What I think of: Jolla should provide a coding guide for this task, roughly like:
- āput the config hereā
- āput the cache thereā
- provide a qml plugin and sample code, which deletes these files/dirs.
- provide a design principle, where to put the buttons for triggering the deletion.
ā¦this could also obviously be used to reset an app.
There is a standard which governs this (the XDG, X Desktop Guidelines at https://specifications.freedesktop.org), and Jolla has some guidelines in that regard.
The two paths you mention would be ~/.config/harbour-foo, and ~/.cache/harbour-foo, and then there is ~/.local which has some different semantics (it basically works like /usr or /usr/local but for the user).
There is also
- Silica StandardPaths
- QML StandardPaths Type
- Qt QStandardPaths Class
- Python PyStandardPaths
which allow developers convenient handling of these standard locations.
If apps follow that (and even if they donāt), they are free to provide an option inside the app to remove whatever they create.
As has been mentioned, it is not the domain of a package manager to delete these kinds of data, package managers should not do this and what some here request would be Very Bad Practice.
Now, one could argue that there should be an OS function or App to clean out these locations, similar to the mentioned Android functionality, but I for one am strictly against this happening automatically.
I like that my settings and other data persist between me installing and uninstalling apps, and if I really want everything gone I can use the factory reset, or manually delete things.
But even such an application would rely on the individual developers adhering to the aforementioned standards (or really, any other as long as itās the same), and currently there is little which forces one to do so.
One canāt stress this enough. Itās strange coming up with such ideas.
I donāt think this is possible in SailfishOS in itās current state. I just mentioned Android as an answer to the statement of the posting before.
I agree with everything you wrote. Just two things to add:
- You canāt delete files from qml-only -> hence a plugin may be needed.
- Jolla should mention this in coding guides like they write aboout things like using CamelCase⦠āYou should provide a function to the user deleting app generated data.ā followed by best practice.
What could be done on the OS level, is an option to reset just /home/{nemo,defaultuser} to factory settings, leaving everything else intact. A kind of soft-factory-reset.
Right now, deleting the defaultuserās home or the wrong parts thereof will horribly break things AFAIK.
That would be trivial to implement too, about a five-line shell script.
Thinking about it, where does the initial layout of /home/nemo come from? Is that just the partition stored in the flashable image, or does it get set up on initial boot? jolla-startupwizard? All of those?
Thinking about it, where does the initial layout of
/home/nemocome from?
Maybe one can investigate it by setting up a new additional user.