GNOME Bugzilla – Bug 518585
Get rid of .tomboy and follow fd.o specifications
Last modified: 2009-10-04 00:48:03 UTC
Tomboy shouldn't create a .tomboy folder. According to fd.o specification, it should put user preferences in $XDG_CONFIG_HOME. Any user date should go to $XDG_DATA_HOME (which means notes content). More infos : http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html The reason why I'm reporting this bug : http://ploum.frimouvy.org/?184-cleaning-user-preferences-keeping-user-data
Created attachment 105906 [details] [review] Free Desktop Compliant for config files This patch will make us fdo compliant: http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html This changes our default directory from .tomboy to $XDG_CONFIG_HOME (which defaults to ~/.config/tomboy), the patch also takes into account the old default and will move a user's current notes. Let me know if this is ok to commit.
This looks like a good idea...in general we should be less hard-coded about ~/.tomboy anyway, so that you can maybe pass in an environment variable or command line arg when starting Tomboy to point to a different .tomboy area. Patch looks pretty good, too. I think it is too late in the cycle to do this, personally, so I'm targeting for 0.11.x. Sound good?
Wow, that's one of the quickest answer to a bug :-) But I don't see in your patch where you use XDG_DATA_HOME which must contain the notes themselves. Putting all in XDG_CONFIG_HOME is not a good idea because CONFIG_HOME is a folder that you can delete without any data loss. But I'm not familiar with C# and Tomboy source code, so I might miss something.
Setting the default assignee and QA Contact to "tomboy-maint@gnome.bugs".
That patch doesn't look like it distinguishes config data from actual note data. Am I correct? If so then it really can't go in as-is: the intent of $XDG_CONFIG_HOME is that a user can delete it at any time and the *only* effect will be a reversion to default preferences. User data cannot go here.
We keep preferences in gconf. The only configuration files in ~/.tomboy are those generated by Mono.Addins to track which addins are enabled, and a couple of files that maintain synchronization status. The could, of course, be moved. So a simple patch would just move everything to $XDG_DATA_HOME. A better patch would break out the few configuration items. And in that case, a little more work would be needed to make sure that user migration went as planned. Targeting for Future. I doubt this will get in for 0.12.0.
Any fix needs to properly handle migration for Windows/Mac users, too (or only do the fix on Linux). Targetting for next cycle.
For Linux, I want to do: $XDG_DATA_HOME/tomboy ~/.local/share/tomboy • *.note • Backup/ $XDG_CONFIG_HOME/tomboy ~/.config/tomboy • manifest.xml • addins* $XDG_CACHE_HOME/tomboy ~/.cache/tomboy • sync_temp/ • sync mountpoints (sync-sshfs/, etc) Any comments? I'm tempted to do this for 0.15.0 on Monday, but maybe I should wait for feedback first. Banshee keeps addin-related stuff in $XDG_CONFIG_HOME, but gnome-do keeps it in $XDG_DATA_HOME. For Tomboy, though presence of a given add-in can have an impact on your data, I still think it counts as configuration stuff. Primary motivation for this right now is to separate data out from all the other junk. For example, there are problems with manually syncing ~/.tomboy in various scenarios (dropbox, etc), but syncing $XDG_DATA_HOME/tomboy with the new arrangement would work much better. Windows and Mac will probably not follow fd.o because they have their own conventions, but we'll see.
Not sure where to put the log, though. XDG_CONFIG_HOME or XDG_CACHE_HOME?
Decided to definitely *not* do this for 0.15.0 on Monday. Needs to be perfect before I push it. To notify the user, I was thinking it would be cute to generate and display a note explaining where their data has gone to. That way they can ignore it (unlike a typical dialog), save to read/reference later, or simply delete (technically an extra click compared to a dialog). Any thoughts on the best way to not piss off users with this change? I figure migration should be triggered only if $XDG_DATA_HOME/tomboy/ is found to not exist, and ~/.tomboy/ does. And when migration is triggered, you still only copy data if the target directory did not previously exist.
The migration issue is a tough one, yes. I'll think about that one as well. Regarding the issue itself: This would more or less give me a way to run tomboy on a stick (aka "Portable") for free, right? Nice!
On OS X, I propose either doing exactly as on linux -- following fd.o; or using the Mac OS X *native* folders that mostly directly correspond to the XDG folders, that is using: ~/Library/Application Support (for data/Notes) (Alternatively ~/Documents ) ~/Library/Cache ~/Library/Preferences within each a Tomboy subfolder as appropriate.
(In reply to comment #12) > On OS X, I propose either doing exactly as on linux -- following fd.o; or using > the Mac OS X *native* folders that mostly directly correspond to the XDG > folders, that is using: > > ~/Library/Application Support (for data/Notes) (Alternatively ~/Documents ) > ~/Library/Cache > ~/Library/Preferences > > within each a Tomboy subfolder as appropriate. Yeah, that is what users expect, so that is what I think we should do. Right now everything is in ~/.config/tomboy on Mac.
Created attachment 134642 [details] [review] Early stage patch, showing some refactoring In case anybody was interested in working on this, here is the very early beginnings of a patch. It demonstrates how I'm planning to refactor things.
*** Bug 585800 has been marked as a duplicate of this bug. ***
This will hopefully be done for tomorrow's release. Related to this bug is ~/.tomboy.log. I'd like to move this file. In a recent mail to tomboy-list I said: > The XDG base > directory spec doesn't have any advice about where log files should > go. Banshee puts its log in ~/.config/banshee-1/log. > > I think it makes sense in either the cache or the config dir. It's > not configuration, but I don't want to encourage users to look in the > cache dir, ever. > > So I'm thinking we move ~/.tomboy.log to ~/.config/tomboy/tomboy.log. Comments welcome.
Created attachment 141502 [details] [review] Work-in-progress patch (Linux only) Latest work on this. It's basically done for Linux. Bugzilla and some other add-ins need to be reviewed for data migration, and there are one or two little TODOs, but this is ready for testing on Linux. Due to a bit of laziness on my part, this patch includes some unrelated bugfixes (bug #417145, bug #574517, bug #364945). The only real work left to do is specifying new directories for Windows and Mac; right now this patch will not build on those platforms.
Created attachment 141523 [details] [review] Reorganize notes and configuration data according to OS conventions (518585,557288) Allow each platform to specify its preferred directories for note files, configuration data, cached data, and logs. On Linux, this means following the XDG Base Directory Specification (bug #518585). New default directories: Linux: Notes: ~/.local/share/tomboy/ Configuration and add-ins: ~/.config/tomboy/ Caches: ~/.cache/tomboy/ Logs: ~/.config/tomboy/ Mac (bug #557288): Notes: ~/Library/Application Support/Tomboy/ Configuration and add-ins: ~/Library/Preferences/Tomboy/ Caches: ~/Library/Caches/Tomboy/ Logs: ~/Library/Logs/Tomboy/ Windows: Notes: %APPDATA%\Tomboy\notes\ Configuration and add-ins: %APPDATA%\Tomboy\config\ Caches: %LOCALAPPDATA%\Tomboy\cache\ Logs: %LOCALAPPDATA%\Tomboy\ Notes directory can still be overridden by setting the TOMBOY_PATH env var.
Comments on this patch welcome before I push it tomorrow.
Fixed.