diff options
| -rw-r--r-- | prog/meta.go | 14 | ||||
| -rw-r--r-- | syz-manager/manager.go | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/prog/meta.go b/prog/meta.go index 61e0c7edb..5c23627df 100644 --- a/prog/meta.go +++ b/prog/meta.go @@ -8,13 +8,19 @@ import ( "time" ) +const defaultGitRevision = "unknown" + var ( - GitRevision = "unknown" // emitted by Makefile, may contain + at the end - GitRevisionBase string // without + - gitRevisionDate string // emitted by Makefile - GitRevisionDate time.Time // parsed from gitRevisionDate + GitRevision = defaultGitRevision // emitted by Makefile, may contain + at the end + GitRevisionBase string // without + + gitRevisionDate string // emitted by Makefile + GitRevisionDate time.Time // parsed from gitRevisionDate ) +func GitRevisionKnown() bool { + return GitRevision != defaultGitRevision +} + func init() { GitRevisionBase = strings.Replace(GitRevision, "+", "", -1) if gitRevisionDate != "" { diff --git a/syz-manager/manager.go b/syz-manager/manager.go index b5c879cad..66713e43b 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -151,7 +151,7 @@ const ( ) func main() { - if prog.GitRevision == "" { + if !prog.GitRevisionKnown() { log.Fatalf("bad syz-manager build: build with make, run bin/syz-manager") } flag.Parse() |
