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

[Git][xorg-team/xorg][debian-unstable] Rely on command -v to check for an executable



Title: GitLab

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

Commits:

  • 2e175516
    by Jochen Sprickerhof at 2022-12-06T21:30:28+01:00
    Rely on command -v to check for an executable
    
    command -v could prefer shell builtins that don't have a full path (true
    instead of bin/true). Resulting in a failing Xsession for example with:
    
    /etc/X11/Xsession true
    
    As command -v already checks if the command is executable, we can remove
    the extra check.
    
    Closes: #1012474
    Regression of 3d6bd60
    

1 changed file:

Changes:

  • debian/local/Xsession.d/20x11-common_process-args
    ... ... @@ -33,14 +33,8 @@ case $# in
    33 33
             ;;
    
    34 34
           *)
    
    35 35
             # Specific program was requested.
    
    36
    -        STARTUP_FULL_PATH=$(command -v "${1%% *}" || true)
    
    37
    -        if [ -n "$STARTUP_FULL_PATH" ] && [ -e "$STARTUP_FULL_PATH" ]; then
    
    38
    -          if [ -x "$STARTUP_FULL_PATH" ]; then
    
    39
    -            STARTUP="$1"
    
    40
    -          else
    
    41
    -            message "unable to launch \"$1\" X session ---" \
    
    42
    -                    "\"$1\" not executable; falling back to default session."
    
    43
    -          fi
    
    36
    +        if command -v "$1" >/dev/null; then
    
    37
    +          STARTUP="$1"
    
    44 38
             else
    
    45 39
               message "unable to launch \"$1\" X session ---" \
    
    46 40
                       "\"$1\" not found; falling back to default session."
    


  • Reply to: