浏览代码

build: Make stupgrades build target conditional (fixes #7199) (#7404)

Steven Eckhoff 4 年之前
父节点
当前提交
6bfad8fce8
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      build.go

+ 6 - 1
build.go

@@ -217,7 +217,7 @@ var dependencyRepos = []dependencyRepo{
 	{path: "xdr", repo: "https://github.com/calmh/xdr.git", commit: "08e072f9cb16"},
 }
 
-func init() {
+func initTargets() {
 	all := targets["all"]
 	pkgs, _ := filepath.Glob("cmd/*")
 	for _, pkg := range pkgs {
@@ -226,6 +226,9 @@ func init() {
 			// ignore dotfiles
 			continue
 		}
+		if noupgrade && pkg == "stupgrades" {
+			continue
+		}
 		all.buildPkgs = append(all.buildPkgs, fmt.Sprintf("github.com/syncthing/syncthing/cmd/%s", pkg))
 	}
 	targets["all"] = all
@@ -257,6 +260,8 @@ func main() {
 		}()
 	}
 
+	initTargets()
+
 	// Invoking build.go with no parameters at all builds everything (incrementally),
 	// which is what you want for maximum error checking during development.
 	if flag.NArg() == 0 {