From d6dfd07d2d58cd09eaefb842f83c5f2739035ead Mon Sep 17 00:00:00 2001 From: thierry Date: Mon, 11 Jan 2010 09:21:55 +0000 Subject: [PATCH] fixed --- scripts/trash-failed-builds.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/trash-failed-builds.sh b/scripts/trash-failed-builds.sh index 72682be..95656ff 100755 --- a/scripts/trash-failed-builds.sh +++ b/scripts/trash-failed-builds.sh @@ -1,11 +1,13 @@ #!/bin/sh -[[ -d $1 ]] && { cd $1; echo "cwd now is $(pwd)"; shift; } +function myecho () { [ -n "$DEBUG" ] && echo "$@" ; } -for ko in *.log.txt.ko ; do - echo ============== $i +[[ -d $1 ]] && { cd $1; myecho "cwd now is $(pwd)"; shift; } + +for ko in $(ls -1 *.log.txt.ko 2> /dev/null) ; do base=$(basename $ko .log.txt.ko) + myecho "============== $base (from $ko)" for f in $base $base.log.txt $ko ; do - [ -e $f ] && { echo "Trashing $f" ; mv $f /build/trash ; } + [ -e $f ] && { myecho "Trashing $f" ; mv $f /build/trash ; } done done -- 2.47.0