public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug debuginfod/25502] New: debuginfod client should default to XDG cache
@ 2020-02-04 15:39 tromey at sourceware dot org
  2020-02-06 20:46 ` [Bug debuginfod/25502] " mark at klomp dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2020-02-04 15:39 UTC (permalink / raw)
  To: elfutils-devel

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-28 15:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 15:39 [Bug debuginfod/25502] New: debuginfod client should default to XDG cache tromey at sourceware dot org
2020-02-06 20:46 ` [Bug debuginfod/25502] " mark at klomp dot org
2020-02-06 20:53 ` mark at klomp dot org
2020-02-07 22:37 ` tromey at sourceware dot org
2020-02-11 21:19 ` amerey at redhat dot com
2020-02-18 12:15 ` mark at klomp dot org
2020-02-18 18:18 ` amerey at redhat dot com
2020-02-18 18:52 ` tromey at sourceware dot org
2020-02-28 15:28 ` amerey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).