summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-10 18:21:14 +0000
committerrubidium <rubidium@openttd.org>2009-07-10 18:21:14 +0000
commit1c1b6da4a3f1a457b5e202f33fc51860a90e4573 (patch)
tree492d6efd749e47f33fbcf65473744b8b4f09374c
parent97247c1bca8875f6b883b69f5271e95302457b80 (diff)
downloadopenttd-1c1b6da4a3f1a457b5e202f33fc51860a90e4573.tar.xz
(svn r16783) -Change: make it more clear that the squirrel_export script needs gawk.
-rwxr-xr-xsrc/ai/api/squirrel_export.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ai/api/squirrel_export.sh b/src/ai/api/squirrel_export.sh
index 46f0de0d8..3d228d838 100755
--- a/src/ai/api/squirrel_export.sh
+++ b/src/ai/api/squirrel_export.sh
@@ -2,6 +2,15 @@
# $Id$
+# We really need gawk for this!
+AWK=gawk
+
+${AWK} --version > /dev/null 2> /dev/null
+if [ "$?" != "0" ]; then
+ echo "This script needs gawk to run properly"
+ exit 1
+fi
+
# This must be called from within the src/ai/api directory.
if [ -z "$1" ]; then
@@ -10,7 +19,7 @@ if [ -z "$1" ]; then
# these files should not be changed by this script
"ai_controller.hpp" | "ai_object.hpp" | "ai_types.hpp" ) continue;
esac
- awk -f squirrel_export.awk ${f} > ${f}.tmp
+ ${AWK} -f squirrel_export.awk ${f} > ${f}.tmp
if ! [ -f "${f}.sq" ] || [ -n "`diff -I '$Id' -b ${f}.tmp ${f}.sq 2> /dev/null || echo boo`" ]; then
mv ${f}.tmp ${f}.sq
echo "Updated: ${f}.sq"
@@ -22,7 +31,7 @@ if [ -z "$1" ]; then
fi
done
else
- awk -f squirrel_export.awk $1 > $1.tmp
+ ${AWK} -f squirrel_export.awk $1 > $1.tmp
if ! [ -f "${f}.sq" ] || [ -n "`diff -I '$Id' -b $1.sq $1.tmp 2> /dev/null || echo boo`" ]; then
mv $1.tmp $1.sq
echo "Updated: $1.sq"
@@ -84,7 +93,7 @@ echo "
{ print \$0; }
" > ${f}.awk
-awk -f ${f}.awk ${f} > ${f}.tmp
+${AWK} -f ${f}.awk ${f} > ${f}.tmp
if ! [ -f "${f}" ] || [ -n "`diff -I '$Id' -b ${f} ${f}.tmp 2> /dev/null || echo boo`" ]; then
mv ${f}.tmp ${f}