Skip to content

Commit 16d3fb1

Browse files
committed
gvfs: ensure that the version is based on a GVFS tag
Since we really want to be based on a `.vfs.*` tag, let's make sure that there was a new-enough one, i.e. one that agrees with the first three version numbers of the recorded default version. This prevents e.g. v2.22.0.vfs.0.<some-huge-number>.<commit> from being used when the current release train was not yet tagged. It is important to get the first three numbers of the version right because e.g. Scalar makes decisions depending on those (such as assuming that the `git maintenance` built-in is not available, even though it actually _is_ available). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 031198e commit 16d3fb1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

GIT-VERSION-GEN

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ then
4242
test -d "${GIT_DIR:-.git}" ||
4343
test -f "$SOURCE_DIR"/.git;
4444
} &&
45-
VN=$(git -C "$SOURCE_DIR" describe --match "v[0-9]*" HEAD 2>/dev/null) &&
45+
VN=$(git -C "$SOURCE_DIR" describe --match "v[0-9]*vfs*" HEAD 2>/dev/null) &&
4646
case "$VN" in
4747
*$LF*) (exit 1) ;;
4848
v[0-9]*)
49+
if test "${VN%%.vfs.*}" != "${DEF_VER%%.vfs.*}"
50+
then
51+
echo "Found version $VN, which is not based on $DEF_VER" >&2
52+
exit 1
53+
fi
4954
git -C "$SOURCE_DIR" update-index -q --refresh
5055
test -z "$(git -C "$SOURCE_DIR" diff-index --name-only HEAD --)" ||
5156
VN="$VN-dirty" ;;

0 commit comments

Comments
 (0)