make-template.sh: minor improvements

Normalize the locale, and be more friendly towards paths with spaces.
This commit is contained in:
Přemysl Eric Janouch 2021-10-22 23:30:46 +02:00
parent 809304cbb3
commit b77395b931
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,8 @@
# should not need to run the whole configuration process just to get this file. # should not need to run the whole configuration process just to get this file.
dir=$(dirname $0) dir=$(dirname $0)
export LC_ALL=C
re='^[ \t]*project *( *\([^ \t)]\{1,\}\) \{1,\}VERSION \{1,\}\([^ \t)]\{1,\}\).*' re='^[ \t]*project *( *\([^ \t)]\{1,\}\) \{1,\}VERSION \{1,\}\([^ \t)]\{1,\}\).*'
package=$(sed -n "s/$re/\\1/p" "$dir/../CMakeLists.txt") package=$(sed -n "s/$re/\\1/p" "$dir/../CMakeLists.txt")
version=$(sed -n "s/$re/\\2/p" "$dir/../CMakeLists.txt") version=$(sed -n "s/$re/\\2/p" "$dir/../CMakeLists.txt")
@ -13,7 +15,7 @@ if [ -z "$package" -o -z "$version" ]; then
exit 1 exit 1
fi fi
xgettext -LC -k_ -kN_ $dir/../src/*.c -o "$dir/$package.pot" \ xgettext -LC -k_ -kN_ "$dir"/../src/*.c -o "$dir/$package.pot" \
--package-name="$package" --package-version="$version" \ --package-name="$package" --package-version="$version" \
--copyright-holder="Přemysl Eric Janouch" \ --copyright-holder="Přemysl Eric Janouch" \
--msgid-bugs-address="https://git.janouch.name/p/$package/issues" --msgid-bugs-address="https://git.janouch.name/p/$package/issues"