From 6533e812c1bf7a0dd11ab4cad530ddc3a0d123ae Mon Sep 17 00:00:00 2001 From: esteel Date: Mon, 29 Jan 2007 23:31:14 +0000 Subject: [PATCH] merged nexuiz-linux-glx.sh and nexuiz-linux-sdl.sh into one file, made it choose glx/sdl depending on filename and made the other file into a symlink git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2152 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- nexuiz-linux-glx.sh | 11 ++++- nexuiz-linux-sdl.sh | 115 +------------------------------------------- 2 files changed, 10 insertions(+), 116 deletions(-) mode change 100755 => 120000 nexuiz-linux-sdl.sh diff --git a/nexuiz-linux-glx.sh b/nexuiz-linux-glx.sh index 5eca32e42..e1097a443 100755 --- a/nexuiz-linux-glx.sh +++ b/nexuiz-linux-glx.sh @@ -6,11 +6,18 @@ link="`readlink \"${0}\"`" [ -n "${link}" ] && path="`dirname \"${link}\"`" cd "${path}" +case "${0##*/}" in + *sdl*) mode="sdl" ;; + *) mode="glx" ;; +esac + case "$(uname -m)" in - x86_64) nexuiz="nexuiz-linux-x86_64-glx" ;; - *) nexuiz="nexuiz-linux-686-glx" ;; + x86_64) arch="x86_64" ;; + *) arch="686" ;; esac +nexuiz="nexuiz-linux-${arch}-${mode}" + set -- ./${nexuiz} "${@}" xserver= diff --git a/nexuiz-linux-sdl.sh b/nexuiz-linux-sdl.sh deleted file mode 100755 index e66af7d0c..000000000 --- a/nexuiz-linux-sdl.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh - -path="`dirname \"${0}\"`" -link="`readlink \"${0}\"`" - -[ -n "${link}" ] && path="`dirname \"${link}\"`" -cd "${path}" - -case "$(uname -m)" in - x86_64) nexuiz="nexuiz-linux-x86_64-sdl" ;; - *) nexuiz="nexuiz-linux-686-sdl" ;; -esac - -set -- ./${nexuiz} "${@}" - -xserver= -xlayout= - -setdisplay() -{ - VALUE=$1 - VALUE=${VALUE#\"} - VALUE=${VALUE%\"} - case "$VALUE" in - :*) - ;; - *) - VALUE=:$VALUE - ;; - esac - VALUE="$VALUE/" - xserver="${VALUE%%/*}" - xserver=${xserver#:} - xlayout=${VALUE#*/} - xlayout=${xlayout%/} -} - -# now how do we execute it? -if [ -r ~/.nexuiz/data/config.cfg ]; then - while read -r CMD KEY VALUE; do - case "$CMD:$KEY" in - seta:vid_x11_display) - setdisplay "$VALUE" - ;; - esac - done < ~/.nexuiz/data/config.cfg -fi - -m=0 -for X in "$@"; do - case "$m:$X" in - 0:+vid_x11_display) - m=1 - ;; - 0:+vid_x11_display\ *) - setdisplay "${X#+vid_x11_display }" - ;; - 1:*) - setdisplay "$X" - m=0 - ;; - *) - ;; - esac -done - -case "$xserver" in - '') - ;; - *[!0-9]*) - echo "Not using display ':$xserver': evil characters" - ;; - *) - msg= - lf=' -' - prefix= - - # check for a listening X server on that socket - if netstat -nl | grep -F " /tmp/.X11-unix/X$xserver" >/dev/null; then - # X server already exists - export DISPLAY=:$xserver - prefix="DISPLAY=:$xserver " - msg=$msg$lf"- Running Nexuiz on already existing display :$xserver" - else - set -- startx "$@" -fullscreen -- ":$xserver" - msg=$msg$lf"- Running Nexuiz on a newly created X server :$xserver." - case "$xlayout" in - '') - ;; - *[!A-Za-z0-9]*) - echo >&2 "Not using layout '$xlayout': evil characters" - xlayout= - ;; - *) - set -- "$@" -layout "$xlayout" - msg=$msg$lf"- Using the ServerLayout section named $xlayout." - ;; - esac - fi - - echo "X SERVER OVERRIDES IN EFFECT:$msg" - echo - echo "Resulting command line:" - echo " $prefix$*" - echo - echo "To undo these overrides, edit ~/.nexuiz/data/config.cfg and remove the line" - echo "starting with 'seta vid_x11_display'." - echo - echo - ;; -esac - -exec "$@" diff --git a/nexuiz-linux-sdl.sh b/nexuiz-linux-sdl.sh new file mode 120000 index 000000000..1e3c60fb4 --- /dev/null +++ b/nexuiz-linux-sdl.sh @@ -0,0 +1 @@ +nexuiz-linux-glx.sh \ No newline at end of file -- 2.39.2