Re: [dev] Re: [ANN] wmii 3.9.1 released

From: Kris Maglione <maglione.k_AT_gmail.com>
Date: Wed, 9 Jun 2010 00:14:19 -0400

On Tue, Jun 08, 2010 at 09:06:55PM -0700, Suraj Kurapati wrote:
>On Tue, Jun 8, 2010 at 10:49 AM, David Engster <deng_AT_randomsample.de> wrote:
>> wmiir read /event | awk '/./ { print; fflush() } END { print "" }'
>
>What's the purpose of awk here? I see the same result both with and
>without awk in Arch Linux with awk = GNU Awk 3.1.8.

There's a bug in dash 0.5.6's job control where a SIGCHLD
interrupts the read loop, thereby killing wmiirc whenever a
program exits. At any rate, I'm taking a different tack, if
anyone would like to test it:

diff --git a/cmd/wmii.sh.sh b/cmd/wmii.sh.sh
--- a/cmd/wmii.sh.sh
+++ b/cmd/wmii.sh.sh
@@ -196,19 +196,14 @@ wi_eventloop() {
           if [ "$1" = -i ]
           then cat
           else wmiir read /event
- fi | awk '/./ { print; fflush() } END { print "" }' |
- while :; do
- # Work around a dash bug.
- # Only quit on successful read of a blank line.
- read wi_event || continue
- test -n "$wi_event" || break
-
+ fi |
+ while read wi_event; do
                  IFS="$wi_newline"
                  wi_arg=$(echo "$wi_event" | sed 's/^[^ ]* //')
                  unset IFS
                  set -- $wi_event
                  event=$1; shift
- Event $event "$@"
+ ( Event $event "$@" )
          done
          true
  }

-- 
Kris Maglione
Long hair minimizes the need for barbers; socks can be done without;
one leather jacket solves the coat problem for many years; suspenders
are superfluous.
	--Albert Einstein
Received on Wed Jun 09 2010 - 04:14:19 UTC

This archive was generated by hypermail 2.2.0 : Wed Jun 09 2010 - 04:24:01 UTC