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.

33 lines
718 B

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