Don't use pidof in _known_hosts_real() to detect whether Avahi is available

It's not available on MacOS X.
    Thanks to Rainer Müller <raimue@codingfarm.de>
    (bash-completion MacPorts maintainer)
This commit is contained in:
David Paleino 2009-10-11 11:12:09 +02:00
parent e2c20d96e9
commit bb8912b06f
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,12 @@
bash-completion (1.x)
[ David Paleino ]
* Don't use pidof in _known_hosts_real() to detect whether Avahi is
available, since it's not available on MacOS X. Thanks to Rainer
Müller <raimue@codingfarm.de> (bash-completion MacPorts maintainer)
-- David Paleino <d.paleino@gmail.com> Sun, 11 Oct 2009 11:11:57 +0200
bash-completion (1.1)
[ David Paleino ]

View File

@ -1306,11 +1306,9 @@ _known_hosts_real()
# the result. But on Gentoo (at least), -k isn't available
# (even if mentioned in the manpage), so...
if type avahi-browse >&/dev/null; then
if [ -n "$(pidof avahi-daemon)" ]; then
COMPREPLY=( "${COMPREPLY[@]}" $(
compgen -W "$( avahi-browse -cpr _workstation._tcp | \
grep ^= | cut -d\; -f7 | sort -u )" -- "$cur" ) )
fi
COMPREPLY=( "${COMPREPLY[@]}" $(
compgen -W "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \
grep ^= | cut -d\; -f7 | sort -u )" -- "$cur" ) )
fi
# apply suffix and prefix