- more efficient filter routine
- fix wrong log message - cleanup & cosmetics, as always
This commit is contained in:
parent
72ef38722d
commit
962e61903a
2 changed files with 17 additions and 23 deletions
|
@ -4,7 +4,7 @@
|
||||||
# Meant to be executed before submitting/committing.
|
# Meant to be executed before submitting/committing.
|
||||||
|
|
||||||
|
|
||||||
SELF=${0/#*\/}
|
SELF=${0##*/}
|
||||||
|
|
||||||
# optional apps
|
# optional apps
|
||||||
RLE=$(which rle &>/dev/null) # http://members.aon.at/mfranz/rle.tar.gz (depends on Qt lib)
|
RLE=$(which rle &>/dev/null) # http://members.aon.at/mfranz/rle.tar.gz (depends on Qt lib)
|
||||||
|
@ -27,8 +27,8 @@ find .|grep " "|while read i; do RESULT "$i"; done
|
||||||
LOG "checking for upper-case extensions ..."
|
LOG "checking for upper-case extensions ..."
|
||||||
find .|while read i; do
|
find .|while read i; do
|
||||||
case "$i" in .|..|CVS/*|*/CVS/*|*.Opt|*.README|*.Po|*.TXT) continue ;; esac
|
case "$i" in .|..|CVS/*|*/CVS/*|*.Opt|*.README|*.Po|*.TXT) continue ;; esac
|
||||||
base=${i/#.*\/}
|
base=${i##*/}
|
||||||
ext=${base/#*./}
|
ext=${base##*.}
|
||||||
[ "$base" == "$ext" ] && continue # has no extension
|
[ "$base" == "$ext" ] && continue # has no extension
|
||||||
ext=${ext//[^a-zA-Z]/}
|
ext=${ext//[^a-zA-Z]/}
|
||||||
[ "$ext" ] || continue # only non-letters
|
[ "$ext" ] || continue # only non-letters
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
# to have the date in the archive name can conveniently achieve this
|
# to have the date in the archive name can conveniently achieve this
|
||||||
# by defining a shell alias in ~/.bashrc:
|
# by defining a shell alias in ~/.bashrc:
|
||||||
#
|
#
|
||||||
# alias submit='fg-submit "${PWD/#*\/}-$(date +%Y-%m-%d)"'
|
# alias submit='fg-submit "${PWD##*/}-$(date +%Y-%m-%d)"'
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -112,8 +112,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SELF=${0/#*\/}
|
SELF=${0##*/}
|
||||||
DIR=${PWD/#*\/}
|
DIR=${PWD##*/}
|
||||||
|
|
||||||
if [ "$1" == "-v" ]; then
|
if [ "$1" == "-v" ]; then
|
||||||
DBG=1
|
DBG=1
|
||||||
|
@ -230,16 +230,16 @@ function search_config {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
set -f
|
|
||||||
RULES=
|
RULES=
|
||||||
|
set -f
|
||||||
if search_config "$PWD"; then
|
if search_config "$PWD"; then
|
||||||
LOG "loading config file $CONFIG"
|
LOG "loading config file $CONFIG"
|
||||||
source "$CONFIG"
|
source "$CONFIG"
|
||||||
elif [ -f ~/$CONFIG_FILE ]; then
|
elif [ -f ~/$CONFIG_FILE ]; then
|
||||||
DEBUG "loading config file $CONFIG"
|
DEBUG "loading config file ~/$CONFIG_FILE"
|
||||||
source ~/$CONFIG_FILE
|
source ~/$CONFIG_FILE
|
||||||
elif [ -f ~/${CONFIG_FILE}rc ]; then
|
elif [ -f ~/${CONFIG_FILE}rc ]; then
|
||||||
DEBUG "loading config file $CONFIG"
|
DEBUG "loading config file ~/${CONFIG}rc"
|
||||||
source ~/${CONFIG_FILE}rc
|
source ~/${CONFIG_FILE}rc
|
||||||
fi
|
fi
|
||||||
set +f
|
set +f
|
||||||
|
@ -319,20 +319,14 @@ if [ -f $TMP/check ]; then
|
||||||
DEBUG "checking whether file '$i' matches"
|
DEBUG "checking whether file '$i' matches"
|
||||||
for r in $RULES; do
|
for r in $RULES; do
|
||||||
DEBUG "\t\trule $r"
|
DEBUG "\t\trule $r"
|
||||||
rule=${r#?}
|
class=${r:0:1}
|
||||||
case "!$i" in $r)
|
rule=${r:1}
|
||||||
DEBUG "\t\t\t\"silently\" rejected\t\t$rule"
|
case "$i" in $rule)
|
||||||
break
|
case $class in
|
||||||
;;
|
!) DEBUG "$i\t\t\"silently\" rejected\t\t$rule" ;;
|
||||||
esac
|
-) REJECT "$i\t\t$rule" ;;
|
||||||
case "-$i" in $r)
|
+) NEW "$i\t\t$rule" && echo "$i" >>$TMP/files ;;
|
||||||
REJECT "$i\t\t$rule"
|
esac
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case "+$i" in $r)
|
|
||||||
NEW "$i\t\t$rule"
|
|
||||||
echo "$i" >>$TMP/files
|
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue