]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: exclude cov and prof from releases
authorRuss Cox <rsc@golang.org>
Tue, 14 Feb 2012 05:18:30 +0000 (00:18 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 14 Feb 2012 05:18:30 +0000 (00:18 -0500)
Also check for old and exp.

Fixes #2764.
Fixes #2765.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5654068

misc/pprof [moved from src/cmd/prof/pprof with 100% similarity]
src/cmd/dist/build.c

similarity index 100%
rename from src/cmd/prof/pprof
rename to misc/pprof
index 72097230a1196fac0bed4be975a65cf583bc75e3..e115e3c322f1152485d89ea7881654c6760e7c0c 100644 (file)
@@ -283,6 +283,15 @@ static char *oldtool[] = {
        "quietgcc",
 };
 
+// Unreleased directories (relative to $GOROOT) that should
+// not be in release branches.
+static char *unreleased[] = {
+       "src/cmd/cov",
+       "src/cmd/prof",
+       "src/pkg/old",
+       "src/pkg/exp",
+};
+
 // setup sets up the tree for the initial build.
 static void
 setup(void)
@@ -347,6 +356,13 @@ setup(void)
                }
        }
 
+       // For release, make sure excluded things are excluded.
+       if(hasprefix(goversion, "release.") || hasprefix(goversion, "go.")) {
+               for(i=0; i<nelem(unreleased); i++)
+                       if(isdir(bpathf(&b, "%s/%s", goroot, unreleased[i])))
+                               fatal("%s should not exist in release build", bstr(&b));
+       }
+
        bfree(&b);
 }
 
@@ -539,6 +555,24 @@ install(char *dir)
        vinit(&lib);
        vinit(&extra);
        
+       // path = full path to dir.
+       bpathf(&path, "%s/src/%s", goroot, dir);
+       name = lastelem(dir);
+
+       // For misc/prof, copy into the tool directory and we're done.
+       if(hasprefix(dir, "misc/")) {
+               copy(bpathf(&b, "%s/%s", tooldir, name),
+                       bpathf(&b1, "%s/misc/%s", goroot, name));
+               goto out;
+       }
+
+       // For release, cmd/prof and cmd/cov are not included.
+       if((streq(dir, "cmd/cov") || streq(dir, "cmd/prof")) && !isdir(bstr(&path))) {
+               if(vflag > 1)
+                       xprintf("skipping %s - does not exist\n", dir);
+               goto out;
+       }
+
        // set up gcc command line on first run.
        if(gccargs.len == 0) {
                xgetenv(&b, "CC");
@@ -549,10 +583,6 @@ install(char *dir)
                        vadd(&gccargs, proto_gccargs[i]);
        }
        
-       // path = full path to dir.
-       bpathf(&path, "%s/src/%s", goroot, dir);
-       name = lastelem(dir);
-
        islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
        ispkg = hasprefix(dir, "pkg");
        isgo = ispkg || streq(dir, "cmd/go") || streq(dir, "cmd/cgo");
@@ -1030,6 +1060,8 @@ static char *buildorder[] = {
        "lib9",
        "libbio",
        "libmach",
+       
+       "misc/pprof",
 
        "cmd/cov",
        "cmd/nm",