#!/bin/sh
# Print a version string.
-scriptversion=2024-12-27.09; # UTC
+scriptversion=2024-12-28.17; # UTC
# Copyright (C) 2007-2024 Free Software Foundation, Inc.
#
# First see if there is a tarball-only version file.
# then try "git describe", then default.
-if test -f $tarball_version_file
+if test -f "$tarball_version_file"
then
- v=`cat $tarball_version_file` || v=
+ v=`cat "$tarball_version_file"` || v=
case $v in
*$nl*) v= ;; # reject multi-line output
esac
v=$fallback
fi
-if test "x$v" = xUNKNOWN \
- && test -f ${tarball_version_file}-git \
- && head -1 ${tarball_version_file}-git \
- | grep -v '^$Format' > /dev/null 2>&1; then
- v=$(head -1 ${tarball_version_file}-git)
+if test "x$v" = xUNKNOWN; then
+ fmt=$(awk 'NR==1 && /^\$Format/ {print}' \
+ "$tarball_version_file-git" 2> /dev/null) \
+ && test -n "$fmt" \
+ && v=$fmt
fi
v=`echo "$v" |sed "s/^$prefix//"`