[Bug debuginfod/25502] New: debuginfod client should default to XDG cache
tromey at sourceware dot org
sourceware-bugzilla@sourceware.org
Tue Feb 4 15:39:00 GMT 2020
https://sourceware.org/bugzilla/show_bug.cgi?id=25502
Bug ID: 25502
Summary: debuginfod client should default to XDG cache
Product: elfutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: debuginfod
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
CC: elfutils-devel at sourceware dot org
Target Milestone: ---
The debuginfod client defaults its cache to:
static const char *cache_default_name = ".debuginfod_client_cache";
static const char *cache_path_envvar = DEBUGINFOD_CACHE_PATH_ENV_VAR;
[...]
if (getenv(cache_path_envvar))
strcpy(cache_path, getenv(cache_path_envvar));
else
{
if (getenv("HOME"))
sprintf(cache_path, "%s/%s", getenv("HOME"), cache_default_name);
else
sprintf(cache_path, "/%s", cache_default_name);
}
That is, $HOME/.debuginfod_client_cache in the usual setup.
I think it would be better if this followed the XDG
base directory spec instead.
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
In this case, this text applies:
$XDG_CACHE_HOME defines the base directory relative to which user specific
non-essential data files should be stored. If $XDG_CACHE_HOME is either not set
or empty, a default equal to $HOME/.cache should be used.
I would suggest a subdirectory of this, like .../debuginfod_client
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Elfutils-devel
mailing list