cmd/golangorg: set GOPATH to empty directory rather than empty string
When generating an index, point the GOPATH environment variable to an empty directory. Setting it to the empty string doesn't work as of Go 1.8, where a default GOPATH value was added¹. ¹ https://golang.org/doc/go1.8#gopath Change-Id: I9adfa60e8aa9c6931e3752b24720ec6e77932c9a Reviewed-on: https://go-review.googlesource.com/c/website/+/221105 Reviewed-by: Alexander Rakoczy <alex@golang.org> Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Родитель
441f74967e
Коммит
79a8f22851
|
@ -50,8 +50,8 @@ makeZipfile() {
|
|||
makeIndexfile() {
|
||||
echo "*** make $INDEXFILE"
|
||||
golangorg=$(go env GOPATH)/bin/golangorg
|
||||
# NOTE: run golangorg without GOPATH set. Otherwise third-party packages will end up in the index.
|
||||
GOPATH= $golangorg -write_index -goroot goroot -index_files=$INDEXFILE -zip=$ZIPFILE
|
||||
# Run golangorg with GOPATH set to an empty directory, otherwise third-party packages will be in the index.
|
||||
GOPATH=$(mktemp -d) $golangorg -write_index -goroot goroot -index_files=$INDEXFILE -zip=$ZIPFILE
|
||||
}
|
||||
|
||||
splitIndexfile() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче