You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
727 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. #! /bin/bash
  2. set -ex
  3. set +u
  4. if [[ "$DEP" == "" ]]; then
  5. DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock
  6. fi
  7. set -u
  8. set -u
  9. function getVendoredVersion() {
  10. grep -A100 "$LIB" "$DEP" | grep revision | head -n1 | grep -o '"[^"]\+"' | cut -d '"' -f 2
  11. }
  12. # fetch and checkout vendored dep
  13. lib=$1
  14. echo "----------------------------------"
  15. echo "Getting $lib ..."
  16. go get -t "github.com/tendermint/$lib/..."
  17. VENDORED=$(getVendoredVersion "$lib")
  18. cd "$GOPATH/src/github.com/tendermint/$lib" || exit
  19. MASTER=$(git rev-parse origin/master)
  20. if [[ "$VENDORED" != "$MASTER" ]]; then
  21. echo "... VENDORED != MASTER ($VENDORED != $MASTER)"
  22. echo "... Checking out commit $VENDORED"
  23. git checkout "$VENDORED" &> /dev/null
  24. fi