gsutil ignores XDG basedir spec
See original GitHub issueMany *nix programs now adhere to the XDG Base Directory Specification. I’d love to see gsutil follow suit, or at least gain some built-in compatibility with it.
Here is the spec itself, and while I don’t use Arch Linux, there’s a good write-up on the wiki that explains the spec a bit more. It also has a list of programs that utilize the spec and workarounds for some of those that don’t.
As it specifically relates to gsutil
, it would be nice if the program checked for the configuration file in $XDG_CONFIG_HOME/gsutil/boto
(defaulting back to ~/.boto
), and for the state directory in $XDG_CACHE_HOME/gsutil
(defaulting back to ~/.gsutil
).
(I know you can set the BOTO_CONFIG
environment variable to set the location of the config file, and inside said config file you can specify state_dir
, but when you’re running gsutil
through gcloud
it’s not always obvious where to do that.)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:11 (3 by maintainers)
Unfortunately we haven’t completed
gcloud storage du
yet, but we’re planning on starting work on very soon!Exactly as it says. You’d set
BOTO_CONFIG
to something e.g.~/.config/gsutil/config
and within there you’d put
state_dir = $XDG_DATA_HOME/gsutil
if it accepts vars or manually putstate_dir = /home/blah/.local/share/gsutil
(I’ve usedXDG_DATA_HOME
since it’s more appropriate for state thanXDG_CACHE_HOME
https://github.com/GoogleCloudPlatform/gsutil/blob/e886dc4da47463d04c7a623720cbb8e317c71ba0/gslib/commands/config.py#L338-L342
Not tried it though