-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x509: update go-generator #87
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
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 | ||
#!/bin/sh | ||
set -e | ||
goroot="$(go env GOROOT)" | ||
x509path=$goroot/src/crypto/x509 | ||
test -d $goroot | ||
test -d $x509path | ||
cp -av $x509path/* . | ||
rm x509_test.go | ||
sed -i.bak 's/golang_org/golang.org/g' x509.go | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you've removed the copying of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no longer necessary it seems (go 1.11.1 here) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct in inferring that the
set -u
,set -o pipefail
, andshopt -s failglob
were removed for compatibility withsh
? I'm honestly not sure how I feel about this change; those options are useful from a safety perspective. @hlandau what do you think about this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and, well, theres no piping going on so theres no need for pipefail