mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-16 07:20:34 +01:00
Support XDG Base Dir Spec 0.8.
This version of the spec (latest as of 27.12.2021) adds a variable `$XDG_STATE_HOME` that may be used for log files, as described: ``` ... $XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or empty, a default equal to $HOME/.local/state should be used. The $XDG_STATE_HOME contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME. It may contain: actions history (logs, history, recently used files, …) ... ``` - https://specifications.freedesktop.org/basedir/0.8/ Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/836>
This commit is contained in:
parent
78c557d974
commit
444822f7c1
5 changed files with 11 additions and 11 deletions
|
|
@ -1162,12 +1162,12 @@ xf86LogInit(void)
|
|||
if (xf86LogFileFrom == X_DEFAULT) {
|
||||
/* When not running as root, we won't be able to write to /var/log */
|
||||
if (geteuid() != 0) {
|
||||
if ((env = getenv("XDG_DATA_HOME")))
|
||||
if ((env = getenv("XDG_STATE_HOME")))
|
||||
snprintf(buf, sizeof(buf), "%s/%s", env,
|
||||
DEFAULT_XDG_DATA_HOME_LOGDIR);
|
||||
DEFAULT_XDG_STATE_HOME_LOGDIR);
|
||||
else if ((env = getenv("HOME")))
|
||||
snprintf(buf, sizeof(buf), "%s/%s/%s", env,
|
||||
DEFAULT_XDG_DATA_HOME, DEFAULT_XDG_DATA_HOME_LOGDIR);
|
||||
DEFAULT_XDG_STATE_HOME, DEFAULT_XDG_STATE_HOME_LOGDIR);
|
||||
|
||||
if (env) {
|
||||
xf86_mkdir_p(buf);
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ as the
|
|||
server log file. The default log file when running as root is
|
||||
.BI @logdir@/Xorg. n .log
|
||||
and for non root it is
|
||||
.BI $XDG_DATA_HOME/xorg/Xorg. n .log
|
||||
.BI $XDG_STATE_HOME/xorg/Xorg. n .log
|
||||
where
|
||||
.I n
|
||||
is the display number of the
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ The default log file name when running as root is
|
|||
.RE
|
||||
and for non root it is
|
||||
.RS 11
|
||||
.RI $XDG_DATA_HOME/xorg/Xorg. <n> .log
|
||||
.RI $XDG_STATE_HOME/xorg/Xorg. <n> .log
|
||||
.RE
|
||||
.PP
|
||||
.RS 7
|
||||
|
|
|
|||
|
|
@ -371,8 +371,8 @@ xorg_data.set('XORG_VERSION_CURRENT', release)
|
|||
xorg_data.set_quoted('XF86CONFIGFILE', 'xorg.conf')
|
||||
xorg_data.set_quoted('XCONFIGFILE', 'xorg.conf')
|
||||
xorg_data.set_quoted('XCONFIGDIR', 'xorg.conf.d')
|
||||
xorg_data.set_quoted('DEFAULT_XDG_DATA_HOME', '.local/share')
|
||||
xorg_data.set_quoted('DEFAULT_XDG_DATA_HOME_LOGDIR', 'xorg')
|
||||
xorg_data.set_quoted('DEFAULT_XDG_STATE_HOME', '.local/state')
|
||||
xorg_data.set_quoted('DEFAULT_XDG_STATE_HOME_LOGDIR', 'xorg')
|
||||
xorg_data.set_quoted('DEFAULT_LOGDIR', log_dir)
|
||||
xorg_data.set_quoted('DEFAULT_LOGPREFIX', 'Xorg.')
|
||||
xorg_data.set_quoted('DEFAULT_MODULE_PATH', join_paths(get_option('prefix'), module_dir))
|
||||
|
|
|
|||
|
|
@ -51,11 +51,11 @@
|
|||
/* Default logfile prefix */
|
||||
#mesondefine DEFAULT_LOGPREFIX
|
||||
|
||||
/* Default XDG_DATA dir under HOME */
|
||||
#mesondefine DEFAULT_XDG_DATA_HOME
|
||||
/* Default XDG_STATE dir under HOME */
|
||||
#mesondefine DEFAULT_XDG_STATE_HOME
|
||||
|
||||
/* Default log dir under XDG_DATA_HOME */
|
||||
#mesondefine DEFAULT_XDG_DATA_HOME_LOGDIR
|
||||
/* Default log dir under XDG_STATE_HOME */
|
||||
#mesondefine DEFAULT_XDG_STATE_HOME_LOGDIR
|
||||
|
||||
/* Building DRI-capable DDX. */
|
||||
#mesondefine XF86DRI
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue