File: gen

package info (click to toggle)
golang-github-hlandau-buildinfo 0.0~git20160722.0.b25d4b0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 96 kB
  • sloc: sh: 3; makefile: 2
file content (5 lines) | stat: -rwxr-xr-x 788 bytes parent folder | download | duplicates (4)
1
2
3
4
5
#!/bin/bash
[ -z "$BUILDNAME" ] && BUILDNAME="$(date -u "+%Y%m%d%H%M%S") on $(hostname -f)"
BUILDINFO="$((echo built $BUILDNAME; go list -f '{{range $imp := .Deps}}{{printf "%s\n" $imp}}{{end}}' "$1" | sort -u | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | awk "{print \"$GOPATH/src/\" \$0}" | (while read line; do x="$line"; while [ ! -e "$x/.git" -a ! -e "$x/.hg" ]; do x=${x%/*}; if [ "$x" = "" ]; then break; fi; done; echo "$x"; done) | sort -u | (while read line; do echo git ${line#$GOPATH/src/} $(git -C "$line" rev-parse HEAD) $(git -C "$line" describe --all --dirty=+ --abbrev=99 --always); done)) | base64 | tr -d '\n')"
# (base64 -w 0 doesn't work on busybox, so use base64 | tr -d '\n' instead)
echo -X github.com/hlandau/buildinfo.RawBuildInfo=$BUILDINFO