27
Content-Disposition: inline; filename="
e
gen-version.sh
HTTP/1.1 200 OK
Connection: close
Content-Length: 392
Content-Security-Policy: default-src 'none'
Content-Type: text/plain; charset=UTF-8
Date: Wed, 07 Jan 2026 09:04:26 GMT
ETag: "3a080157cf4e871d8e4f63d01855d8eeaf36f943"
Expires: Sat, 05 Jan 2036 09:04:26 GMT
Last-Modified: Wed, 07 Jan 2026 09:04:26 GMT
Server: OpenBSD httpd
X-Content-Type-Options: nosniff

#!/bin/sh

# Get version-info specified in Makefile
V=$1

# Use `git describe` to get current version if we're inside a git repo
if test -d .git
then
	V=$(git describe --abbrev=4 HEAD 2>/dev/null)
fi

new="CGIT_VERSION = $V"
old=$(cat VERSION 2>/dev/null)

# Exit if VERSION is uptodate
test "$old" = "$new" && exit 0

# Update VERSION with new version-info
echo "$new" > VERSION
cat VERSION
