[PATCH] debuginfod-client: default to XDG cache.
Fri Feb 28 00:01:00 GMT 2020
On Fri, Feb 21, 2020 at 3:09 PM Mark Wielaard <firstname.lastname@example.org> wrote:
> I think the spec is slightly ambiguous whether or not you need to
> create all parents.
> If, when attempting to write a file, the destination directory is
> non-existant an attempt should be made to create it with permission
> But I think that means we should only create the cachedir (either
> $XDG_CACHE_HOME or $HOME/.cache). Which is what we are doing here. But
> I don't think we are expected to create all parents. I think it is
> reasonable to assume they already exist (it would almost always be
> $HOME anyway).
> Later in the code we create target_cache_path (the debuginfod_client
> subdir), again just as one directory (we made sure its parent exists).
Makes sense, I stuck with this approach in the revised patch I've attached.
Also I ended up not attempting to rename a cache at the old default location.
IMO it brings negligible benefits while adding extra complexity plus the risk
of confusing users is greater than if we just leave the old cache where it is.
> BTW. Looking at the code again I see this comment should be adjusted
> /* set paths needed to perform the query
> example format
> cache_path: $HOME/.debuginfod_cache
> target_cache_dir: $HOME/.debuginfod_cache/0123abcd
> target_cache_path: $HOME/.debuginfod_cache/0123abcd/debuginfo
> $HOME/.debuginfod_cache/0123abcd/source#PATH#TO#SOURCE ?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13409 bytes
Desc: not available
More information about the Elfutils-devel