mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 13:11:38 +00:00
update some scripts
This commit is contained in:
27
scripts/glide/checkout.sh
Normal file
27
scripts/glide/checkout.sh
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
set -u
|
||||||
|
|
||||||
|
function parseGlide() {
|
||||||
|
cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# fetch and checkout vendored dep
|
||||||
|
|
||||||
|
glide=$1
|
||||||
|
lib=$2
|
||||||
|
|
||||||
|
echo "----------------------------------"
|
||||||
|
echo "Getting $lib ..."
|
||||||
|
go get -t github.com/tendermint/$lib/...
|
||||||
|
|
||||||
|
VENDORED=$(parseGlide $glide $lib)
|
||||||
|
cd $GOPATH/src/github.com/tendermint/$lib
|
||||||
|
MASTER=$(git rev-parse origin/master)
|
||||||
|
|
||||||
|
if [[ "$VENDORED" != "$MASTER" ]]; then
|
||||||
|
echo "... VENDORED != MASTER ($VENDORED != $MASTER)"
|
||||||
|
echo "... Checking out commit $VENDORED"
|
||||||
|
git checkout $VENDORED &> /dev/null
|
||||||
|
fi
|
||||||
|
|
@ -3,6 +3,8 @@ set -euo pipefail
|
|||||||
|
|
||||||
LIB=$1
|
LIB=$1
|
||||||
|
|
||||||
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
if [[ "$GLIDE" == "" ]]; then
|
||||||
|
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
||||||
|
fi
|
||||||
|
|
||||||
cat $GLIDE | grep -A1 $LIB | grep -v $LIB | awk '{print $2}'
|
cat $GLIDE | grep -A1 $LIB | grep -v $LIB | awk '{print $2}'
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
# for every github.com/tendermint dependency, warn is if its not synced with origin/master
|
# for every github.com/tendermint dependency, warn is if its not synced with origin/master
|
||||||
|
|
||||||
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
if [[ "$GLIDE" == "" ]]; then
|
||||||
|
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
||||||
|
fi
|
||||||
|
|
||||||
# make list of libs
|
# make list of libs
|
||||||
LIBS=($(grep "github.com/tendermint" $GLIDE | awk '{print $3}'))
|
LIBS=($(grep "github.com/tendermint" $GLIDE | awk '{print $3}'))
|
||||||
|
@ -6,9 +6,12 @@ IFS=$'\n\t'
|
|||||||
|
|
||||||
LIB=$1
|
LIB=$1
|
||||||
|
|
||||||
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
TMCORE=$GOPATH/src/github.com/tendermint/tendermint
|
||||||
|
if [[ "$GLIDE" == "" ]]; then
|
||||||
|
GLIDE=$TMCORE/glide.lock
|
||||||
|
fi
|
||||||
|
|
||||||
OLD_COMMIT=`bash scripts/glide/parse.sh $LIB`
|
OLD_COMMIT=`bash $TMCORE/scripts/glide/parse.sh $LIB`
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
cd $GOPATH/src/github.com/tendermint/$LIB
|
cd $GOPATH/src/github.com/tendermint/$LIB
|
||||||
@ -16,4 +19,12 @@ cd $GOPATH/src/github.com/tendermint/$LIB
|
|||||||
NEW_COMMIT=$(git rev-parse HEAD)
|
NEW_COMMIT=$(git rev-parse HEAD)
|
||||||
|
|
||||||
cd $PWD
|
cd $PWD
|
||||||
sed -i "" "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE
|
|
||||||
|
uname -a | grep Linux > /dev/null
|
||||||
|
if [[ "$?" == 0 ]]; then
|
||||||
|
# linux
|
||||||
|
sed -i "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE
|
||||||
|
else
|
||||||
|
# mac
|
||||||
|
sed -i "" "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE
|
||||||
|
fi
|
||||||
|
Reference in New Issue
Block a user