GNOME Bugzilla – Bug 655714
Change default install directory to inside users home directory
Last modified: 2014-04-14 12:45:04 UTC
Change default install directory to inside users home directory. This bug is inspired by Owen Taylor: http://mail.gnome.org/archives/desktop-devel-list/2011-July/msg00100.html
There will be a lot of documentation to change, but that's fine. The only slightly tricky thing about this I see is detecting the case where the user was actually using the default in defaults.jhbuildrc, in other words if you had just an empty .jhbuildrc and were *actually* using /opt/gnome for installs.
What should the default prefix be? Maybe ~/.local, but I like to 'rm -rf prefix' so ~/.local is a bad idea. Other ideas I thought of: ~/install ~/sandbox ~/prefix Any suggestions?
xdg-user-dirs only provides the following. None suit. DESKTOP=Desktop DOWNLOAD=Downloads TEMPLATES=Templates PUBLICSHARE=Public DOCUMENTS=Documents MUSIC=Music PICTURES=Pictures VIDEOS=Videos How about: ~/Applications/jhbuildgnome 'Applications' wouldn't be localized, but users could localize themselves via the config file. This is just the default.
Setting prefix to ~/whatever is always the first thing I tell new users. A combination of this and working without a .jhbuildrc would make jhbuild a lot easier to get started with. How about ~/.local/share/jhbuild/built? It is a bit long but I guess you don't need to go there very often if programs are started with "jhbuild run"
<bikeshed> ~/.local is, well, hidden :) I have ~/jhbuild/src for checkouts (including jhbuild itself, so there is a ~/jhbuild/src/jhbuild), and ~/jhbuild/install for the installed/built tree. It works quite well and is quite visible.
Ryan Lortie (desrt) has [1]: ~/jhbuild/jhbuild ~/jhbuild/checkout ~/jhbuild/install It appears ~/jhbuild is popular. Keeping everything JHBuild within ~/jhbuild is popular. So I propose: ~/jhbuild/src/jhbuild - for jhbuild itself, and update 'getting started' of the manual. ~/jhbuild/src - for checkoutroot ~/jhbuild/downloads - for tarballdir ~/jhbuild/install - for prefix [1] https://live.gnome.org/Jhbuild/desrt%27sSetup
Craig, this sounds quite good. I wasn't aware that you can have a separate directory for tarballs. It sounds handy for when you wipe all of src and start a fresh build - the tarballs can still be reused.
*** Bug 656611 has been marked as a duplicate of this bug. ***
I have been testing this setup for a few days. One thing I noticed is that checking out modules in git.gnome.org that are not in the modulesets no longer works. E.g. I cannot do "updateone msitools".
(In reply to comment #7) > Craig, this sounds quite good. I wasn't aware that you can have a separate > directory for tarballs. It sounds handy for when you wipe all of src and start > a fresh build - the tarballs can still be reused. desrt also sets dvcs_mirror_dir to '~/jhbuild/mirror', so that you don't need to re-clone after you delete your repo. Unless I'm mistaken, this just moves the .git folder to that location. Probably more important since clones are a lot bigger than tarballs.
> (In reply to comment #7) > > desrt also sets dvcs_mirror_dir to '~/jhbuild/mirror', so that you don't need > to re-clone after you delete your repo. Unless I'm mistaken, this just moves > the .git folder to that location. Probably more important since clones are a > lot bigger than tarballs. It was cool until I realized my git pushes were going to this extra repo instead.
Maybe it could make sense to keep the checkouts somewhere under ~/.cache, which is automatically excluded by backup tools like DejaDup. And using something under ~/.local for the prefix, much like /usr/local w.r.t. /usr. So: checkoutroot = ~/.cache/jhbuild/checkout prefix = ~/.local/jhbuild
*** Bug 709022 has been marked as a duplicate of this bug. ***
Created attachment 256047 [details] [review] checkout and prefix in home folders
fwiw, I've changed over to this for my personal use: tarballdir = '~/.cache/jhbuild/download' dvcs_mirror_dir = '~/.cache/git' checkoutroot = '~/.cache/jhbuild/checkout' prefix = '~/.cache/jhbuild/install' but I consider that this is maybe slightly confusing for newcomers. I do this for the same reason as comment 12 mentions: avoiding backing this stuff up. This setup is slightly illogical for people who use jhbuild for hacking because then you might want your checkout directory backed up. I never modify what jhbuild checks out, so this is not a concern for me. The reason I have ~/.cache/git separate from the others is because I mirror all of git.gnome.org (and a few other things) and use the mirror repositories from other scripts (like a script I have for quickly checking out such module, as an example).
I went with the proposal from comment 6, this gives visibile directories and a straightforward git setup. commit 053fb5231c0cd13daf9f09353f87cfb24d3536ac Author: Frédéric Péters <fpeters@0d.be> Date: Wed Jan 29 10:25:42 2014 +0000 use ~/jhbuild/ as a base for jhbuild directories This gives: - checkoutroot = ~/jhbuild/src/ - prefix = ~/jhbuild/install/ - tarballdir = ~/jhbuild/install/ Additionally compatibility is kept with older installations that used the default configuration values. https://bugzilla.gnome.org/show_bug.cgi?id=655714
Hooray!
Doc seems outdated with this change. https://developer.gnome.org/jhbuild/unstable/config-reference.html.en has « tarballdir: A string if set, tarballs will be downloaded to the specified directory instead of checkoutroot. » The « Defaults to ~/jhbuild/downloads » bit which was added by this commit does not appear in the online documentation. This also seems to force tarballs to go in ~/jhbuild/downloads even if checkoutroot is overridden in ~/.jhbuildrc but tarballdir is not set. If this is the expected result, imo tarballdir should be listed in examples/sample.jhbuildrc.