Changeset - r23150:f81dda5e4eee
[Not reviewed]
master
0 1 0
glx - 6 years ago 2019-01-08 15:40:38
glx@openttd.org
Cleanup: remove svn references in squirrel_export.sh
1 file changed with 3 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/script/api/squirrel_export.sh
Show inline comments
 
@@ -23,13 +23,13 @@ fi
 
# This must be called from within a src/???/api directory.
 
scriptdir=`dirname $0`
 
apilc=`pwd | sed "s@/api@@;s@.*/@@"`
 

	
 
# Check if we are in the root directory of the API, as then we generate all APIs
 
if [ "$apilc" = "script" ]; then
 
	for api in `find -type d | cut -b3- | grep -v '\.svn\|/'`; do
 
	for api in `find -type d | cut -b3-`; do
 
		if [ -z "$api" ]; then continue; fi
 
		echo "Generating for API '$api' ..."
 
		cd $api
 
		sh $scriptdir/../`basename $0`
 
		cd ..
 
	done
 
@@ -51,32 +51,29 @@ for f in `ls ../*.hpp`; do
 

	
 
	${AWK} -v api=${apiuc} -f ${scriptdir}/squirrel_export.awk ${f} > ${bf}.tmp
 

	
 
	if [ "`wc -l ${bf}.tmp | cut -d\  -f1`" = "0" ]; then
 
		if [ -f "${bf}.sq" ]; then
 
			echo "Deleted: ${bf}.sq"
 
			svn del --force ${bf}.sq > /dev/null 2>&1
 
			rm -f ${bf}.sq
 
		fi
 
		rm -f ${bf}.tmp
 
	elif ! [ -f "${bf}.sq" ] || [ -n "`diff -I '$Id' ${bf}.tmp ${bf}.sq 2> /dev/null || echo boo`" ]; then
 
		mv ${bf}.tmp ${bf}.sq
 
		echo "Updated: ${bf}.sq"
 
		svn add ${bf}.sq > /dev/null 2>&1
 
		svn propset svn:eol-style native ${bf}.sq > /dev/null 2>&1
 
		svn propset svn:keywords Id ${bf}.sq > /dev/null 2>&1
 
	else
 
		rm -f ${bf}.tmp
 
	fi
 
done
 

	
 
# Remove .hpp.sq if .hpp doesn't exist anymore
 
for f in `ls *.hpp.sq`; do
 
	f=`echo ${f} | sed "s/.hpp.sq$/.hpp/;s@${apilc}_@script_@"`
 
	if [ ! -f ../${f} ];then
 
		echo "Deleted: ${f}.sq"
 
		svn del --force ${f}.sq > /dev/null 2>&1
 
		rm -f ${f}.sq
 
	fi
 
done
 

	
 
if [ "$apilc" = "template" ]; then exit 0; fi
 

	
 
# Add stuff to ${apilc}_instance.cpp
0 comments (0 inline, 0 general)