1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:54:39 -07:00

cmd/dist: make 'make' quieter for developers

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5646055
This commit is contained in:
Russ Cox 2012-02-08 15:26:47 -05:00
parent e7a138b856
commit 596840a905
3 changed files with 12 additions and 10 deletions

View File

@ -3,12 +3,16 @@
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
# Run go tool dist to install a command. # Run go tool dist to install a command.
# The -v causes dist to print the name of each directory as it runs.
# The -vv causes dist to print each build command as it runs. # The -vv causes dist to print each build command as it runs.
# go tool dist clean cleans all directories, not just this one, # go tool dist clean cleans all directories, not just this one,
# but it's as close as we can get. # but it's as close as we can get.
# Default target (first). # Default target (first).
install: install:
go tool dist install -v
verbose:
go tool dist install -vv go tool dist install -vv
clean: clean:

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

@ -501,6 +501,9 @@ install(char *dir)
Time ttarg, t; Time ttarg, t;
int i, j, k, n, doclean; int i, j, k, n, doclean;
if(vflag)
xprintf("%s\n", dir);
binit(&b); binit(&b);
binit(&b1); binit(&b1);
binit(&path); binit(&path);
@ -1242,7 +1245,6 @@ cmdbootstrap(int argc, char **argv)
{ {
int i; int i;
Buf b; Buf b;
char *p;
ARGBEGIN{ ARGBEGIN{
case 'v': case 'v':
@ -1259,12 +1261,8 @@ cmdbootstrap(int argc, char **argv)
setup(); setup();
binit(&b); binit(&b);
for(i=0; i<nelem(buildorder); i++) { for(i=0; i<nelem(buildorder); i++)
p = bprintf(&b, buildorder[i], gochar); install(bprintf(&b, buildorder[i], gochar));
if(vflag > 0)
xprintf("%s\n", p);
install(p);
}
bfree(&b); bfree(&b);
} }

6
src/cmd/dist/unix.c vendored
View File

@ -386,7 +386,7 @@ xmkdirall(char *p)
void void
xremove(char *p) xremove(char *p)
{ {
if(vflag > 1) if(vflag > 2)
xprintf("rm %s\n", p); xprintf("rm %s\n", p);
unlink(p); unlink(p);
} }
@ -408,11 +408,11 @@ xremoveall(char *p)
bprintf(&b, "%s/%s", p, dir.p[i]); bprintf(&b, "%s/%s", p, dir.p[i]);
xremoveall(bstr(&b)); xremoveall(bstr(&b));
} }
if(vflag > 1) if(vflag > 2)
xprintf("rm %s\n", p); xprintf("rm %s\n", p);
rmdir(p); rmdir(p);
} else { } else {
if(vflag > 1) if(vflag > 2)
xprintf("rm %s\n", p); xprintf("rm %s\n", p);
unlink(p); unlink(p);
} }