M lib/makedate => lib/makedate +4 -12
@@ 1,26 1,18 @@
#!/bin/sh -x
# vim: set ft=bash:
FALLBACKDATE=${FALLBACKDATE:-unknown}
-case "$(uname -s)" in
- *OpenBSD*)
- DATEARGS='-j +%B,\ %d\ %Y'
- ;;
- *)
- DATEARGS='+%B,\ %d\ %Y'
- ;;
-esac
+LC_ALL=C
+export LC_ALL
if [ -d .got ] && command -v got >/dev/null 2>&1; then
- got tag -l |
+ got log |
awk '
/^date: / {
sub(/^date: /,"",$0)
- print strftime("%B %d, %Y")
+ print $2 " " $3 ", " $5
exit
}' >date.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
- LC_ALL=C
- export LC_ALL
user=$(unalias ls >/dev/null 2>&1 || true; \
command ls -ld . | awk '{print $3}')
e_user=$(id -un)
M lib/makeversion => lib/makeversion +25 -6
@@ 3,13 3,32 @@
FALLBACKVER=${FALLBACKVER:-unknown}
if [ -d .got ] && command -v got >/dev/null 2>&1; then
+ lastcommit=$(got log |
+ awk '/^commit/ {print substr($2,1,9); exit}')
got tag -l |
- awk '
- /^tag/ {
- sub(/^v/,"",$2)
- print $2
- exit
- }' >version.new
+ awk -v lastcommit="$lastcommit" '
+ /^object: commit/ {
+ if (!lasttagcom)
+ {
+ lasttagcom = substr($3,1,9)
+ }
+ next
+ }
+ /^tag/ {
+ if (!ver)
+ {
+ sub(/^v/,"",$2)
+ ver = $2
+ }
+ next
+ }
+ END {
+ printf "%s", ver
+ if (lastcommit != lasttagcom)
+ {
+ printf "-g%s", lastcommit
+ }
+ }' >version.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
LC_ALL=C
export LC_ALL