From: Chris Koeritz Date: Wed, 8 Jan 2014 16:18:43 +0000 (-0500) Subject: cleaned up redundant sound playing script, adjusted clam to cope. X-Git-Tag: 2.140.90~842 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=4f9dfa7a9756ac7619824845c07a936c73650ab2;p=feisty_meow.git cleaned up redundant sound playing script, adjusted clam to cope. --- diff --git a/scripts/clam/exit_make.sh b/scripts/clam/exit_make.sh index 5b807ab1..5f09d695 100755 --- a/scripts/clam/exit_make.sh +++ b/scripts/clam/exit_make.sh @@ -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. diff --git a/scripts/clam/rules.def b/scripts/clam/rules.def index a6f65b5b..b73a06c2 100644 --- a/scripts/clam/rules.def +++ b/scripts/clam/rules.def @@ -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 index c66dbd0d..00000000 --- a/scripts/clam/sound_play.sh +++ /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