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 646510 - jhbuild should use g_get_user_config_dir()
jhbuild should use g_get_user_config_dir()
Status: RESOLVED OBSOLETE
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on: 655714 655763 656611
Blocks: 523057
 
 
Reported: 2011-04-02 05:12 UTC by William Jon McCann
Modified: 2021-05-17 15:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use XDG_CONFIG_DIR (2.92 KB, patch)
2011-04-02 16:49 UTC, William Jon McCann
none Details | Review
Update location to ~/.config/jhbuildrc (10.67 KB, patch)
2011-07-10 11:22 UTC, Thomas Andersen
none Details | Review
Use XDG_CONFIG_DIR (14.52 KB, patch)
2011-07-11 15:52 UTC, Thomas Andersen
none Details | Review
Use XDG_CONFIG_HOME & no config file (12.01 KB, patch)
2011-09-01 12:35 UTC, Craig Keogh
needs-work Details | Review
[doc] Add XDG_CONFIG_HOME & no config (5.02 KB, patch)
2011-09-01 12:36 UTC, Craig Keogh
none Details | Review
Remove 'create a ~/.jhbuildrc' from Makefile (858 bytes, patch)
2011-09-01 12:37 UTC, Craig Keogh
committed Details | Review
Use XDG_CONFIG_HOME & no config file (11.78 KB, patch)
2012-05-20 12:51 UTC, Craig Keogh
committed Details | Review
doc: Add XDG_CONFIG_HOME & no config (5.05 KB, patch)
2012-05-20 12:52 UTC, Craig Keogh
committed Details | Review
Update tests to match Config's updated constructor (887 bytes, patch)
2012-05-20 12:52 UTC, Craig Keogh
committed Details | Review

Description William Jon McCann 2011-04-02 05:12:18 UTC
Would be nice to use g_get_user_config_dir() instead of home for .jhbuildrc.
Comment 1 Frederic Peters 2011-04-02 06:54:03 UTC
Obviously we do not want a glib dependency in jhbuild, I assume you meant XDG_CONFIG_HOME?
Comment 2 William Jon McCann 2011-04-02 16:49:51 UTC
Created attachment 184948 [details] [review]
Use XDG_CONFIG_DIR
Comment 3 Craig Keogh 2011-04-04 04:49:06 UTC
Comment on attachment 184948 [details] [review]
Use XDG_CONFIG_DIR

Fixing this bug will require an update to the JHBuild manual.
Comment 4 Craig Keogh 2011-04-19 11:17:40 UTC
Review of attachment 184948 [details] [review]:

If I do: 'jhbuild -f no-such-file list', the following should not be displayed:
W: You may wish to move /home/Oxyde/.jhbuildrc to no-such-file

Only this should be displayed:
jhbuild: could not load config file, no-such-file is missing

I think the message could be improved. How about?
'The default location of the configuration file has changed. Please move %s to %s.'

I think this is a good opportunity to change the name of the file from jhbuildrc. I think the filename should end in '.py' so users get syntax highlighting for free in their editor. I would prefer 'conf' rather than 'rc', but I'm not too fussed.

When JHBuild changes XDG_CONFIG_HOME I want a JHBuild release to occur within two days of the git push. That is so the online JHBuild manual [1] is accurate for first time users. The wiki [2] needs updating too, but that's easy.

[1] http://developer.gnome.org/jhbuild/stable/
[2] http://live.gnome.org/Jhbuild
Comment 5 Frederic Peters 2011-04-19 13:56:40 UTC
The improved message suggestion needs to use the %(varname)s syntax as the replaced parts may appear in a different order in different languages.

Don't hesitate to push me for a tarball release, whenever you feel the online manual needs to be updated.
Comment 6 Craig Keogh 2011-04-20 11:01:03 UTC
The following files also need to be updated:
buildbot/README
doc/C/jhbuild.xml
examples/sample.jhbuildrc
jhbuild/defaults.jhbuildrc
jhbuild/moduleset.py
jhbuild/versioncontrol/tarball.py
jhbuild/versioncontrol/hg.py
jhbuild/versioncontrol/fossil.py
jhbuild/versioncontrol/mtn.py
jhbuild/versioncontrol/bzr.py
jhbuild/versioncontrol/arch.py
jhbuild/versioncontrol/darcs.py
Makefile.plain
README
Comment 7 Thomas Andersen 2011-07-10 11:22:33 UTC
Created attachment 191614 [details] [review]
Update location to ~/.config/jhbuildrc

Just a trivial patch that updates the files listed comment #6. The file is still called jhbuildrc though
Comment 8 Thomas Andersen 2011-07-11 15:52:43 UTC
Created attachment 191733 [details] [review]
Use XDG_CONFIG_DIR

Patch updated for comments. The file is still called jhbuildrc. I think a rename should be a separate commit.
Comment 9 Craig Keogh 2011-08-14 12:15:35 UTC
Frédéric,

What is your preference?
~/.config/jhbuildconf.py
~/.config/jhbuildrc.py
~/.config/jhbuildrc
or other?
Comment 10 Frederic Peters 2011-08-15 06:44:46 UTC
I'd be for keeping jhbuildrc, I don't want to advertise too much that it's in fact a Python file.

