From a7019235b6abc8a8a6eb6a12c05bb6dbab8dbf1e Mon Sep 17 00:00:00 2001 From: EnumDev Date: Fri, 15 Aug 2025 17:12:28 +0300 Subject: [PATCH] Add check-version.sh script --- check-version.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 check-version.sh diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..e1f6c3e --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Git repository +REPO="https://sourceware.org/git/glibc.git" + +# Get tag name using 'git ls-remote' +TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | grep -w -E "glibc-([0-9]*\.[0-9]*)\$" | tail -n1) + +# Trim 'glibc-' prefix from TAG_NAME +VERSION="${TAG_NAME//glibc-/}" + +echo "$VERSION"