Ticket #1851 (closed defect: fixed)
Home config directory [xdg-user-dirs]
Reported by: | gotar | Owned by: | andrew_b |
---|---|---|---|
Priority: | major | Milestone: | 4.8.3 |
Component: | mc-core | Version: | 4.8.2 |
Keywords: | Cc: | halfcountplus@… | |
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master committed-stable |
Description
Instead of hardcoded (via MC_USERCONF_DIR) path mc should use dynamic directory specified by XDG_CONFIG_HOME variable (and fall back to ~/.config/mc according to http://www.freedesktop.org/wiki/Software/xdg-user-dirs). This is mainstream standard already adopted by many projects.
Note that in order to reduce .files mess and clean up $HOME some other solutions have been made, including PLD Linux-specific HOME_ETC. However it doesn't make much sense to keep maintaining our patches out of your repo, so just for the record:
http://cvs.pld-linux.org/cgi-bin/cvsweb/packages/mc/mc-home_etc.patch
http://cvs.pld-linux.org/cgi-bin/cvsweb/packages/mc/mc-home_etc2.patch
Change History
comment:2 follow-up: ↓ 3 Changed 15 years ago by andrew_b
There was such discussion in #139.
XDG Base Directory Specification
comment:3 in reply to: ↑ 2 Changed 15 years ago by gotar
Well...
'No, please let it where it is.'
'I would go for not moving...'
'+1. At this moment need to keep in ~/.mc'
...doesn't look like discussion much;) I'd like to see some arguments: what's the point in keeping $HOME/.files mess? Currently I've got 294 dot-files against 291 regular (aaargh!)
mc could even bend a little XDG and fallback to ~/.mc (not ~/.config/mc as standard says) - that's the way our HOME_ETC works. I doubt there are any reasons not to support something trivial, that doesn't change a thing when not _explicitly_ used.
comment:4 Changed 15 years ago by mk27
- Cc halfcountplus@… added
Yuri Z. pointed me here after a brief discussion on the mailing list. I have two mc's compiled in order to use separate config directories; someone else indicated using a shell script to spoof ~ in order to do the same thing (which is not a very good solution).
I suppose something similar could be done using XDG variables. However, while the XDG concept is not a bad one, it appears to me that it is KDE specific. I think it would be much better to implement this using a command-line option; that way, people who want to use XDG can do that:
--home=$XDG_CONFIG_HOME
and non KDE/XDG users who just want to use several different mc configs can do that. This is a common approach used by a lot of applications and provides greater flexibility. It has the advantage of being familiar to everyone, whereas doing some XDG hack on a non-XDG system using a shell script is more awkward and less obvious.
Anyway, I'm not expecting the people who wrote this patch to change it, esp. if they are sick of maintaining it anyway. The home directory is only referenced in the source <20 times. I am totally willing to write a patch for a command line option, it will also give me a chance to familiarize myself with the glib option parser IF people think this can be incorporated into the mainstream mc to solve EVERYONE's problems or issues, vis. the config directory.
comment:5 Changed 15 years ago by gotar
I'm not sure if .config is KDE-specific. In mine resides several directories not related to KDE at all, including LyX, Thunar, epdfview, gtk (!), wine and XFCE4. Moreover GNOME site references XDG too: http://library.gnome.org/devel/basedir-spec/
And there won't be any need for doing XDG hacks, because there is nothing like non-XDG system. You simply set the variable. Here in PLD we called it HOME_ETC, but it used to be ETC_DIR and CONFIG_DIR (working slightly different, being always relative to HOME) before. The idea grow stronger and now it's standard.
However it doesn't make me a difference how it could be done, mc always comes with an alias so it's not a problem to use it as command-line option --home=${XDG_CONFIG_HOME-~/.config} there.
comment:6 Changed 15 years ago by gotar
After a short consideration no - it does make a difference. If such feature is implemented as command-line option one would have to change mc.desktop file in order to switch directory (especially for having the same as when running mc from command line), this is no solution at all. The only proper way I see is to use environment.
comment:8 Changed 14 years ago by slavazanko
- Owner set to slavazanko
- Status changed from new to accepted
- Blocked By 1875 removed
comment:10 in reply to: ↑ description Changed 14 years ago by andrew_b
Replying to gotar:
Instead of hardcoded (via MC_USERCONF_DIR) path mc should use dynamic directory specified by XDG_CONFIG_HOME variable (and fall back to ~/.config/mc according to http://www.freedesktop.org/wiki/Software/xdg-user-dirs).
Glib provides that in g_get_user_config_dir() function.
comment:11 follow-up: ↓ 13 Changed 14 years ago by gotar
Exactly. BTW why glib is used as default search engine? According to http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines PCRE has more features.
comment:12 Changed 14 years ago by slavazanko
BTW why glib is used as default search engine?
because we don't need for redundant relations to libraries - some time ago addition of new relation to GLIB led to almost holywar (GLIB relation was added since 4.55... or newest.. i don't remember). Therefore in our case libpcre may be almost fully replaced by libglib (even if libpcre has more features). :)
comment:13 in reply to: ↑ 11 ; follow-up: ↓ 14 Changed 14 years ago by andrew_b
Replying to gotar:
BTW why glib is used as default search engine? According to http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines PCRE has more features.
Internally, Glib uses PCRE. Since 2.14 it provides a GRegex, therefore no need to link mc with libpcre if glib >= 2.14 is used. In case of glib < 2.14, mc uses native PCRE and links with libpcre.
comment:14 in reply to: ↑ 13 Changed 14 years ago by andrew_b
comment:15 Changed 14 years ago by slavazanko
- severity changed from no branch to on review
Created branch 1851_xdg_config
initial changeset:d6028285fa25f8827cb38dd3a3db26dc861d8579
review, please.
comment:17 Changed 14 years ago by slavazanko
- severity changed from on review to on rework
Need to update docs...
comment:18 Changed 14 years ago by slavazanko
- Version changed from 4.7.0-pre4 to master
Branch was changed.
Changesets:
- 85d04a0b0638bd861266b381a501308042c546e3: Home config directory (xdg-user-dirs)
- a52410592ed2cf1ef64e0c4f790ff31742262408: Renamed variables mc_home to mc_sysconfig_dir and mc_home_alt to mc_share_data_dir for more sence
- dd766ac2351cddee44150f2015ca43dd497d741f: Updated docs (man pages and comments in source code)
Review again, please.
comment:19 Changed 14 years ago by andrew_b
- Votes for changeset set to andrew_b
- severity changed from on rework to on review
comment:20 Changed 14 years ago by angel_il
- Votes for changeset changed from andrew_b to andrew_b angel_il
- severity changed from on review to approved
comment:21 Changed 14 years ago by angel_il
- Votes for changeset changed from andrew_b angel_il to andrew_b
uups sorry, i need more time...
comment:23 Changed 14 years ago by angel_il
- Votes for changeset changed from andrew_b to andrew_b angel_il
comment:25 Changed 14 years ago by slavazanko
- Status changed from accepted to testing
- Resolution set to fixed
merged to master. changeset:1b9957058a05e94b361a6913c7f8cf5ef98a99a9
git log --pretty=oneline d21eb43..8af4c9c
comment:26 Changed 14 years ago by slavazanko
- Status changed from testing to closed
- Votes for changeset changed from andrew_b angel_il to commited-master
- severity changed from approved to merged
comment:28 Changed 13 years ago by slavazanko
- Status changed from closed to reopened
- Votes for changeset commited-master deleted
- Resolution fixed deleted
- severity changed from merged to no branch
have troubles while migrate from old user config directory to new.
Not all files have copied.
comment:29 Changed 13 years ago by slavazanko
- Status changed from reopened to accepted
- severity changed from no branch to on review
Created branch 1851_fix_migrate
Initial changeset:2f059ed330c0090bfaf3e07fc9b96b999726016d
Review, please.
comment:31 Changed 13 years ago by iNode
- Votes for changeset changed from andrew_b to andrew_b iNode
- severity changed from on review to approved
comment:32 Changed 13 years ago by slavazanko
- severity changed from approved to no branch
- Branch state set to approved
comment:33 Changed 13 years ago by slavazanko
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b iNode to commited-master
- Resolution set to fixed
- Branch state changed from approved to merged
comment:35 Changed 13 years ago by andrew_b
- Status changed from closed to reopened
- Votes for changeset commited-master deleted
- Type changed from enhancement to defect
- Priority changed from minor to major
- Version changed from master to 4.8.2
- Branch state changed from merged to no branch
- Milestone changed from 4.8.0-pre1 to 4.8.3
- Resolution fixed deleted
Support of XGD_* shell variables was broken in [13a660d2e0cdb43ec46df38e53687a77f76581e6].
comment:36 Changed 13 years ago by andrew_b
- Owner changed from slavazanko to andrew_b
- Status changed from reopened to accepted
- Branch state changed from no branch to on review
Branch: 1851_xdg_fix (parent: master).
changeset:a13f5ef731a70fcb497b0c40012f05878a54021d
comment:38 Changed 13 years ago by slavazanko
- Votes for changeset changed from angel_il to angel_il slavazanko
- Branch state changed from on review to approved
comment:39 Changed 13 years ago by andrew_b
- Status changed from accepted to testing
- Keywords stable-candidate added
- Votes for changeset changed from angel_il slavazanko to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [ce401d797432b83228271029aeaf07f0ac5f2d3a]
git log --pretty=oneline 42f2b04..ce401d7
comment:40 Changed 13 years ago by andrew_b
- Status changed from testing to closed
- Keywords stable-candidate removed
- Votes for changeset changed from committed-master to committed-master committed-stable
- Component changed from mc-config-ini to mc-core
Merged to 4.8.1-stable: [69b580d1a065fe5c2090daaf5ae59198297f0630]
git log --pretty=oneline f3a2e41..69b580d
Looking at mentioned patches and #130 this should be really simple to code and so just needs a decision to be made.