diff --git a/dev/devcam/server.go b/dev/devcam/server.go index 2e6c26594..e33377a47 100644 --- a/dev/devcam/server.go +++ b/dev/devcam/server.go @@ -130,16 +130,21 @@ func (c *serverCmd) build(name string) error { return fmt.Errorf("Could not build, invalid target: %v", name) } binPath := filepath.Join(c.camliSrcRoot, "bin", name) + var modtime int64 fi, err := os.Stat(binPath) if err != nil { - return fmt.Errorf("Could not stat %v: %v", binPath, err) + if !os.IsNotExist(err) { + return fmt.Errorf("Could not stat %v: %v", binPath, err) + } + } else { + modtime = fi.ModTime().Unix() } args := []string{ "run", "make.go", "--quiet", "--embed_static=false", "--sqlite=false", - fmt.Sprintf("--if_mods_since=%d", fi.ModTime().Unix()), + fmt.Sprintf("--if_mods_since=%d", modtime), "--targets=" + target, } cmd := exec.Command("go", args...) diff --git a/make.go b/make.go index ba8606310..098ee0c04 100644 --- a/make.go +++ b/make.go @@ -50,9 +50,10 @@ var ( verbose = flag.Bool("v", false, "Verbose mode") targets = flag.String("targets", "", "Optional comma-separated list of targets (i.e go packages) to build and install. Empty means all. Example: camlistore.org/server/camlistored,camlistore.org/cmd/camput") quiet = flag.Bool("quiet", false, "Don't print anything unless there's a failure.") - ifModsSince = flag.Int64("if_mods_since", 0, "If non-zero return immediately without building if there aren't any filesystem modifications past this time (in unix seconds)") - buildARCH = flag.String("arch", runtime.GOARCH, "Architecture to build for.") - buildOS = flag.String("os", runtime.GOOS, "Operating system to build for.") + // TODO(mpl): looks like ifModsSince is not used anywhere? + ifModsSince = flag.Int64("if_mods_since", 0, "If non-zero return immediately without building if there aren't any filesystem modifications past this time (in unix seconds)") + buildARCH = flag.String("arch", runtime.GOARCH, "Architecture to build for.") + buildOS = flag.String("os", runtime.GOOS, "Operating system to build for.") ) var (