]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#745] extract_bnf now always use English
authorTomek Mrugalski <tomek@isc.org>
Wed, 23 Jun 2021 10:40:48 +0000 (12:40 +0200)
committerTomek Mrugalski <tomek@isc.org>
Wed, 23 Jun 2021 10:40:48 +0000 (12:40 +0200)
tools/extract_bnf.sh.in

index 1030f76ff38c7fce3d5613e0f92d43992dd2b696..bbf74b371c89fca320c5a1e4fcf83e173480ddff 100755 (executable)
@@ -17,7 +17,7 @@
 # ./extract_bnf.sh <bison-file-base-name> --markdown
 
 # Check if there are one or two arguments
-if [ $# -le 1 ]; then
+if [ $# -lt 1 ]; then
     echo "extract_bnf.sh <bison-file-base-name> [--markdown <name>]"
     exit 1
 fi
@@ -35,10 +35,12 @@ now=$(date +"%Y-%m-%-d %H:%m")
 
 header="Grammar generated on $now. See Chapter $md_name for an explanation."
 
-if [ -f "${base}.output" ]; then
-    output="${base}.output"
-elif [ -f "${base}.yy" ]; then
-    /usr/bin/bison -v "${base}.yy" -o output
+if [ -f "${base}.yy" ]; then
+    # We want to explicitly set the language to English. Otherwise
+    # bison may produce language specific wording (like "symbole terminalne"
+    # if you system is set to Polish, rather than "Terminals") and this will
+    # confuse our script.
+    LANG=en_US LANGUAGE=en_US @YACC@ -v "${base}.yy" -o output
     rm -f output output.h *.hh
     mv output.output /tmp/output
     output=/tmp/output