]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc/ios: ignore stderr from iOS tools
authorElias Naur <elias.naur@gmail.com>
Wed, 1 Feb 2017 07:57:46 +0000 (08:57 +0100)
committerElias Naur <elias.naur@gmail.com>
Wed, 1 Feb 2017 22:08:47 +0000 (22:08 +0000)
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 <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

misc/ios/detect.go

index 53749ad371d90458b47ef0da51a88fb3b40e6dbe..c37fce2ec1390108c3847639293368b63a900502 100644 (file)
@@ -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)