cmd/dist: instruct the user to bind $GOBIN on Plan 9

R=seed, rminnich, bradfitz, r
CC=golang-dev
https://golang.org/cl/7395059
This commit is contained in:
Anthony Martin 2013-03-15 05:04:19 +01:00 committed by Ron Minnich
parent cb4428e555
commit d94da6fab5
1 changed files with 23 additions and 10 deletions

15
src/cmd/dist/build.c vendored
View File

@ -1588,7 +1588,7 @@ cmdclean(int argc, char **argv)
void void
cmdbanner(int argc, char **argv) cmdbanner(int argc, char **argv)
{ {
char *pathsep; char *pathsep, *pid, *ns;
Buf b, b1, search, path; Buf b, b1, search, path;
ARGBEGIN{ ARGBEGIN{
@ -1612,6 +1612,18 @@ cmdbanner(int argc, char **argv)
xprintf("Installed Go for %s/%s in %s\n", goos, goarch, goroot); xprintf("Installed Go for %s/%s in %s\n", goos, goarch, goroot);
xprintf("Installed commands in %s\n", gobin); xprintf("Installed commands in %s\n", gobin);
if(streq(gohostos, "plan9")) {
// Check that gobin is bound before /bin.
readfile(&b, "#c/pid");
bsubst(&b, " ", "");
pid = btake(&b);
bprintf(&b, "/proc/%s/ns", pid);
ns = btake(&b);
readfile(&b, ns);
bprintf(&search, "bind -b %s /bin\n", gobin);
if(xstrstr(bstr(&b), bstr(&search)) == nil)
xprintf("*** You need to bind %s before /bin.\n", gobin);
} else {
// Check that gobin appears in $PATH. // Check that gobin appears in $PATH.
xgetenv(&b, "PATH"); xgetenv(&b, "PATH");
pathsep = ":"; pathsep = ":";
@ -1621,6 +1633,7 @@ cmdbanner(int argc, char **argv)
bprintf(&search, "%s%s%s", pathsep, gobin, pathsep); bprintf(&search, "%s%s%s", pathsep, gobin, pathsep);
if(xstrstr(bstr(&b1), bstr(&search)) == nil) if(xstrstr(bstr(&b1), bstr(&search)) == nil)
xprintf("*** You need to add %s to your PATH.\n", gobin); xprintf("*** You need to add %s to your PATH.\n", gobin);
}
if(streq(gohostos, "darwin")) { if(streq(gohostos, "darwin")) {
if(isfile(bpathf(&path, "%s/cov", tooldir))) if(isfile(bpathf(&path, "%s/cov", tooldir)))