From 8d44b532aa69567538aaab6aa13aed1c5ca4f171 Mon Sep 17 00:00:00 2001 From: JeremyRand Date: Sun, 11 Mar 2018 19:34:40 +0000 Subject: [PATCH] x509: Update install script for Go 1.10. --- x509/install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/x509/install.sh b/x509/install.sh index 7577cc7..5834df7 100755 --- a/x509/install.sh +++ b/x509/install.sh @@ -5,3 +5,13 @@ shopt -s failglob cp -a $(go env GOROOT)/src/crypto/x509/* ./ rm ./x509_test.go + +# The following code is utterly horrifying. I can't find a better way to do it. :( +mkdir -p ${GOPATH}/src/vendor/golang.org/ +cp -R $(go env GOROOT)/src/vendor/golang_org/* ${GOPATH}/src/vendor/golang.org/ +# h/t to https://www.cyberciti.biz/faq/unix-linux-replace-string-words-in-many-files/ +OLD_PACKAGE='"golang_org/x/crypto/cryptobyte' +OLD_PACKAGE="${OLD_PACKAGE//\//\\/}" +NEW_PACKAGE='"golang.org/x/crypto/cryptobyte' +NEW_PACKAGE="${NEW_PACKAGE//\//\\/}" +sed -i "s/${OLD_PACKAGE}/${NEW_PACKAGE}/g" ./*.go ${GOPATH}/src/vendor/golang.org/x/crypto/cryptobyte/*.go