+2024-12-28 Simon Josefsson <simon@josefsson.org>
+
+ git-version-gen: fix preceding change
+ * build-aux/git-version-gen: Do use *-git content only when
+ keyword is not present. Move post-processing later. Doc fixes.
+
2024-12-28 Bruno Haible <bruno@clisp.org>
doc: Omit deprecated modules from the "Undocumented modules" index.
#!/bin/sh
# Print a version string.
-scriptversion=2024-12-28.17; # UTC
+scriptversion=2024-12-28.19; # UTC
# Copyright (C) 2007-2024 Free Software Foundation, Inc.
#
#
# echo '$Format:%(describe)$' > .tarball-version-git
# echo '.tarball-version-git export-subst' >> .gitattributes
-# git commit -a -m "Add .tarball-version-git for git-version-gen."
+# git add .tarball-version-git .gitattributes
+# git commit -m "Add .tarball-version-git for git-version-gen."
me=$0
test "$commit_list" = failed && v=UNKNOWN
;;
esac
-
- # Change the penultimate "-" to ".", for version-comparing tools.
- # Remove the "g" to save a byte.
- v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
v_from_git=1
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
v=UNKNOWN
v=$fallback
fi
-if test "x$v" = xUNKNOWN; then
- fmt=$(awk 'NR==1 && /^\$Format/ {print}' \
- "$tarball_version_file-git" 2> /dev/null) \
- && test -n "$fmt" \
- && v=$fmt
+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)
fi
+# Change the penultimate "-" to ".", for version-comparing tools.
+# Remove the "g" to save a byte.
+v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
+
v=`echo "$v" |sed "s/^$prefix//"`
# Test whether to append the "-dirty" suffix only if the version