[gjs] tests: use dbus-uuidgen instead of uuidgen



commit 01f7ed7c41d07d6d9bdfdedb34f69474fb4d37f5
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Tue Jun 7 18:12:50 2016 +0100

    tests: use dbus-uuidgen instead of uuidgen
    
    uuidgen is not always installed, even if libuuid is: for example,
    in Debian derivatives it's packaged in uuid-runtime alongside uuidd,
    a daemon that is in practice nearly always unnecessary.
    
    The only use of uuidgen is in a script that already requires
    dbus-daemon, and all it needs is a random hex string, so
    dbus-uuidgen is fine.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=767368
    Reviewed-by: Colin Walters <walters verbum org>
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>

 Makefile-test.am   |    2 +-
 configure.ac       |   11 +++--------
 test/run-with-dbus |    2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/Makefile-test.am b/Makefile-test.am
index 648b375..363e8e8 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -120,7 +120,7 @@ TESTS_ENVIRONMENT =                                                 \
        GJS_PATH= \
        LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(FIREFOX_JS_LIBDIR)"       \
        G_FILENAME_ENCODING=latin1      # ensure filenames are not utf8 \
-       UUIDGEN="$(UUIDGEN)"
+       DBUS_UUIDGEN="$(DBUS_UUIDGEN)"
 
 if ENABLE_COVERAGE
 TESTS_ENVIRONMENT += \
diff --git a/configure.ac b/configure.ac
index 700bcf0..7ea3eb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,14 +237,9 @@ AC_ARG_WITH([dbus-tests],
   [AS_HELP_STRING([--without-dbus-tests],
     [Don't try to use DBus during make check @<:@default=use@:>@])])
 AS_IF([test "x$with_dbus_tests" != "xno"], [
-  AC_PATH_PROG([UUIDGEN], [uuidgen])
-  AS_IF([test -z "$UUIDGEN"],
-    [AC_MSG_ERROR([uuidgen is required for --with-dbus-tests])])
-  AC_MSG_CHECKING([whether $UUIDGEN supports the -r flag])
-  AS_IF([$UUIDGEN -r >/dev/null 2>&1], [
-    AC_MSG_RESULT([yes])
-    UUIDGEN="$UUIDGEN -r"
-  ], [AC_MSG_RESULT([no])])
+  AC_PATH_PROG([DBUS_UUIDGEN], [dbus-uuidgen])
+  AS_IF([test -z "$DBUS_UUIDGEN"],
+    [AC_MSG_ERROR([dbus-uuidgen is required for --with-dbus-tests])])
 ])
 AM_CONDITIONAL([DBUS_TESTS], [test "x$with_dbus_tests" != "xno"])
 
diff --git a/test/run-with-dbus b/test/run-with-dbus
index 93d41f1..dfcd31e 100755
--- a/test/run-with-dbus
+++ b/test/run-with-dbus
@@ -73,7 +73,7 @@ if test -z "$BUILDDIR" ; then
     die "Must set BUILDDIR"
 fi
 
-RANDOM=`${UUIDGEN:-uuidgen -r} | cut -d '-' -f 3`
+RANDOM=`${DBUS_UUIDGEN:-dbus-uuidgen}`
 
 ## this has to be set BEFORE we start session bus,
 ## or stuff the session bus starts won't get it


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]