File: genver.sh

package info (click to toggle)
linux-apfs-rw 0.3.13-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,196 kB
  • sloc: ansic: 20,083; makefile: 24; sh: 6
file content (13 lines) | stat: -rwxr-xr-x 339 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
#
# Script to generate the module version header
#

if command -v git >/dev/null 2>&1 && [ -d .git ]; then
	GIT_COMMIT=$(git describe HEAD | tail -c 9)
else
	GIT_COMMIT="$(grep PACKAGE_VERSION dkms.conf | cut -d '"' -f2)?"
fi

printf '#define GIT_COMMIT\t"%s"\n' "$GIT_COMMIT" > version.h