All pastes #155233 Raw Edit

Unnamed

public text v1 · immutable
#155233 ·published 2006-08-30 22:22 UTC
rendered paste body
log_check() {
        set +x
        for target in $*
        do
                lf_path="${WORKDIR}/temp/log.do_$target.${PID}"
          
                echo "log_check: Using $lf_path as logfile"
          
                if test -e "$lf_path"
                then
                        lf_txt="`cat $lf_path`"
                    
                        for keyword_die in "Cannot find package" "exit 1" ERR Fail
                        do                              
                                                        
                                if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") &>/dev/null
                                then
                                        echo "log_check: There were error messages in the logfile"
                                        echo -e "log_check: Matched keyword: [$keyword_die]\n"
                                        echo "$lf_txt" | grep -v log_check | grep -i "$keyword_die"
                                        echo ""
                                        do_exit=1
                                fi
                        done
                        test "$do_exit" = 1 && exit 1
                else
                        echo "Cannot find logfile [$lf_path]"
                fi
                echo "Logfile is clean"
        done
        set -x
}