Also we should now consider the bug report asking for jhbuild to work without a jhbuildrc, in that situation we shouldn't display "you should move your configuration file" and then continue with default values, if ~/.jhbuildrc is found, I suggest to load it, not to abort.
Comment 11 Craig Keogh 2011-09-01 12:35:31 UTC
Created attachment 195379 [details] [review]
Use XDG_CONFIG_HOME & no config file


This patch solves this bug 646510 and bug 655763 (JHBuild should work without a config file ~/.jhbuildrc, use defaults). The two are closely related.
JHBuild will use ~/.config/jhbuildrc (the default) or ~/.jhbuildrc. No warning or error will be displayed if using the old location - there is no reason to. But JHBuild will display an error is both ~/.config/jhbuildrc and ~/.jhbuildrc are present - to prevent the user editing ~/.jhbuildrc and wondering why the changes are being used.

The patch improves some error messages. Before:
'perhaps you need to add use_local_modulesets = True to your .jhbuildrc.'
Now it correct config file is displayed respecting '-f' and JHBUILDRC environment variable.

This bug, bug 655763, bug 656611, bug 655714 should all be fixed together. In the one push. A JHBuild tarball should be rolled (to update the manual on the GNOME website) soon after and the wiki updated.
	

Based on patch by Thomas Hindoe Paaboel Andersen
Based on patch by William Jon McCann
Comment 12 Craig Keogh 2011-09-01 12:36:24 UTC
Created attachment 195380 [details] [review]
[doc] Add XDG_CONFIG_HOME & no config


Update manual, default config location is now ~/.config/jhbuildrc and config file now not required.
Comment 13 Craig Keogh 2011-09-01 12:37:03 UTC
Created attachment 195381 [details] [review]
Remove 'create a ~/.jhbuildrc' from Makefile
Comment 14 Craig Keogh 2012-01-20 11:50:33 UTC
Review of attachment 195379 [details] [review]:

Doesn't work with no config file.
Breaks tests/tests.py.
Needs update to remove arch.py
Comment 15 William Jon McCann 2012-05-11 23:56:16 UTC
So what exactly is needed to resolve this?
Comment 16 Craig Keogh 2012-05-12 11:57:41 UTC
(In reply to comment #15)
> So what exactly is needed to resolve this?

Fix up the remaining issues with attachment 195379 [details] [review] as per my comment 14.
Comment 17 Craig Keogh 2012-05-20 12:51:44 UTC
Created attachment 214490 [details] [review]
Use XDG_CONFIG_HOME & no config file


Addresses problems from comment 14.
Comment 18 Craig Keogh 2012-05-20 12:52:21 UTC
Created attachment 214491 [details] [review]
doc: Add XDG_CONFIG_HOME & no config
Comment 19 Craig Keogh 2012-05-20 12:52:52 UTC
Created attachment 214492 [details] [review]
Update tests to match Config's updated constructor
Comment 20 Craig Keogh 2012-06-04 22:45:02 UTC
I'll commit these patches in a few weeks, if no objection. I have tested the patches. After commit, I'll ask Frédéric to roll a new JHBuild tarball so the on-line docs update.
Comment 21 Craig Keogh 2012-06-17 11:16:09 UTC
Comment on attachment 214490 [details] [review]
Use XDG_CONFIG_HOME & no config file

Committed.
http://git.gnome.org/browse/jhbuild/commit/?id=1f5848b16522de6a29e5119eacca86a4fd266935
Comment 22 Craig Keogh 2012-06-17 11:16:28 UTC
Comment on attachment 214491 [details] [review]
doc: Add XDG_CONFIG_HOME & no config

Committed.
http://git.gnome.org/browse/jhbuild/commit/?id=c38c95b6765000407a5f79665d6fd0fd6fbc3aa0
Comment 23 Craig Keogh 2012-06-17 11:16:49 UTC
Comment on attachment 195381 [details] [review]
Remove 'create a ~/.jhbuildrc' from Makefile

Committed.
http://git.gnome.org/browse/jhbuild/commit/?id=a7dbee1b9cb91f79c0ad39cacfa4e4788dc5ff54
Comment 24 Craig Keogh 2012-06-17 11:17:07 UTC
Comment on attachment 214492 [details] [review]
Update tests to match Config's updated constructor

Committed.
http://git.gnome.org/browse/jhbuild/commit/?id=c8dc4a9421f63c277ba1960144b30677e7cf977d
Comment 25 Owen Taylor 2013-04-23 19:30:45 UTC
The committed patch uses either .jhbuildrc or ~/.config/jhbuildrc and if both exists, shows:

 The default location of the configuration 
 file has changed. Please move %(old_path)s
 to %(new_path)s.

If you are going to treat this as an error, the error message should be clear  what the error is, and not recommending moving a file to a place where there is already a file. (If the user is using mv blindly, they'll overwrite, otherwise just not know what to do.)

 Both ~/.jhbuildrc and ~/.config/jhbuildrc exist, it is unclear what
 configuration you want to use. ~/.config/jhbuildrc is now the
 recommended location for this configuration file. If it has the correct
 contents, please remove ~/.jhbuildrc.

Or something like that.
Comment 26 GNOME Infrastructure Team 2021-05-17 15:51:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/112.