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 646663 - use g_get_user_runtime_dir
use g_get_user_runtime_dir
Status: RESOLVED FIXED
Product: GConf
Classification: Deprecated
Component: gconf
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks: 523057 674803
 
 
Reported: 2011-04-03 23:55 UTC by William Jon McCann
Modified: 2012-04-25 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove unused daemon and lock directory functions (2.30 KB, patch)
2011-04-04 01:37 UTC, William Jon McCann
none Details | Review
Remove gconf_win32_get_home_dir() (2.93 KB, patch)
2011-04-04 01:37 UTC, William Jon McCann
none Details | Review
Use user runtime dir for saved state (1.33 KB, patch)
2011-04-04 01:37 UTC, William Jon McCann
none Details | Review
Use g_get_user_runtime_dir convenience function (1014 bytes, patch)
2012-04-25 15:57 UTC, William Jon McCann
reviewed Details | Review
Remove unused gconf_get_lock_dir function (1.38 KB, patch)
2012-04-25 15:57 UTC, William Jon McCann
accepted-commit_now Details | Review
Remove gconf_win32_get_home_dir() (2.84 KB, patch)
2012-04-25 15:59 UTC, William Jon McCann
reviewed Details | Review
Make directories with parents in case they don't exist (1.37 KB, patch)
2012-04-25 16:00 UTC, William Jon McCann
accepted-commit_now Details | Review
Use user runtime dir for daemon directory (736 bytes, patch)
2012-04-25 16:00 UTC, William Jon McCann
reviewed Details | Review
Use user runtime dir for lock sanity check (832 bytes, patch)
2012-04-25 16:00 UTC, William Jon McCann
reviewed Details | Review
Remove unused gconf_get_lock_dir function (1.38 KB, patch)
2012-04-25 18:21 UTC, William Jon McCann
committed Details | Review
Make directories with parents in case they don't exist (1.37 KB, patch)
2012-04-25 18:21 UTC, William Jon McCann
committed Details | Review
Use user runtime dir for daemon directory (866 bytes, patch)
2012-04-25 18:22 UTC, William Jon McCann
none Details | Review
Use user runtime dir for lock sanity check (832 bytes, patch)
2012-04-25 18:22 UTC, William Jon McCann
none Details | Review

Description William Jon McCann 2011-04-03 23:55:00 UTC
It would be nice to use the XDG basedir user runtime dir instead of home for .gconfd.
Comment 1 William Jon McCann 2011-04-04 01:37:53 UTC
Created attachment 185073 [details] [review]
Remove unused daemon and lock directory functions

They were made irrelevant by commit:
1196f4aa6da632ceafd7bb2c9d19c0a2f9c403ae
Comment 2 William Jon McCann 2011-04-04 01:37:55 UTC
Created attachment 185074 [details] [review]
Remove gconf_win32_get_home_dir()

g_get_home_dir should give you the right thing.
Comment 3 William Jon McCann 2011-04-04 01:37:58 UTC
Created attachment 185075 [details] [review]
Use user runtime dir for saved state
Comment 4 Ray Strode [halfline] 2012-04-25 14:47:08 UTC
So things have changed a bit since these patches were written. See:

http://git.gnome.org/browse/gconf/commit/?id=ea6894303f7ebadb98bf4bf70a79c5bf6ef7cb90

and

http://git.gnome.org/browse/gconf/commit/?id=2895a09bc0666cf7b26190bdb648ad1f52c174da

(from bug 652289)

We should still drop the unused gconf_get_lock_dir function.  I'm on the fence about gconf_get_daemon_dir. The code currently makes it use the xdg runtime dir, but it would be fine to ditch it, and just have the caller use it like you propose.
Comment 5 William Jon McCann 2012-04-25 15:57:35 UTC
Created attachment 212801 [details] [review]
Use g_get_user_runtime_dir convenience function
Comment 6 William Jon McCann 2012-04-25 15:57:47 UTC
Created attachment 212802 [details] [review]
Remove unused gconf_get_lock_dir function
Comment 7 William Jon McCann 2012-04-25 15:59:58 UTC
Created attachment 212804 [details] [review]
Remove gconf_win32_get_home_dir()

g_get_home_dir should give you the right thing.
Comment 8 William Jon McCann 2012-04-25 16:00:01 UTC
Created attachment 212805 [details] [review]
Make directories with parents in case they don't exist
Comment 9 William Jon McCann 2012-04-25 16:00:04 UTC
Created attachment 212806 [details] [review]
Use user runtime dir for daemon directory
Comment 10 William Jon McCann 2012-04-25 16:00:06 UTC
Created attachment 212807 [details] [review]
Use user runtime dir for lock sanity check
Comment 11 Ray Strode [halfline] 2012-04-25 16:11:14 UTC
Review of attachment 212801 [details] [review]:

I know I said on irc that it probably should use g_get_user_runtime_dir() but thinking about it more I kind of disagree now.

::: gconf/gconf-internals.c
@@ -2810,1 @@
 

g_get_user_runtime_dir () returns g_get_user_cache_dir () not g_get_tmp_dir () in the case XDG_RUNTIME_DIR isn't set.  That means in some cases this code effectively changes to:

if (should put gconfd stuff in directory local to machine) {
 dir = directory on remote nfs server
}

Also, it changes the default location on windows, which probably isn't a big deal, but not really worth the churn either imo.
Comment 12 Ray Strode [halfline] 2012-04-25 16:12:03 UTC
Review of attachment 212802 [details] [review]:

cool
Comment 13 Ray Strode [halfline] 2012-04-25 16:19:15 UTC
Review of attachment 212804 [details] [review]:

::: gconf/gconf-internals.c
@@ -710,3 @@
-  for (p = home_copy; *p; p++)
-    if (*p == '\\')
-      *p = '/';

I do see g_strdelimit(g_home_dir, "\\", '/'); inside gutils.c but that apparently is only in an OS/2 codepath. Do we know for sure we're going to get forward slashes or that other parts of the gconf code are okay with backslashes ? I wonder why the function exists if it's not needed.
Comment 14 Ray Strode [halfline] 2012-04-25 16:20:22 UTC
Review of attachment 212805 [details] [review]:

sure
Comment 15 Ray Strode [halfline] 2012-04-25 16:24:01 UTC
Review of attachment 212806 [details] [review]:

::: gconf/gconf-internals.c
@@ +2783,3 @@
   else
     {
+      return g_strconcat (g_get_user_runtime_dir (), "/gconfd", NULL);

if we're going to do this, maybe we shouldn't have GCONF_GLOBAL_LOCKS at all?  Should probably use g_build_filename not g_strconcat (though the fact it previously used g_strconcat might have something to do with why gconf_win32_get_homedir does the slash conversion
Comment 16 Ray Strode [halfline] 2012-04-25 16:26:38 UTC
Review of attachment 212807 [details] [review]:

::: gconf/gconf-sanity-check.c
@@ +155,3 @@
   else
     {
+      testfile = g_build_filename (g_get_user_runtime_dir (),

again if we're going to use a local path in the global path half of a conditional we should consider just dropping the conditional.  Actually we should consider trying gconf-sanity-check in it's entirety.
Comment 17 William Jon McCann 2012-04-25 18:21:52 UTC
Created attachment 212825 [details] [review]
Remove unused gconf_get_lock_dir function
Comment 18 William Jon McCann 2012-04-25 18:21:57 UTC
Created attachment 212826 [details] [review]
Make directories with parents in case they don't exist
Comment 19 William Jon McCann 2012-04-25 18:22:01 UTC
Created attachment 212827 [details] [review]
Use user runtime dir for daemon directory
Comment 20 William Jon McCann 2012-04-25 18:22:05 UTC
Created attachment 212828 [details] [review]
Use user runtime dir for lock sanity check
Comment 21 William Jon McCann 2012-04-25 18:22:39 UTC
Comment on attachment 212801 [details] [review]
Use g_get_user_runtime_dir convenience function

Drop.
Comment 22 William Jon McCann 2012-04-25 18:22:54 UTC
Comment on attachment 212804 [details] [review]
Remove gconf_win32_get_home_dir()

Drop
Comment 23 Ray Strode [halfline] 2012-04-25 18:31:20 UTC
Review of attachment 212825 [details] [review]:

looks fine
Comment 24 Ray Strode [halfline] 2012-04-25 18:31:39 UTC
Review of attachment 212826 [details] [review]:

fine
Comment 25 William Jon McCann 2012-04-25 19:02:34 UTC
Comment on attachment 212827 [details] [review]
Use user runtime dir for daemon directory

Drop
Comment 26 William Jon McCann 2012-04-25 19:02:47 UTC
Comment on attachment 212828 [details] [review]
Use user runtime dir for lock sanity check

Drop