Commit b68d8e7f authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Make version stamping work for goinstall.

parent 0866f202
......@@ -26,13 +26,14 @@ GOFILES=\
timingfs.go \
timingrawfs.go \
types.go\
version.go \
version.gen.go \
xattr.go \
include $(GOROOT)/src/Make.pkg
version.gen.go:
echo "package fuse" > $@
git log -n1 --pretty=format:'const version = "%h (%cd)"' --date=iso >> $@
version.gen.go: FORCE
sh genversion.sh > $@
FORCE:
#!/bin/sh
VERSION=\"$(git log -n1 --pretty=format:'%h (%cd)' --date=iso )\"
cat <<EOF
package fuse
func init() {
version = new(string)
*version = ${VERSION}
}
EOF
......@@ -169,7 +169,10 @@ func ioctl(fd int, cmd int, arg uintptr) (int, int) {
}
func Version() string {
return version
if version != nil {
return *version
}
return "unknown"
}
func ReverseJoin(rev_components []string, sep string) string {
......
package fuse
// Autogenerated .go file can set this to a version string in its
// init() file.
var version *string
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment