+2024-04-26 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool: Use the Python implementation by default.
+ * gnulib-tool: If GNULIB_TOOL_IMPL is not set: Use the Python
+ implementation if a suitable 'python3' program is found in $PATH;
+ otherwise print a warning and use the shell implementation.
+
2024-04-26 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Remove some unused instance variables.
func_gnulib_dir
case "$GNULIB_TOOL_IMPL" in
- '' | sh)
+ '')
+ # Use the Python implementation if a suitable Python version is found
+ # in $PATH. This is the same Python version test as in gnulib-tool.py.
+ if (python3 --version) >/dev/null 2>/dev/null \
+ && case `python3 --version 2>&1` in
+ Python\ 3.[0-6] | Python\ 3.[0-6].*) false ;;
+ Python\ 3.*) true ;;
+ *) false ;;
+ esac; then
+ exec "$gnulib_dir/gnulib-tool.py" "$@"
+ else
+ echo "gnulib-tool: warning: python3 not found or too old, using the slow shell-based implementation" 1>&2
+ exec "$gnulib_dir/gnulib-tool.sh" "$@"
+ fi
+ ;;
+ sh)
exec "$gnulib_dir/gnulib-tool.sh" "$@" ;;
py)
exec "$gnulib_dir/gnulib-tool.py" "$@" ;;