Commit f3a7dad6 authored by Andrew Gerrand's avatar Andrew Gerrand

goinstall: s/vlogf/printf/

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4628050
parent e068b85b
...@@ -173,7 +173,7 @@ func tryCommand(c chan *vcsMatch, v *vcs, prefixes []string) { ...@@ -173,7 +173,7 @@ func tryCommand(c chan *vcsMatch, v *vcs, prefixes []string) {
for _, prefix := range prefixes { for _, prefix := range prefixes {
for _, suffix := range suffixes { for _, suffix := range suffixes {
repo := proto + "://" + prefix + suffix repo := proto + "://" + prefix + suffix
vlogf("try: %s %s %s\n", v.cmd, v.check, repo) printf("try: %s %s %s\n", v.cmd, v.check, repo)
if exec.Command(v.cmd, v.check, repo).Run() == nil { if exec.Command(v.cmd, v.check, repo).Run() == nil {
c <- &vcsMatch{v, prefix, repo} c <- &vcsMatch{v, prefix, repo}
return return
......
...@@ -57,7 +57,7 @@ func logf(format string, args ...interface{}) { ...@@ -57,7 +57,7 @@ func logf(format string, args ...interface{}) {
fmt.Fprintf(os.Stderr, format, args...) fmt.Fprintf(os.Stderr, format, args...)
} }
func vlogf(format string, args ...interface{}) { func printf(format string, args ...interface{}) {
if *verbose { if *verbose {
logf(format, args...) logf(format, args...)
} }
...@@ -175,14 +175,14 @@ func install(pkg, parent string) (built bool) { ...@@ -175,14 +175,14 @@ func install(pkg, parent string) (built bool) {
if parent == "" { if parent == "" {
errorf("%s: can not goinstall the standard library\n", pkg) errorf("%s: can not goinstall the standard library\n", pkg)
} else { } else {
vlogf("%s: skipping standard library\n", pkg) printf("%s: skipping standard library\n", pkg)
} }
return return
} }
// Download remote packages if not found or forced with -u flag. // Download remote packages if not found or forced with -u flag.
remote := isRemote(pkg) remote := isRemote(pkg)
if remote && (err == build.ErrNotFound || (err == nil && *update)) { if remote && (err == build.ErrNotFound || (err == nil && *update)) {
vlogf("%s: download\n", pkg) printf("%s: download\n", pkg)
err = download(pkg, tree.SrcDir()) err = download(pkg, tree.SrcDir())
} }
if err != nil { if err != nil {
...@@ -220,22 +220,22 @@ func install(pkg, parent string) (built bool) { ...@@ -220,22 +220,22 @@ func install(pkg, parent string) (built bool) {
return return
} }
if *nuke { if *nuke {
vlogf("%s: nuke\n", pkg) printf("%s: nuke\n", pkg)
script.Nuke() script.Nuke()
} else if *clean { } else if *clean {
vlogf("%s: clean\n", pkg) printf("%s: clean\n", pkg)
script.Clean() script.Clean()
} }
if *doInstall { if *doInstall {
if depBuilt || script.Stale() { if depBuilt || script.Stale() {
vlogf("%s: install\n", pkg) printf("%s: install\n", pkg)
if err := script.Run(); err != nil { if err := script.Run(); err != nil {
errorf("%s: install: %v\n", pkg, err) errorf("%s: install: %v\n", pkg, err)
return return
} }
built = true built = true
} else { } else {
vlogf("%s: up-to-date\n", pkg) printf("%s: up-to-date\n", pkg)
} }
} }
if remote { if remote {
...@@ -272,7 +272,7 @@ func genRun(dir string, stdin []byte, arg []string, quiet bool) os.Error { ...@@ -272,7 +272,7 @@ func genRun(dir string, stdin []byte, arg []string, quiet bool) os.Error {
cmd := exec.Command(arg[0], arg[1:]...) cmd := exec.Command(arg[0], arg[1:]...)
cmd.Stdin = bytes.NewBuffer(stdin) cmd.Stdin = bytes.NewBuffer(stdin)
cmd.Dir = dir cmd.Dir = dir
vlogf("%s: %s %s\n", dir, cmd.Path, strings.Join(arg[1:], " ")) printf("%s: %s %s\n", dir, cmd.Path, strings.Join(arg[1:], " "))
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
if !quiet || *verbose { if !quiet || *verbose {
......
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