Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(475)

Delta Between Two Patch Sets: misc/dashboard/builder/exec.go

Issue 4172056: code review 4172056: gobuilder: add -package flag to build external packages (Closed)
Left Patch Set: diff -r c166ed517af1 https://go.googlecode.com/hg/ Created 14 years ago
Right Patch Set: diff -r 0309fd640319 https://go.googlecode.com/hg/ Created 14 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « misc/dashboard/builder/doc.go ('k') | misc/dashboard/builder/hg.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
1 package main 5 package main
2 6
3 import ( 7 import (
4 "bytes" 8 "bytes"
5 "exec" 9 "exec"
6 "io" 10 "io"
7 "log" 11 "log"
8 "os" 12 "os"
9 "strings" 13 "strings"
10 ) 14 )
(...skipping 12 matching lines...) Expand all
23 if err != nil { 27 if err != nil {
24 return err 28 return err
25 } 29 }
26 return p.Close() 30 return p.Close()
27 } 31 }
28 32
29 // runLog runs a process and returns the combined stdout/stderr,· 33 // runLog runs a process and returns the combined stdout/stderr,·
30 // as well as writing it to logfile (if specified). 34 // as well as writing it to logfile (if specified).
31 func runLog(envv []string, logfile, dir string, argv ...string) (output string, exitStatus int, err os.Error) { 35 func runLog(envv []string, logfile, dir string, argv ...string) (output string, exitStatus int, err os.Error) {
32 if *verbose { 36 if *verbose {
33 » » log.Println("run", argv) 37 » » log.Println("runLog", argv)
gri 2011/02/23 04:35:23 runLog ?
34 } 38 }
35 bin, err := pathLookup(argv[0]) 39 bin, err := pathLookup(argv[0])
36 if err != nil { 40 if err != nil {
37 return 41 return
38 } 42 }
39 p, err := exec.Run(bin, argv, envv, dir, 43 p, err := exec.Run(bin, argv, envv, dir,
40 exec.DevNull, exec.Pipe, exec.MergeWithStdout) 44 exec.DevNull, exec.Pipe, exec.MergeWithStdout)
41 if err != nil { 45 if err != nil {
42 return 46 return
43 } 47 }
(...skipping 19 matching lines...) Expand all
63 return b.String(), wait.WaitStatus.ExitStatus(), nil 67 return b.String(), wait.WaitStatus.ExitStatus(), nil
64 } 68 }
65 69
66 // Find bin in PATH if a relative or absolute path hasn't been specified 70 // Find bin in PATH if a relative or absolute path hasn't been specified
67 func pathLookup(s string) (string, os.Error) { 71 func pathLookup(s string) (string, os.Error) {
68 if strings.HasPrefix(s, "/") || strings.HasPrefix(s, "./") || strings.Ha sPrefix(s, "../") { 72 if strings.HasPrefix(s, "/") || strings.HasPrefix(s, "./") || strings.Ha sPrefix(s, "../") {
69 return s, nil 73 return s, nil
70 } 74 }
71 return exec.LookPath(s) 75 return exec.LookPath(s)
72 } 76 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b