mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 20:59:29 +00:00
Make UTF8 checks fail the build if they find anything.
Also fixes a comment typo in docker_run.sh.
This commit is contained in:
parent
344b5c56b9
commit
c456d4b288
@ -1,13 +1,19 @@
|
||||
#!/bin/bash
|
||||
# Install isutf8 program (from package "moreutils" at least in linux mint)
|
||||
# in order to use this script
|
||||
# Install isutf8 program (from package "moreutils" at least in linux mint) in order to use this script.
|
||||
#
|
||||
# This script assumes that the current working directory is the root of the
|
||||
# wesnoth repository.
|
||||
set -e
|
||||
find src/ -type f -print0 | xargs -0 isutf8 --
|
||||
find data/ -not -name "*.png" -not -name "*.ogg" -not -name "*.jpg" -not -name "*.wav" -not -name "*.gif" -not -name "*.xcf" -type f -print0 | xargs -0 isutf8 --
|
||||
find po/ -type f -print0 | xargs -0 isutf8 --
|
||||
isutf8 changelog
|
||||
isutf8 players_changelog
|
||||
isutf8 RELEASE_NOTES
|
||||
# This script assumes that the current working directory is the root of the wesnoth repository.
|
||||
exit_code=0
|
||||
|
||||
find src/ -type f -print0 | xargs -0 isutf8 -- || exit_code=1
|
||||
find data/ -not -name "*.png" -not -name "*.ogg" -not -name "*.jpg" -not -name "*.wav" -not -name "*.gif" -not -name "*.xcf" -type f -print0 | xargs -0 isutf8 -- || exit_code=1
|
||||
find po/ -type f -print0 | xargs -0 isutf8 -- || exit_code=1
|
||||
|
||||
isutf8 changelog.md || exit_code=1
|
||||
isutf8 players_changelog.md || exit_code=1
|
||||
isutf8 RELEASE_NOTES || exit_code=1
|
||||
|
||||
if [ $exit_code != 0 ]; then
|
||||
echo "Found invalid UTF8 file(s)!"
|
||||
fi
|
||||
|
||||
exit $exit_code
|
||||
|
@ -72,7 +72,7 @@ else
|
||||
exit $BUILD_RET
|
||||
fi
|
||||
|
||||
# needed since docker returns the exit code of the final comman executed, so a failure needs to be returned if any unit tests fail
|
||||
# needed since docker returns the exit code of the final command executed, so a failure needs to be returned if any unit tests fail
|
||||
EXIT_VAL=0
|
||||
|
||||
if [ "$WML_TESTS" == "true" ]; then
|
||||
|
@ -21,8 +21,10 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
exit $BUILD_RET
|
||||
else
|
||||
ln -s $HOME/build-cache/ build
|
||||
./utils/travis/check_utf8.sh
|
||||
./utils/travis/utf8_bom_dog.sh
|
||||
|
||||
./utils/travis/check_utf8.sh || exit 1
|
||||
./utils/travis/utf8_bom_dog.sh || exit 1
|
||||
|
||||
"$CXX" --version
|
||||
scons wesnoth wesnothd campaignd boost_unit_tests build=release \
|
||||
ctool="$CC" cxxtool="$CXX" cxx_std="$CXXSTD" \
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
if grep -qorHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/ ; then
|
||||
echo "Error, Found a UTF8 BOM:\n"
|
||||
echo "Found UTF8 BOM(s)!"
|
||||
grep -orHbm1 "^`echo -ne '\xef\xbb\xbf'`" po/ src/ data/
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user