This is a start on fulfilling ivanovic's FR #9154.

So far it only checks for mismatches between the set of .cpp files
under src and all stuff listed in the
po/{wesnoth,wesnoth-lib,wesnoth-editor}/POTFILES.in files.
This commit is contained in:
Eric S. Raymond 2007-05-30 21:52:27 +00:00
parent 217ad869c1
commit e2891ae661

40
utils/sanity_check Executable file
View file

@ -0,0 +1,40 @@
#!/bin/sh
#
# sanity_check -- general sanity checker for the source and translations
#
# This had better take us to the top-level source directory.
# Otherwise, confusion will ensue.
cd ..
if [ `basename $PWD` != 'wesnoth' ]
then
echo "sanity_check: " \
"this tool must be run from the Wesnoth utils directory."
exit 1
fi
# First sanity check:
echo "Checking POTFILES correctness..."
# Gather the list of sources
find src -name '*cpp' -print | sort >/tmp/sschk$$_sources
# See what's in the POTFILES
sort -u po/wesnoth/POTFILES.in po/wesnoth-lib/POTFILES.in po/wesnoth-editor/POTFILES.in >/tmp/sschk$$_potmembers
# Figure out which sources are not listed but should be
missing=`comm -23 /tmp/sschk$$_sources /tmp/sschk$$_potmembers | tr '\012' ' '`
# Find invalid potfile entries
invalid=`comm -13 /tmp/sschk$$_sources /tmp/sschk$$_potmembers | tr '\012' ' '`
if [ $missing ]
then
echo "Missing from the POTFILEs: $missing"
else
echo "All .cpp files have POTFILE.in entries."
fi
if [ $invalid ]
then
echo "Invalid POTFILE entries: $invalid"
else
echo "All POTFILE.in entries are valid."
fi
# More sanity checks can go here...