From c19bbb2403a4ec438288b64b2c0babf2a8e70e05 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 28 Feb 2018 11:15:40 +0400 Subject: [PATCH] switch back to parsing .lock file --- scripts/dep_utils/checkout.sh | 11 ++++++++--- scripts/dep_utils/parse.sh | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/dep_utils/checkout.sh b/scripts/dep_utils/checkout.sh index 941fb5166..02b23d048 100644 --- a/scripts/dep_utils/checkout.sh +++ b/scripts/dep_utils/checkout.sh @@ -1,10 +1,15 @@ #! /bin/bash + +set +u +if [[ "$DEP" == "" ]]; then + DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock +fi +set -u + set -u function getVendoredVersion() { - cd "$GOPATH/src/github.com/tendermint/tendermint" || exit - dep status | grep "$1" | awk '{print $4}' - cd - || exit + grep -A100 "$LIB" "$DEP" | grep revision | head -n1 | grep -o '"[^"]\+"' | cut -d '"' -f 2 } diff --git a/scripts/dep_utils/parse.sh b/scripts/dep_utils/parse.sh index adaf82ecf..290cab559 100644 --- a/scripts/dep_utils/parse.sh +++ b/scripts/dep_utils/parse.sh @@ -1,8 +1,13 @@ #! /bin/bash -set -euo pipefail -cd "$GOPATH/github.com/tendermint/tendermint" || exit +set +u +if [[ "$DEP" == "" ]]; then + DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock +fi +set -u + +set -euo pipefail LIB=$1 -dep status | grep "$LIB" | awk '{print $4}' +grep -A100 "$LIB" "$DEP" | grep revision | head -n1 | grep -o '"[^"]\+"' | cut -d '"' -f 2