fix build scripts, port go-mysql-org/go-mysql#349 to remove cgo dep
This commit is contained in:
parent
8e5bd715c4
commit
fd375119a3
3
build.sh
3
build.sh
|
@ -73,4 +73,7 @@ main() {
|
|||
(cd $buildpath && shasum -a256 gh-ost* 2>/dev/null)
|
||||
}
|
||||
|
||||
. script/bootstrap
|
||||
cd .gopath/src/github.com/github/gh-ost
|
||||
|
||||
main "$@"
|
||||
|
|
|
@ -10,7 +10,6 @@ set -e
|
|||
# Since we want to be able to build this outside of GOPATH, we set it
|
||||
# up so it points back to us and go is none the wiser
|
||||
|
||||
set -x
|
||||
rm -rf .gopath
|
||||
mkdir -p .gopath/src/github.com/github
|
||||
ln -s "$PWD" .gopath/src/github.com/github/gh-ost
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFERRED_GO_VERSION=go1.16.4
|
||||
SUPPORTED_GO_VERSIONS='go1.1[56]'
|
||||
SUPPORTED_GO_VERSIONS='go1.1[567]'
|
||||
|
||||
GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg
|
||||
GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b
|
||||
|
@ -35,7 +35,7 @@ if [ -z "$(which go)" ] || [ -z "$(go version | grep "$SUPPORTED_GO_VERSIONS")"
|
|||
curl -L -O https://dl.google.com/go/$GO_PKG_DARWIN
|
||||
shasum -a256 $GO_PKG_DARWIN | grep $GO_PKG_DARWIN_SHA
|
||||
xar -xf $GO_PKG_DARWIN
|
||||
cpio -i < com.googlecode.go.pkg/Payload
|
||||
cpio -i < org.golang.go.pkg/Payload
|
||||
else
|
||||
curl -L -O https://dl.google.com/go/$GO_PKG_LINUX
|
||||
shasum -a256 $GO_PKG_LINUX | grep $GO_PKG_LINUX_SHA
|
||||
|
|
1
vendor/github.com/siddontang/go-mysql/client/resp.go
generated
vendored
1
vendor/github.com/siddontang/go-mysql/client/resp.go
generated
vendored
|
@ -1,6 +1,5 @@
|
|||
package client
|
||||
|
||||
import "C"
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
||||
|
|
7
vendor/github.com/siddontang/go-mysql/packet/conn.go
generated
vendored
7
vendor/github.com/siddontang/go-mysql/packet/conn.go
generated
vendored
|
@ -1,6 +1,5 @@
|
|||
package packet
|
||||
|
||||
import "C"
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
@ -127,7 +126,7 @@ func (c *Conn) WritePacket(data []byte) error {
|
|||
func (c *Conn) WriteClearAuthPacket(password string) error {
|
||||
// Calculate the packet length and add a tailing 0
|
||||
pktLen := len(password) + 1
|
||||
data := make([]byte, 4 + pktLen)
|
||||
data := make([]byte, 4+pktLen)
|
||||
|
||||
// Add the clear password [null terminated string]
|
||||
copy(data[4:], password)
|
||||
|
@ -140,7 +139,7 @@ func (c *Conn) WriteClearAuthPacket(password string) error {
|
|||
// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
|
||||
func (c *Conn) WritePublicKeyAuthPacket(password string, cipher []byte) error {
|
||||
// request public key
|
||||
data := make([]byte, 4 + 1)
|
||||
data := make([]byte, 4+1)
|
||||
data[4] = 2 // cachingSha2PasswordRequestPublicKey
|
||||
c.WritePacket(data)
|
||||
|
||||
|
@ -163,7 +162,7 @@ func (c *Conn) WritePublicKeyAuthPacket(password string, cipher []byte) error {
|
|||
}
|
||||
sha1v := sha1.New()
|
||||
enc, _ := rsa.EncryptOAEP(sha1v, rand.Reader, pub.(*rsa.PublicKey), plain, nil)
|
||||
data = make([]byte, 4 + len(enc))
|
||||
data = make([]byte, 4+len(enc))
|
||||
copy(data[4:], enc)
|
||||
return c.WritePacket(data)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user