Skip to content

Commit

Permalink
Refactor Xorg path detection into FindXorg function in xorg-test-run.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Jat <[email protected]>
  • Loading branch information
jat001 committed Apr 23, 2024
1 parent c19d876 commit d0ec07d
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions tests/xorg-test-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,30 @@

# Test that Xorg can load the compiled modules

FindXorg()
{
set -- \
/usr/local/libexec/Xorg \
/usr/libexec/Xorg \
/usr/lib/xorg/Xorg \
/usr/lib/Xorg \
/usr/bin/Xorg

for path in "$@"; do
if [ -x "$path" ]; then
echo "$path"
exit
fi
done

if [ -z "$XORG" ]; then
echo 'Xorg'
fi
}

# X server to run
if [ -z "$XORG" ]; then
set -- \
/usr/local/libexec/Xorg \
/usr/libexec/Xorg \
/usr/lib/xorg/Xorg \
/usr/lib/Xorg \
/usr/bin/Xorg

for path in "$@"; do
if [ -x "$path" ]; then
XORG=$path
break
fi
done

if [ -z "$XORG" ]; then
XORG=Xorg
fi
XORG=`FindXorg`
fi

# Client to connect to Xorg
Expand Down

0 comments on commit d0ec07d

Please sign in to comment.