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 599682 - Use XDG cache directory instead of ~/.evolution/cache
Use XDG cache directory instead of ~/.evolution/cache
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.28.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks: 523038
 
 
Reported: 2009-10-26 18:11 UTC by Wouter Bolsterlee (uws)
Modified: 2010-07-27 17:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Use-XDG-cache-directory-instead-of-.evolution-cache.patch (1.37 KB, patch)
2010-04-12 01:54 UTC, Pablo Castellano (IRC: pablog)
none Details | Review

Description Wouter Bolsterlee (uws) 2009-10-26 18:11:11 UTC
The summary says it all. Evolution (at least 2.28.x) uses a non-standard directory when opening attachments in external viewers, e.g. when opening a PDF attachment in Evince.
Comment 1 Matthew Barnes 2009-10-27 00:49:36 UTC
Confirming.  Cache directory would be a good place to start moving toward XDG compliance, since the data would not have to be migrated.
Comment 2 Pablo Castellano (IRC: pablog) 2010-04-12 01:54:10 UTC
Created attachment 158456 [details] [review]
0001-Use-XDG-cache-directory-instead-of-.evolution-cache.patch

Hi.

It looked quite trivial and I did a patch. Tell me if it's not enough
Comment 3 Christian Persch 2010-04-19 14:52:42 UTC
+	tmpdir = g_build_filename(g_get_user_cache_dir (),
+		"evolution", "tmp", NULL);
 	path = g_string_new(tmpdir);
 	if (make && g_mkdir_with_parents(tmpdir, 0777) == -1) {

Since this may create the toplevel g_get_user_cache_dir() too, you must use 0700 permissions here to comply with the spec. Also should check errno == EEXIST on return of -1 since that's not a failure.

That said, this does look wrong. If it's a temp directly to store temp files while they're opened in external programmes, it's not a *cache* and should use g_get_tmp_dir() instead. This code is in a #ifdef TEMP_HOME (which default to defined) so it's supposed to create a temp file not in /tmp but if that's really important the user can just set TMPDIR which g_get_tmp_dir() will honour.
Comment 4 Pablo Castellano (IRC: pablog) 2010-04-26 10:19:56 UTC
So, as far as I have understood, the correct way to do this would be removing the TEMP_HOME constant and using just g_get_tmp_dir(), right? And then creating the tmp dir (checking properly the return values).

I also found in devhelp a function called "g_file_error_from_errno ()". Should I use it instead?
Comment 5 Chenthill P 2010-06-14 10:36:33 UTC
mbarnes is working on the same and would be the right person to review this patch.
Comment 6 Matthew Barnes 2010-07-27 17:05:54 UTC
Evolution 2.31.6 will be fully compliant with XDG base directories -- not just cache but also data and config directories.  This was implemented in several commits spanning all Evolution-related modules.  I won't try to link to them all from here, but the commits were made over the course of this mailing list thread:

http://mail.gnome.org/archives/evolution-hackers/2010-June/msg00000.html