|
|
@ -6,12 +6,12 @@ shopt -s failglob
|
|
|
|
cp -a $(go env GOROOT)/src/crypto/x509/* ./
|
|
|
|
cp -a $(go env GOROOT)/src/crypto/x509/* ./
|
|
|
|
rm ./x509_test.go
|
|
|
|
rm ./x509_test.go
|
|
|
|
|
|
|
|
|
|
|
|
# The following code is utterly horrifying. I can't find a better way to do it. :(
|
|
|
|
# Stdlib x509 relies on "internal" packages in Go, which aren't importable
|
|
|
|
mkdir -p ${GOPATH}/src/vendor/golang.org/
|
|
|
|
# outside of stdlib. So we copy those packages and rename them.
|
|
|
|
cp -R $(go env GOROOT)/src/vendor/golang_org/* ${GOPATH}/src/vendor/golang.org/
|
|
|
|
OLD_INTERNAL_PATH=$(go env GOROOT)/src/internal/x/crypto/cryptobyte
|
|
|
|
# h/t to https://www.cyberciti.biz/faq/unix-linux-replace-string-words-in-many-files/
|
|
|
|
NEW_INTERNAL_PATH=$(go env GOPATH)/src/github.com/namecoin/ncdns/x509/golang/x/crypto/cryptobyte
|
|
|
|
OLD_PACKAGE='"golang_org/x/crypto/cryptobyte'
|
|
|
|
mkdir -p ${NEW_INTERNAL_PATH}/
|
|
|
|
OLD_PACKAGE="${OLD_PACKAGE//\//\\/}"
|
|
|
|
cp -R ${OLD_INTERNAL_PATH}/* ${NEW_INTERNAL_PATH}/
|
|
|
|
NEW_PACKAGE='"golang.org/x/crypto/cryptobyte'
|
|
|
|
OLD_PACKAGE='"internal/x/crypto/cryptobyte'
|
|
|
|
NEW_PACKAGE="${NEW_PACKAGE//\//\\/}"
|
|
|
|
NEW_PACKAGE='"github.com/namecoin/ncdns/x509/golang/x/crypto/cryptobyte'
|
|
|
|
sed -i "s/${OLD_PACKAGE}/${NEW_PACKAGE}/g" ./*.go ${GOPATH}/src/vendor/golang.org/x/crypto/cryptobyte/*.go
|
|
|
|
sed -i "s_${OLD_PACKAGE}_${NEW_PACKAGE}_g" ./*.go ${NEW_INTERNAL_PATH}/*.go
|
|
|
|