diff mbox series

[2/2] bootstrap.sh: restore configure.ac

Message ID 20210302103458.819043-3-hverkuil-cisco@xs4all.nl
State New
Headers show
Series v4l-utils: fix gettext problems | expand

Commit Message

Hans Verkuil March 2, 2021, 10:34 a.m. UTC
gettextize overwrites AM_GNU_GETTEXT_VERSION in configure.ac,
which is not what we want since we want to support older gettext
versions as well. Restore the original configure.ac on exit.

Also add set -e to exit if one of the commands fails.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 bootstrap.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bootstrap.sh b/bootstrap.sh
index 0e9eb2d4..52bb0165 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,6 +1,7 @@ 
 #!/bin/bash
 
-mkdir build-aux/ 2>/dev/null
+set -e
+mkdir -p build-aux/ 2>/dev/null
 touch build-aux/config.rpath libdvbv5-po/Makefile.in.in v4l-utils-po/Makefile.in.in
 autoreconf -vfi
 
@@ -13,6 +14,13 @@  if [ "GETTEXTIZE" != "" ]; then
 	sed "s,read dummy < /dev/tty,," < $GETTEXTIZE > ./gettextize
 	chmod 755 ./gettextize
 
+	# gettextize overwrites AM_GNU_GETTEXT_VERSION in
+	# configure.ac, which is not what we want since we want to
+	# support older gettext versions as well. Restore the
+	# original configure.ac on exit.
+	cp configure.ac configure.ac.orig
+	trap "mv configure.ac.orig configure.ac" EXIT
+
 	echo "Generating locale v4l-utils-po build files for gettext version $VER"
 	./gettextize --force --copy --no-changelog --po-dir=v4l-utils-po >/dev/null