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

[Git][xorg-team/xorg][debian-unstable] 2 commits: x11-common: Move has_option from 20x11-common_process-args to Xsession



Title: GitLab

Timo Aaltonen pushed to branch debian-unstable at X Strike Force / xorg

Commits:

6 changed files:

Changes:

  • debian/changelog
    1
    +xorg (1:7.7+21) unstable; urgency=medium
    
    2
    +
    
    3
    +  [ Josh Triplett ]
    
    4
    +  * Support /etc/X11/Xsession.options.d/*.conf in addition to
    
    5
    +    Xsession.options, allowing sysadmins to drop configuration snippets there
    
    6
    +    rather than editing /etc/X11/Xsession.options.
    
    7
    +
    
    8
    + -- Josh Triplett <josh@joshtriplett.org>  Fri, 29 Nov 2019 12:34:43 -0800
    
    9
    +
    
    1 10
     xorg (1:7.7+20) unstable; urgency=medium
    
    2 11
     
    
    3 12
       [ Julien Cristau ]
    

  • debian/local/Xsession
    ... ... @@ -60,6 +60,24 @@ USERXSESSIONRC=$HOME/.xsessionrc
    60 60
     ALTUSERXSESSION=$HOME/.Xsession
    
    61 61
     ERRFILE=$HOME/.xsession-errors
    
    62 62
     
    
    63
    +OPTIONS="$(
    
    64
    +  if [ -r "$OPTIONFILE" ]; then
    
    65
    +    cat "$OPTIONFILE"
    
    66
    +  fi
    
    67
    +  if [ -d /etc/X11/Xsession.options.d ]; then
    
    68
    +    run-parts --list --regex '\.conf$' /etc/X11/Xsession.options.d
    
    69
    +  fi
    
    70
    +)"
    
    71
    +
    
    72
    +has_option() {
    
    73
    +  # Ensure that a later no-foo overrides an earlier foo
    
    74
    +  if [ "$(echo "$OPTIONS" | grep -Eo "^(no-)?$1\>" | tail -n 1)" = "$1" ]; then
    
    75
    +    return 0
    
    76
    +  else
    
    77
    +    return 1
    
    78
    +  fi
    
    79
    +}
    
    80
    +
    
    63 81
     # attempt to create an error file; abort if we cannot
    
    64 82
     if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
    
    65 83
       [ ! -L "$ERRFILE" ]; then
    

  • debian/local/Xsession.d/20x11-common_process-args
    ... ... @@ -2,18 +2,6 @@
    2 2
     
    
    3 3
     # This file is sourced by Xsession(5), not executed.
    
    4 4
     
    
    5
    -# read OPTIONFILE
    
    6
    -OPTIONS=$(cat "$OPTIONFILE") || true
    
    7
    -
    
    8
    -has_option() {
    
    9
    -  if [ "${OPTIONS#*
    
    10
    -$1}" != "$OPTIONS" ]; then
    
    11
    -    return 0
    
    12
    -  else
    
    13
    -    return 1
    
    14
    -  fi
    
    15
    -}
    
    16
    -
    
    17 5
     # Determine how many arguments were provided.
    
    18 6
     case $# in
    
    19 7
       0)
    

  • debian/local/Xsession.options.5
    ... ... @@ -18,11 +18,11 @@
    18 18
     .\" Suite 330, Boston, MA 02111-1307 USA
    
    19 19
     .TH Xsession.options 5 "2004\-10\-31" "Debian Project"
    
    20 20
     .SH NAME
    
    21
    -Xsession.options \- configuration options for
    
    21
    +Xsession.options, Xsession.options.d \- configuration options for
    
    22 22
     .BR Xsession (5)
    
    23 23
     .SH DESCRIPTION
    
    24
    -.I /etc/X11/Xsession.options
    
    25
    -contains a set of flags that determine some of the behavior of the
    
    24
    +\fI/etc/X11/Xsession.options\fR and \fI/etc/X11/Xsession.options.d/*.conf\fR
    
    25
    +contain options that determine some of the behavior of the
    
    26 26
     .BR Xsession (5)
    
    27 27
     Bourne shell
    
    28 28
     .RB ( sh (1))
    
    ... ... @@ -31,7 +31,7 @@ See the
    31 31
     .BR Xsession (5)
    
    32 32
     manpage for further information.
    
    33 33
     .PP
    
    34
    -.I Xsession.options
    
    34
    +These configuration files
    
    35 35
     may contain comments, which begin with a hash mark (\(oq#\(cq) and end at
    
    36 36
     the next newline, just like comments in shell scripts.
    
    37 37
     The rest of the file consists of options which are expressed as words
    
    ... ... @@ -39,6 +39,11 @@ separated by hyphens, with only one option per line.
    39 39
     Options are enabled by simply placing them in the file; they are disabled
    
    40 40
     by prefixing the option name with \(oqno\-\(cq.
    
    41 41
     .PP
    
    42
    +Options are read from \fI/etc/X11/Xsession.options\fR, followed by
    
    43
    +\fI/etc/X11/Xsession.options.d/*.conf\fR in sorted order; later occurrences of
    
    44
    +an option (with or without the \(oqno\-\(cq prefix) take precedence over earlier
    
    45
    +occurrences.
    
    46
    +.PP
    
    42 47
     Available options are:
    
    43 48
     .TP
    
    44 49
     .B allow\-failsafe
    

  • debian/local/Xsession.options.d.5
    1
    +Xsession.options.5
    \ No newline at end of file

  • debian/x11-common.manpages
    1 1
     debian/local/Xsession.5
    
    2 2
     debian/local/Xsession.options.5
    
    3
    +debian/local/Xsession.options.d.5


  • Reply to: