GNOME Bugzilla – Bug 601476
How about match XDG standards and get rid of ~/.nautilus
Last modified: 2010-10-07 16:04:57 UTC
Created attachment 147443 [details] nautilus xdg patch and nautilus is no longer depends on gnome, change config dir to $XDG_CONFIG_HOME will be better. See http://www.freedesktop.org/wiki/Specifications/basedir-spec See also - http://ploum.frimouvy.org/?184-cleaning-user-preferences-keeping-user-data (main post and comment#8) - http://www.aigarius.com/blog/2007/01/10/fhs-extension-for-user-home-folders/
or use ~/.gnome2/nautilus instead of ~/.nautilus is still ok if naulitus must be a "part" of gnome.
Patch is wrong. We really don't use ~/.nautilus anymore, since the metadata was moved to GVFS (which properly uses the spec); however, we still need to migrate data in the case that the user has older preferences in ~/.nautilus, so that's what the code you're seeing actually does (which your patch breaks). Closing as NOTABUG.
sorry, i just want to get rid of ~/.nautilus i am using nautilus 2.28, and naulitus will creat ~/.nautilus automaticly. isn't it no necessary to creat this dir as you said?
Created attachment 155253 [details] [review] nautilus-xdg.patch Please see this bug again. the problem is ibnautilus-private/nautilus-file-utilities.c will creat ~/.nautilus even now this dir is no use. if nautilus need NAUTILUS_USER_DIRECTORY_NAME, define it to ~/.config/nautilus here is the patch.
Do i need open a new bug?
*** Bug 613297 has been marked as a duplicate of this bug. ***
Created attachment 158619 [details] [review] Don't use ~/.nautilus anymore (#601476). But use XDG_CONFIG to save configuration files. Patch by jarryson.
Created attachment 158620 [details] [review] Migrate confguration to XDG_CONFIG.
I improved the patch by adding some migration code to the new directory. Comments welcome, I'd like to merge this after we branch gnome-2-30.
Does that migration patch work at all? nautilus_application_startup() first calls check_required_directories() which should create the new xdg-based user dir. Then later the migration tries to move onto this xdg dir and will always fail. Also: + if (errno == EEXIST || errno == ENOTEMPTY) { + g_remove (nautilus_dir); + } else { This will always fail because the directory is not empty (g_remove is not recursive). Additionally, i don't think we should remove the old data on migration failure. That could be a data loss. Maybe the user is using old versions of nautilus in parallel on the same homedir or something. Instead just put some file named THIS-DIRECTORY-IS-DEPRECATED in there with some comment about what version deprecated it and where it moved. Then anal-retentive cleanup people can remove it, and normal people will just never get it for new installs.
(In reply to comment #10) > Does that migration patch work at all? > nautilus_application_startup() first calls check_required_directories() which > should create the new xdg-based user dir. Then later the migration tries to > move onto this xdg dir and will always fail. Yes, it works, because rename(), at least on Linux, works also with empty directory targets (manpage says "oldpath can specify a directory. In this case, newpath must either not exist, or it must specify an empty directory.") > + if (errno == EEXIST || errno == ENOTEMPTY) { > + g_remove (nautilus_dir); > + } else { > > This will always fail because the directory is not empty (g_remove is not > recursive). True; I removed that part and implemented the simple file approach you suggested.
Created attachment 158663 [details] [review] Migrate confguration to XDG_CONFIG.
+ message = _("Nautilus 2.32 deprecated this directory and tried migrating " + "this configuration in ~/.config/nautilus"); tried migrating this configuration *to* ... Also, i would add a comment to the rename about rename over empty dir succeeding. Otherwise it looks good to me.
Created attachment 158709 [details] [review] Migrate confguration to XDG_CONFIG. Fixed last comments.
Comment on attachment 158619 [details] [review] Don't use ~/.nautilus anymore (#601476). Committed to master.
Comment on attachment 158709 [details] [review] Migrate confguration to XDG_CONFIG. Committed to master.
This is fixed now.
*** Bug 518587 has been marked as a duplicate of this bug. ***
this bug happened again, why cancle these patches in nautilus 2.32?
(In reply to comment #19) > this bug happened again, why cancle these patches in nautilus 2.32? Please don't reopen bugs closed as FIXED by a maintainer. This is indeed fixed in git master and in 2.90.1, so there's no reason for this bug to stay open. I decided to drop this patch for the GNOME 2.32 release as I think 3.0 is a better release to remove legacy behavior such as this one.
Dear Cosimo, I can confirm that the ~/.nautilus folder is still created in the latest gnome release (tag 2.32.0), even though no data is written to it: drwxr-xr-x 2 4.0K 2010-09-04 07:05 .nautilus After `rm -rf ~/.nautilus` and starting nautilus I can see that the folder is still created on startup (as the recent timestamp shows: drwxr-xr-x 2 4.0K 2010-09-30 16:38 .nautilus I just had a look at the nautilus source (grep -Rn -A2 g_get_home *) and found that there are still quite a few accesses to the home folder. Here is a selection that might be worth a look at: src/nautilus-application.c:596: metafile_dir = g_build_filename (g_get_home_dir (), src/nautilus-application.c-597- ".nautilus/metafiles", NULL); -- src/nautilus-application.c:611: nautilus_dir = g_build_filename (g_get_home_dir (), src/nautilus-application.c-612- ".nautilus", NULL); Cheers Sebastian
well never mind, I just saw your message above, currious that in the notification email I got, only the bug change was mentioned but the message was not shown.
New bug filled here: bug #631596