From: Elias Naur Date: Wed, 1 Feb 2017 07:57:46 +0000 (+0100) Subject: misc/ios: ignore stderr from iOS tools X-Git-Tag: go1.9beta1~1806 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ade6bcf1d5d0fdddb7ce779e7aa3f1479e1e77a3;p=gostls13.git misc/ios: ignore stderr from iOS tools On (at least) macOS 10.12, the `security cms` subcommand used by the iOS detection script will output an error to stderr. The command otherwise succeeds, but the extra line confuses a later parsing step. To fix it, use only stdout and ignore stderr from every command run by detect.go. For the new iOS builders. Change-Id: Iee426da7926d7f987ba1be061fa92ebb853ef53d Reviewed-on: https://go-review.googlesource.com/36059 Reviewed-by: David Crawshaw Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot --- diff --git a/misc/ios/detect.go b/misc/ios/detect.go index 53749ad371..c37fce2ec1 100644 --- a/misc/ios/detect.go +++ b/misc/ios/detect.go @@ -33,7 +33,7 @@ func main() { fname := f.Name() defer os.Remove(fname) - out := combinedOutput(parseMobileProvision(mp)) + out := output(parseMobileProvision(mp)) _, err = f.Write(out) check(err) check(f.Close()) @@ -111,12 +111,12 @@ func plistExtract(fname string, path string) ([]byte, error) { } func getLines(cmd *exec.Cmd) [][]byte { - out := combinedOutput(cmd) + out := output(cmd) return bytes.Split(out, []byte("\n")) } -func combinedOutput(cmd *exec.Cmd) []byte { - out, err := cmd.CombinedOutput() +func output(cmd *exec.Cmd) []byte { + out, err := cmd.Output() if err != nil { fmt.Println(strings.Join(cmd.Args, "\n")) fmt.Fprintln(os.Stderr, err)