From 3f1b379e9a6c262d16ea5563abc7690062f5743a Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 8 Mar 2007 23:16:57 +0000 Subject: [PATCH] - escape '+' in awk pattern (gawk doesn't need it, but mawk does) - change the mktemp lines to please Debian's stoneage version ... sigh - reject archives --- scripts/tools/fg-submit | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/tools/fg-submit b/scripts/tools/fg-submit index 827e24ecd..c185f614d 100755 --- a/scripts/tools/fg-submit +++ b/scripts/tools/fg-submit @@ -37,14 +37,14 @@ # $1 and $2 are guaranteed not to contain spaces, only $1 is guaranteed # to actually exist. Such as script can be used to upload the file to an # ftp-/webserver, and/or to remove one or both files. Example using -# KDE's kfmclient for upload (alternatives: ncftpput, gnomevfs-copy, ...): +# KDE's kfmclient for upload (alternatives: ncftpput, gnomevfs-copy, wput): # # $ cat ~/bin/fg-upload # #!/bin/bash # echo "uploading $1" # if kfmclient copy $1 ftp://user:password@server.com; then # echo "deleting $1 $2" -# rm -rf $1 $2 +# rm -f $1 $2 # # echo "Done. URL: ftp://server.com/$1" # else @@ -97,7 +97,7 @@ function diffstat { /^Index: / { dofile(); scan = bin = 0; file = $2; n++; next } /^@@/ { scan = 1; next } /^Binary/ { if (!scan) bin = 1; next } - /^+/ { if (scan) a++; next } + /^\+/ { if (scan) a++; next } /^-/ { if (scan) r++; next } /^!/ { if (scan) c++; next } END { @@ -109,14 +109,14 @@ function diffstat { } -# create temporary dir that's automatcally removed on exit -TMP=$(mktemp -d -t $SELF.$BASE.XXX) || (echo "$0: can't create temporary dir"; exit 1) +# create temporary dir that's automatically removed on exit +TMP=$(mktemp -d /tmp/$SELF.$BASE.XXXXXX) || (echo "$0: can't create temporary dir"; exit 1) trap "rm -rf $TMP" 0 1 2 3 13 15 # move old files out of the way for i in $DIFF $CDIFF $ARCHIVE; do - [ -f $i ] && mv $i $(mktemp $i.X) + [ -f $i ] && mv $i $(mktemp $i.XXXXXX) done @@ -177,6 +177,9 @@ if [ -f $TMP/check ]; then CVS/*|*/CVS/*) REJECT "$i\t\t(CVS file)" ;; + *.tar.gz*|*.tar.bz2*|*.tgz|*.zip) + REJECT "$i\t\t(archive)" + ;; *.blend|*.blend[0-9]|*.blend[0-9][0-9]) REJECT "$i\t\t(blender file)" ;;