]> git.mxchange.org Git - flightgear.git/commitdiff
- escape '+' in awk pattern (gawk doesn't need it, but mawk does)
authormfranz <mfranz>
Thu, 8 Mar 2007 23:16:57 +0000 (23:16 +0000)
committermfranz <mfranz>
Thu, 8 Mar 2007 23:16:57 +0000 (23:16 +0000)
- change the mktemp lines to please Debian's stoneage version ... sigh
- reject archives

scripts/tools/fg-submit

index 827e24ecd42ad14a3717e737d9b7d7b7dfb8029b..c185f614d0be49b6f3d121376ca55e19e86d1b6e 100755 (executable)
 # $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)"
                        ;;