t.probe

来自「一个C语言写的快速贝叶斯垃圾邮件过滤工具」· PROBE 代码 · 共 104 行

PROBE
104
字号
#!/bin/sh -x# verify that --db-transaction option is given # precedence over probing for a database environment# to create a wordlist without transaction files:##	bogofilter -d dir -n < /dev/null## or:##	bogofilter -d dir -n --db-transaction=no < /dev/null## to create a wordlist with transaction files, or # to convert to a wordlist with transaction files##	bogofilter -d dir -n --db-transaction=yes < /dev/null. ${srcdir=.}/t.frame# Skip test if non-default configurationif [ -n "$USE_TRANSACTIONS" ] ; then    exit 77fiAUTO_XA=`$BOGOFILTER -C -V 2>&1 | sed -n '2p;' | grep AUTO-XA || :`if [ -z "$AUTO_XA" ]; then    exit 77fiunset BF_FORCE_NON_TRANSACTIONAL || :unset BF_FORCE_TRANSACTIONAL || :OUT=${TMPDIR}/test.outMSG=${TMPDIR}/test.msgLOG=${BOGOFILTER_DIR}/log.0000000001# cksum is POSIX compliant ($HASHTOOL isn't)HASHTOOL=cksumNO="--db-transaction=no"YES="--db-transaction=yes"cat <<EOF > $MSGthis is a test messageEOF# clean up - t.frame may have created everything for usrm -f	${BOGOFILTER_DIR}/log.?????????? \	${BOGOFILTER_DIR}/__db.??? \	${BOGOFILTER_DIR}/lockfile-?# transactions=no;  no log file$BOGOFILTER -C $NO  -H -n -I $MSGif [ -f $LOG ] ; then    echo "Failed test 't=n'" >> $OUT    exit 1fi# probe=yes, no environment;  no log file$BOGOFILTER -C  -H -n -I $MSGif [ -f $LOG ] ; then    echo "Failed test 'p=y, e=n'" >> $OUT    exit 1fi# transactions=yes;  log file should appear$BOGOFILTER -C $YES  -H -s -I $MSGif [ ! -f $LOG ] ; then    echo "Failed test 't=y'" >> $OUT    exit 1fi# probe=yes;  log file should changeBEF=`$HASHTOOL $LOG`$BOGOFILTER -C  -H -n -I $MSGAFT=`$HASHTOOL $LOG`if [ "$BEF" = "$AFT" ] ; then    echo "Failed test 'p=y, e=y'" >> $OUT    echo BEF: $BEF >> $OUT    echo AFT: $AFT >> $OUT    exit 1fi# probe=yes, transactions=no;  log file should not changeBEF=`$HASHTOOL $LOG`$BOGOFILTER -C $NO  -H -s -I $MSGAFT=`$HASHTOOL $LOG`if [ "$BEF" != "$AFT" ] ; then    echo "Failed test 'p=y, t=n'" >> $OUT    echo BEF: $BEF >> $OUT    echo AFT: $AFT >> $OUT    exit 1fi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?