-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(script/go.bash): support Ubuntu 22.04 LTS and Debian 11 (#1487)
This commit is part of ooni/probe#2664. We use a different strategy for downloading and executing the correct version of Go. We have vendored and adapted to code at `golang.org/dl` such that it works with versions of Go as old as the version of Go used by Ubuntu 22.04 LTS and Debian 11.
- Loading branch information
1 parent
8179b98
commit 93afcb2
Showing
13 changed files
with
720 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/gobash.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/ooni/probe-cli/pkg/gobash | ||
|
||
go 1.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package main | ||
|
||
import ( | ||
"io/ioutil" | ||
"log" | ||
) | ||
|
||
func main() { | ||
// read the content of GOVERSION | ||
data, err := ioutil.ReadFile("GOVERSION") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// strip trailing newlines | ||
for len(data) > 0 && data[len(data)-1] == '\r' || data[len(data)-1] == '\n' { | ||
data = data[:len(data)-1] | ||
} | ||
|
||
// run the specified version of go | ||
Run("go" + string(data)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2021 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build windows | ||
// +build windows | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
var signalsToIgnore = []os.Signal{os.Interrupt} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2021 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build darwin || freebsd || linux || openbsd | ||
// +build darwin freebsd linux openbsd | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
"syscall" | ||
) | ||
|
||
var signalsToIgnore = []os.Signal{os.Interrupt, syscall.SIGQUIT} |
Oops, something went wrong.