After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 518585 - Get rid of .tomboy and follow fd.o specifications
Get rid of .tomboy and follow fd.o specifications
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Tomboy Maintainers
Tomboy Maintainers
: 585800 (view as bug list)
Depends on:
Blocks: 523057 575371
 
 
Reported: 2008-02-25 11:32 UTC by Lionel Dricot
Modified: 2009-10-04 00:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Free Desktop Compliant for config files (4.81 KB, patch)
2008-02-25 13:36 UTC, John M. Anderson
needs-work Details | Review
Early stage patch, showing some refactoring (6.93 KB, patch)
2009-05-14 13:07 UTC, Sandy Armstrong
needs-work Details | Review
Work-in-progress patch (Linux only) (27.56 KB, patch)
2009-08-23 16:35 UTC, Sandy Armstrong
none Details | Review
Reorganize notes and configuration data according to OS conventions (518585,557288) (32.29 KB, patch)
2009-08-24 05:54 UTC, Sandy Armstrong
none Details | Review

Description Lionel Dricot 2008-02-25 11:32:50 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
Comment 1 John M. Anderson 2008-02-25 13:36:34 UTC
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.
Comment 2 Sandy Armstrong 2008-02-25 13:41:30 UTC
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?
Comment 3 Lionel Dricot 2008-02-25 13:44:10 UTC
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.
Comment 4 Boyd Timothy 2008-02-26 19:15:41 UTC
Setting the default assignee and QA Contact to "tomboy-maint@gnome.bugs".
Comment 5 Martin Meyer 2008-03-18 12:43:20 UTC
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.
Comment 6 Sandy Armstrong 2008-08-02 18:33:40 UTC
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.
Comment 7 Sandy Armstrong 2009-03-12 01:41:09 UTC
Any fix needs to properly handle migration for Windows/Mac users, too (or only do the fix on Linux).  Targetting for next cycle.
Comment 8 Sandy Armstrong 2009-05-03 05:50:24 UTC
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.
Comment 9 Sandy Armstrong 2009-05-03 06:27:52 UTC
Not sure where to put the log, though.  XDG_CONFIG_HOME or XDG_CACHE_HOME?
Comment 10 Sandy Armstrong 2009-05-03 14:21:35 UTC
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.
Comment 11 Benjamin Podszun 2009-05-03 16:49:06 UTC
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!
Comment 12 ulrik sverdrup 2009-05-06 15:46:43 UTC
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.
Comment 13 Sandy Armstrong 2009-05-06 16:04:52 UTC
(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.
Comment 14 Sandy Armstrong 2009-05-14 13:07:50 UTC
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.
Comment 15 Sandy Armstrong 2009-06-15 14:26:05 UTC
*** Bug 585800 has been marked as a duplicate of this bug. ***
Comment 16 Sandy Armstrong 2009-08-23 14:58:40 UTC
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.
Comment 17 Sandy Armstrong 2009-08-23 16:35:04 UTC
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.
Comment 18 Sandy Armstrong 2009-08-24 05:54:43 UTC
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.
Comment 19 Sandy Armstrong 2009-08-24 06:04:33 UTC
Comments on this patch welcome before I push it tomorrow.
Comment 20 Sandy Armstrong 2009-08-24 21:51:28 UTC
Fixed.