Re: [PATCH v4 1/4] cache.h: Introduce a generic "xdg_config_home_for(…)" function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021-05-24 10:33:30+0100, Phillip Wood <phillip.wood123@xxxxxxxxx> wrote:
> Hi Lénaïc
> 
> This looks fine to me. I'm not 100% sold on calling the parameter prog as
> our program name later in the series ends up being "systemd/user" so
> something like "subdir" might have been better but that is not worth
> rerolling for.

I'll take the blame for that "prog".
I didn't think very hard at the time of writing :(

Yes, "subdir" is definitely better.
And it's aligned with the XDG Base Directory specifications:

	A user-specific version of the configuration file may be
	created in $XDG_CONFIG_HOME/subdir/filename

> On 24/05/2021 08:15, Lénaïc Huard wrote:
> > Current implementation of `xdg_config_home(filename)` returns
> > `$XDG_CONFIG_HOME/git/$filename`, with the `git` subdirectory inserted
> > between the `XDG_CONFIG_HOME` environment variable and the parameter.
> > 
> > This patch introduces a `xdg_config_home_for(prog, filename)` function
> > which is more generic. It only concatenates "$XDG_CONFIG_HOME", or
> > "$HOME/.config" if the former isn’t defined, with the parameters,
> > without adding `git` in between.
> > 
> > `xdg_config_home(filename)` is now implemented by calling
> > `xdg_config_home_for("git", filename)` but this new generic function can
> > be used to compute the configuration directory of other programs.

-- 
Danh



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux