Package: xvfb
Version: 2:1.3.0.0.dfsg-12
Severity: wishlist
File: /usr/bin/xvfb-run
Tags: patch
I had the need to use the xvfb-run script with another xserver. With the
attached patch, you can choose e.g. Xephyr over xvfb, to actually watch
your testscript. This way, it is more easy to debug the testscripts.
Find attached my modifications to xvfb-run and the manpage, both as
derived versions x-run and x-run.1 in full and diff format.
Feel free to submit this upstream and/or apply this to the debian
package.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.20.4-gernoth-64bit (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages xvfb depends on:
ii libc6 2.6.1-1+b1 GNU C Library: Shared libraries
ii libfontenc1 1:1.0.4-2 X11 font encoding library
ii libxau6 1:1.0.3-2 X11 authorisation library
ii libxdmcp6 1:1.0.2-2 X11 Display Manager Control Protoc
ii libxfont1 1:1.3.1-1 X11 font rasterisation library
Versions of packages xvfb recommends:
ii xbase-clients1:7.2.ds2-2 miscellaneous X clients
ii xfonts-base 1:1.0.0-5 standard fonts for X
-- no debconf information
x-run
Description: application/shellscript
--- /usr/bin/xvfb-run 2007-08-09 19:39:25.0 +0200
+++ x-run 2007-09-26 11:21:01.837891000 +0200
@@ -9,9 +9,12 @@
# If anyone is using this to build a Debian package, make sure the package
# Build-Depends on xvfb, xbase-clients, and xfonts-base.
+# This script is heavily based on /usr/bin/xvfb-run as found on debian
+# systems
+
set -e
-PROGNAME=xvfb-run
+PROGNAME=x-run
SERVERNUM=99
AUTHFILE=
ERRORFILE=/dev/null
@@ -19,6 +22,7 @@
XVFBARGS="-screen 0 640x480x8"
LISTENTCP="-nolisten tcp"
XAUTHPROTO=.
+XSERVER="/usr/bin/Xvfb"
# Query the terminal to establish a default number of columns to use for
# displaying messages to the user. This is used only as a fallback in the
event
@@ -64,6 +68,8 @@
(default: "$XVFBARGS")
-w DELAY --wait=DELAY delay in seconds to wait for Xvfb to start
before running COMMAND (default:
$STARTWAIT)
+-x XSERVER --xserver=XSERVERuse alternative xserver binary (like Xephyr
+or Xnest)
EOF
}
@@ -95,8 +101,8 @@
}
# Parse the command line.
-ARGS=$(getopt --options +ae:f:hn:lp:s:w: \
- --long
auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait:
\
+ARGS=$(getopt --options +ae:f:hn:lp:s:w:x: \
+ --long
auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait:,xserver:
\
--name "$PROGNAME" -- "$@")
GETOPT_STATUS=$?
@@ -118,6 +124,7 @@
-p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
-s|--server-args) XVFBARGS="$2"; shift ;;
-w|--wait) STARTWAIT="$2"; shift ;;
+-x|--xserver) XSERVER="$2"; shift ;;
--) shift; break ;;
*) error "internal error; getopt permitted \"$1\" unexpectedly"
exit 6
@@ -155,16 +162,16 @@
AUTHFILE=$(tempfile -n "$XVFB_RUN_TMPDIR/Xauthority")
fi
-# Start Xvfb.
+# Start $XSERVER
MCOOKIE=$(mcookie)
XAUTHORITY=$AUTHFILE xauth add ":$SERVERNUM" "$XAUTHPROTO" "$MCOOKIE" \
>"$ERRORFILE" 2>&1
-XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >"$ERRORFILE" \
- 2>&1 &
+XAUTHORITY=$AUTHFILE $XSERVER ":$SERVERNUM" $XVFBARGS -auth $AUTHFILE \
+ $LISTENTCP >"$ERRORFILE" 2>&1 &
XVFBPID=$!
sleep "$STARTWAIT"
if ! kill -0 $XVFBPID 2>/dev/null; then
- echo "Xvfb failed to start" >&2
+ echo "$XSERVER failed to start" >&2
exit 1
fi
@@ -174,7 +181,7 @@
RETVAL=$?
set -e
-# Kill Xvfb now that the command has exited.
+# Kill $XSERVER now that the command has exited.
kill $XVFBPID
# Return the executed command's exit status.
.\" Copyright 1998-2004 Branden Robinson <[EMAIL PROTECTED]>.
.\"
.\" This is free software; you may redistribute it and/or modify
.\" it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2,
.\" or (at your option) any later version.
.\"
.\" This is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License with
.\" the Debian operating system, in /usr/share/common-licenses/GPL; if
.\" not, write to the Free Software Foundation, Inc., 59 Temple Place,
.\" Suite 330, Boston, MA 02111-1307 USA
.\"
.\" We need the URL macro from g