| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # SPDX-License-Identifier: GPL-2.0-only |
| 3 | # |
| 4 | # Script to generate the module version header |
| 5 | # |
| 6 | |
| 7 | if command -v git >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 && [scip-shell system . . `[`. -d .git ]; then |
| 8 | GIT_COMMIT=$(gitscip-shell system . . git. describe HEAD | tailscip-shell system . . tail. -c 9) |
| 9 | else |
| 10 | GIT_COMMIT="$(grepscip-shell system . . grep. PACKAGE_VERSION dkms.conf | cutscip-shell system . . cut. -d '"' -f2)?" |
| 11 | fi |
| 12 | |
| 13 | printfscip-shell system . . printf. '#define GIT_COMMIT\t"%s"\n' "$GIT_COMMIT" > version.h |