Ticket #46842: xvfb-run.diff

File xvfb-run.diff, 1.3 KB (added by howarth.at.macports@…, 10 years ago)

darwin-specific patch from http://www.hexten.net/wiki/?title=Patch_xvfb-run_for_Mac_OS_X

  • debian/local/xvfb-run

    diff -Nurd -x'*~' xorg-server-1.4.2.orig/debian/local/xvfb-run xorg-server-1.4.2/debian/local/xvfb-run
    old new  
    3131
    3232# Display a message, wrapping lines at the terminal width.
    3333message () {
    34     echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
     34    echo "$PROGNAME: $*" | fmt -w ${COLUMNS:-$DEFCOLUMNS}
    3535}
    3636
    3737# Display an error message.
     
    6969
    7070# Find a free server number by looking at .X*-lock files in /tmp.
    7171find_free_servernum() {
    72     # Sadly, the "local" keyword is not POSIX.  Leave the next line commented in
    73     # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
    74     # anyway.
    75     #local i
     72    local i
    7673
    7774    i=$SERVERNUM
    7875    while [ -f /tmp/.X$i-lock ]; do
     
    152149        error "temporary directory $XVFB_RUN_TMPDIR already exists"
    153150        exit 4
    154151    fi
    155     AUTHFILE=$(tempfile -n "$XVFB_RUN_TMPDIR/Xauthority")
     152    AUTHFILE="$XVFB_RUN_TMPDIR/Xauthority"
     153    touch "$AUTHFILE"
    156154fi
    157155
    158156# Start Xvfb.
    159 MCOOKIE=$(mcookie)
     157MCOOKIE=$(dd if=/dev/urandom bs=1024 count=1 2> /dev/null | md5)
    160158XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
    161159add :$SERVERNUM $XAUTHPROTO $MCOOKIE
    162160EOF