Commit d94da6fa authored by Anthony Martin's avatar Anthony Martin Committed by Ron Minnich

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

R=seed, rminnich, bradfitz, r
CC=golang-dev
https://golang.org/cl/7395059
parent cb4428e5
...@@ -1588,7 +1588,7 @@ cmdclean(int argc, char **argv) ...@@ -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) ...@@ -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) ...@@ -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)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment