question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gsutil ignores XDG basedir spec

See original GitHub issue

Many *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:open
  • Created 3 years ago
  • Reactions:12
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thomasmacleancommented, Oct 19, 2022

Unfortunately we haven’t completed gcloud storage du yet, but we’re planning on starting work on very soon!

1reaction
06kellyjaccommented, Nov 30, 2021

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 put state_dir = /home/blah/.local/share/gsutil (I’ve used XDG_DATA_HOME since it’s more appropriate for state than XDG_CACHE_HOME

https://github.com/GoogleCloudPlatform/gsutil/blob/e886dc4da47463d04c7a623720cbb8e317c71ba0/gslib/commands/config.py#L338-L342

Not tried it though

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use the XDG Base Directory Specification!
The XDG Base Directory Specification specifies the directories to store user application data on Linux. Use it! ... Easier to temporarily ignore the...
Read more >
XDG Base Directory Specification
The XDG Base Directory Specification is based on the following concepts: ... variables it should consider the path invalid and ignore it.
Read more >
XDG Base Directory - ArchWiki
Application Legacy Path Supported Since ALSA ~/.asoundrc 577df36 · 1.2.3 Android Studio ~/.AndroidStudioX.X Android Studio 4.1 Anki ~/Anki , ~/Documents/Anki
Read more >
Rclone - command line program to sync files and directories to ...
--ignore-checksum Normally rclone will check that the checksums of ... Comply with XDG Base Directory specification (Dario Giovannetti) • this moves the ...
Read more >
Changelog - Rclone
Ignore checksums for files using the different method (Lesmiscore); Handle hash symbol ... Comply with XDG Base Directory specification (Dario Giovannetti).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found