Julien Cristau pushed to branch debian-unstable at X Strike Force / xserver / 
xorg-server


Commits:
fdabbaca by Eli Schwartz at 2018-07-03T11:46:23+02:00
debian/local/xvfb-run: Fix use of deprecated tempfile utility

tempfile is pretty well guaranteed to not be available on other
distributions, and continuing to use it over mktemp just encourages bad
scripting practices.

It was unnecessary here anyway as the parent directory was already
securely created and it was only being used to combine file creation and
variable assignment in one command (by taking advantage of the fact that
tempfile, when given a hardcoded filename, will also print the same
filename back to you). It makes much more sense to simply set the
variable, and `touch` the file separately.

- - - - -
72da781e by Eli Schwartz at 2018-07-03T11:46:28+02:00
debian/local/xvfb-run: Use builtin `case` to test variable value, rather than 
external `expr`

This is both faster and more pretty. Because case statements are just
that awesome.

- - - - -
819b2f0c by Julien Cristau at 2018-07-03T11:52:45+02:00
xvfb-run: use "command -v" rather than "which"

Using a shell builtin is preferable to an external command, and 
"which"
may not be available on some systems such as Arch Linux.

This is not currently strictly conformant with Debian policy as "command
-v" is not part of SUSv3, but policy is in the process of being updated,
see bug#864615.

Debian bug#889676

- - - - -


1 changed file:

- debian/local/xvfb-run


Changes:

=====================================
debian/local/xvfb-run
=====================================
--- a/debian/local/xvfb-run
+++ b/debian/local/xvfb-run
@@ -22,9 +22,9 @@ XAUTHPROTO=.
 # the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while the
 # script is running, and this cannot, only being calculated once.)
 DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true
-if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
-    DEFCOLUMNS=80
-fi
+case "$DEFCOLUMNS" in
+    *[!0-9]*|'') DEFCOLUMNS=80 ;;
+esac
 
 # Display a message, wrapping lines at the terminal width.
 message () {
@@ -134,7 +134,7 @@ if [ -z "$*" ]; then
     exit 2
 fi
 
-if ! which xauth >/dev/null; then
+if ! command -v xauth >/dev/null; then
     error "xauth command not found"
     exit 3
 fi
@@ -146,8 +146,9 @@ trap clean_up EXIT
 # directory to house one.
 if [ -z "$AUTHFILE" ]; then
     XVFB_RUN_TMPDIR="$(mktemp -d -t $PROGNAME.XXXXXX)"
+    AUTHFILE="$XVFB_RUN_TMPDIR/Xauthority"
     # Create empty file to avoid xauth warning
-    AUTHFILE=$(tempfile -n "$XVFB_RUN_TMPDIR/Xauthority")
+    touch "$AUTHFILE"
 fi
 
 # Start Xvfb.



View it on GitLab: 
https://salsa.debian.org/xorg-team/xserver/xorg-server/compare/f4c044532683c65cbea6081806f8395f66ae430f...819b2f0c51c0286c8335263417f6b1a1b9a8e21d

-- 
View it on GitLab: 
https://salsa.debian.org/xorg-team/xserver/xorg-server/compare/f4c044532683c65cbea6081806f8395f66ae430f...819b2f0c51c0286c8335263417f6b1a1b9a8e21d
You're receiving this email because of your account on salsa.debian.org.

Reply via email to