cleaned up redundant sound playing script, adjusted clam to cope.
authorChris Koeritz <fred@gruntose.com>
Wed, 8 Jan 2014 16:18:43 +0000 (11:18 -0500)
committerChris Koeritz <fred@gruntose.com>
Wed, 8 Jan 2014 16:18:43 +0000 (11:18 -0500)
scripts/clam/exit_make.sh
scripts/clam/rules.def
scripts/clam/sound_play.sh [deleted file]

index 5b807ab11073d582b88e950ff03d141fad899633..5f09d6958703e5d02145ddf2418a14a0d360903f 100755 (executable)
@@ -3,6 +3,6 @@
 # than a fresh build next time.
 rm -f $FLAG_FILES $SUB_FLAG_FILES
 if [ ! -z "$CLAM_ERROR_SOUND" ]; then
-  bash $CLAM_DIR/sound_play.sh $CLAM_ERROR_SOUND
+  bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh $CLAM_ERROR_SOUND
 fi
 exit 1;  # cause an error to stop the make.
index a6f65b5b3180dfb9c4a0b969e55cf3174d4cd610..b73a06c2b1d24abef442ea171afd2c17c4580e06 100644 (file)
@@ -79,7 +79,7 @@ endif
 ifeq "$(NOT_FIRST_MAKE)" ""
        $(HIDESH) -c '\
 if [ ! -f "$(FAILURE_FILE)" ]; then \
-  $(SHELL) $(CLAM_DIR)/sound_play.sh $(CLAM_FINISH_SOUND); \
+  $(SHELL) $(FEISTY_MEOW_SCRIPTS)/multimedia/sound_play.sh $(CLAM_FINISH_SOUND); \
 fi'
 endif
 # toss the flag files so we do not see them again.
diff --git a/scripts/clam/sound_play.sh b/scripts/clam/sound_play.sh
deleted file mode 100755 (executable)
index c66dbd0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-# play the sound files specified.
-
-# locates a process given a search pattern to match in the process list.
-# copied from functions.h in yeti to avoid intermixing dependencies.
-function psfind {
-  mkdir -p "$TEMPORARIES_DIR"
-  PID_DUMP="$(mktemp "$TEMPORARIES_DIR/zz_pidlist.XXXXXX")"
-  appropriate_pattern='s/^[-a-zA-Z_0-9][-a-zA-Z_0-9]*  *\([0-9][0-9]*\).*$/\1/p'
-    # pattern to use for peeling off the process numbers.
-  extra_flags=
-    # flags to pass to ps if any special ones are needed.
-  if [ "$OS" = "Windows_NT" ]; then
-    # on win32, there is some weirdness to support msys.
-    appropriate_pattern='s/^[   ]*\([0-9][0-9]*\).*$/\1/p'
-    extra_flags=-W
-  fi
-  /bin/ps $extra_flags wuax >$PID_DUMP
-  # remove the first line of the file, search for the pattern the
-  # user wants to find, and just pluck the process ids out of the
-  # results.
-  PIDS_SOUGHT=$(cat $PID_DUMP \
-    | sed -e '1d' \
-    | grep -i "$1" \
-    | sed -n -e "$appropriate_pattern")
-  if [ ! -z "$PIDS_SOUGHT" ]; then echo "$PIDS_SOUGHT"; fi
-  /bin/rm $PID_DUMP
-}
-
-if [ $# -lt 1 ]; then
-  #echo no sound file specified.
-  exit 0;
-fi
-
-export PLAYCMD=/usr/bin/play
-if [ ! -f "$PLAYCMD" ]; then
-  PLAYCMD=echo
-fi
-
-if [ ! -z "$(psfind pulseaudio)" ]; then
-  # we see artsd running...
-  PLAYCMD=aplay
-elif [ ! -z "$(psfind artsd)" ]; then
-  # we see artsd running...
-  PLAYCMD=artsplay
-elif [ ! -z "$(psfind esd)" ]; then
-  # we see esd running...
-  PLAYCMD=esdplay
-elif [ ! -z "$WINDIR" ]; then
-  # kludge for win32; we provide our own sound player.
-  PLAYCMD=$CLAM_BIN/playsound
-fi
-
-# play the sounds individually; playsound can handle multiple files, but
-# "play" doesn't want to on some systems.
-for i in $*; do
-  ($PLAYCMD $i &>/dev/null &);
-done
-
-exit 0