Files
gdb/check-version.sh
T
2025-07-26 14:34:20 +03:00

13 lines
353 B
Bash

#!/bin/bash
# Git repository
REPO="git://sourceware.org/git/binutils-gdb.git"
# Get tag name using 'git ls-remote'
TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | grep -E "gdb-([0-9].*)-release" | tail -1 | cut -d'/' -f3)
# Get version number from tag name
VERSION=$(echo "$TAG_NAME" | cut -d'-' -f2)
echo "$VERSION"