diff options
author | Miroslav Lichvar <mlichvar@redhat.com> | 2010-09-15 07:00:13 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-09-15 07:00:13 -0400 |
commit | 8df3cd9a391595a394d9f3e4cda0e7a8cd976c2f (patch) | |
tree | 9d85832a5b105d201b2eff1aa80c9878019c09da | |
parent | c10da47e598c748227bbc726314008c53d3a247b (diff) | |
download | gpsd-8df3cd9a391595a394d9f3e4cda0e7a8cd976c2f.tar.gz |
Make the hotplug wrapper work when USBAUTO is not set.
The wrapper doesn't seem to work when USBAUTO is not set, this is
because [ -n ] gives different result than [ -n "" ], addressed by
the attached patch.
It includes also the options remapping to be consistent with the rpm
init script and sysconfig file, and adds /usr/sbin to PATH which is
needed on some systems to find gpsd in the hotplug script.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | gpsd.hotplug.wrapper | 11 |
3 files changed, 12 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index c0a37b04..7bc8430d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,9 +1,12 @@ + # Automake description for gpsd # # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. # +ACLOCAL_AMDFLAGS = -I m4 + CLEANFILES = # For a detailed explanation of what this ugly code is doing, see diff --git a/configure.ac b/configure.ac index 9281214b..b8f05bea 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,7 @@ AM_INIT_AUTOMAKE(gpsd, 2.96~dev) dnl AC_PREFIX_PROGRAM(gcc) AM_CONFIG_HEADER(gpsd_config.h) AC_LANG([C]) +AC_CONFIG_MACRO_DIR([m4]) # ACREQUIRE_BUGFIX # ---------------- diff --git a/gpsd.hotplug.wrapper b/gpsd.hotplug.wrapper index 325fca9b..f011adc7 100644 --- a/gpsd.hotplug.wrapper +++ b/gpsd.hotplug.wrapper @@ -3,20 +3,25 @@ # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. +PATH=/usr/sbin:$PATH +export PATH + if [ -r /etc/default/gpsd ]; then . /etc/default/gpsd elif [ -r /etc/sysconfig/gpsd ]; then . /etc/sysconfig/gpsd + GPSD_OPTIONS=$OPTIONS + GPSD_SOCKET=$CONTROL_SOCKET fi -if [ -n $GPSD_OPTIONS ]; then +if [ -n "$GPSD_OPTIONS" ]; then export GPSD_OPTIONS fi -if [ -n $GPSD_SOCKET ]; then +if [ -n "$GPSD_SOCKET" ]; then export GPSD_SOCKET fi -if [ -n $USBAUTO ]; then +if [ -n "$USBAUTO" ]; then [ "$USBAUTO" = "true" ] || exit 0 fi |