Changeset - r12349:d793fab5d83d
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-07-10 18:21:14
rubidium@openttd.org
(svn r16783) -Change: make it more clear that the squirrel_export script needs gawk.
1 file changed with 12 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/ai/api/squirrel_export.sh
Show inline comments
 
@@ -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}
0 comments (0 inline, 0 general)