From 8888d4256f84a1fb4ca93a58238c25a32e44d3b4 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 30 Dec 2015 09:07:07 -0800 Subject: [PATCH] misc/docker/dock.go: fail if tarball_version and build_image both set Change-Id: I985cba6a8de0eb9f5e5e008ea0153d4a417991da --- misc/docker/dock.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/docker/dock.go b/misc/docker/dock.go index 769d91224..16228818b 100644 --- a/misc/docker/dock.go +++ b/misc/docker/dock.go @@ -45,7 +45,7 @@ import ( var ( flagRev = flag.String("rev", "", "Camlistore revision to build (tag or commit hash). For development purposes, you can instead specify the path to a local Camlistore source tree from which to build, with the form \"WIP:/path/to/dir\".") - flagVersion = flag.String("tarball_version", "", "Version number (e.g. 0.9) used for the release tarball name. It also defines the destination directory where the release tarball is uploaded.") + flagVersion = flag.String("tarball_version", "", "For --build_image mode, the version number (e.g. 0.9) used for the release tarball name. It also defines the destination directory where the release tarball is uploaded.") buildOS = flag.String("os", runtime.GOOS, "Operating system to build for. Requires --build_release.") doImage = flag.Bool("build_image", true, "build the Camlistore server as a docker image. Conflicts with --build_release.") @@ -452,6 +452,10 @@ func checkFlags() { fmt.Fprintf(os.Stderr, "Usage error: --tarball_version required when building the release tarball.\n") usage() } + if *doImage && *flagVersion != "" { + fmt.Fprintf(os.Stderr, "Usage error: --tarball_version not applicable in --build_image mode.\n") + usage() + } if isWIP() { if _, err := os.Stat(localCamliSource()); err != nil { fmt.Fprintf(os.Stderr, "Usage error: could not stat path %q provided with --rev: %v", localCamliSource(), err)