mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 14:43:19 +00:00
ditch glide
This commit is contained in:
@@ -1,27 +1,25 @@
|
||||
#! /bin/bash
|
||||
set -u
|
||||
|
||||
function parseGlide() {
|
||||
cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}'
|
||||
function getVendoredVersion() {
|
||||
dep status | grep "$1" | awk '{print $4}'
|
||||
}
|
||||
|
||||
|
||||
# fetch and checkout vendored dep
|
||||
|
||||
glide=$1
|
||||
lib=$2
|
||||
lib=$1
|
||||
|
||||
echo "----------------------------------"
|
||||
echo "Getting $lib ..."
|
||||
go get -t github.com/tendermint/$lib/...
|
||||
go get -t "github.com/tendermint/$lib/..."
|
||||
|
||||
VENDORED=$(parseGlide $glide $lib)
|
||||
cd $GOPATH/src/github.com/tendermint/$lib
|
||||
VENDORED=$(getVendoredVersion "$lib")
|
||||
cd "$GOPATH/src/github.com/tendermint/$lib" || exit
|
||||
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
|
||||
git checkout "$VENDORED" &> /dev/null
|
||||
fi
|
||||
|
||||
6
scripts/dep_utils/parse.sh
Normal file
6
scripts/dep_utils/parse.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#! /bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
LIB=$1
|
||||
|
||||
dep status | grep "$LIB" | awk '{print $4}'
|
||||
@@ -1,13 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
set +u
|
||||
if [[ "$GLIDE" == "" ]]; then
|
||||
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
||||
fi
|
||||
set -u
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
LIB=$1
|
||||
|
||||
cat $GLIDE | grep -A1 $LIB | grep -v $LIB | awk '{print $2}'
|
||||
@@ -1,47 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
# for every github.com/tendermint dependency, warn is if its not synced with origin/master
|
||||
|
||||
if [[ "$GLIDE" == "" ]]; then
|
||||
GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock
|
||||
fi
|
||||
|
||||
# make list of libs
|
||||
LIBS=($(grep "github.com/tendermint" $GLIDE | awk '{print $3}'))
|
||||
|
||||
|
||||
UPTODATE=true
|
||||
for lib in "${LIBS[@]}"; do
|
||||
# get vendored commit
|
||||
VENDORED=`grep -A1 $lib $GLIDE | grep -v $lib | awk '{print $2}'`
|
||||
PWD=`pwd`
|
||||
cd $GOPATH/src/$lib
|
||||
MASTER=`git rev-parse origin/master`
|
||||
HEAD=`git rev-parse HEAD`
|
||||
cd $PWD
|
||||
|
||||
if [[ "$VENDORED" != "$MASTER" ]]; then
|
||||
UPTODATE=false
|
||||
echo ""
|
||||
if [[ "$VENDORED" != "$HEAD" ]]; then
|
||||
echo "Vendored version of $lib differs from origin/master and HEAD"
|
||||
echo "Vendored: $VENDORED"
|
||||
echo "Master: $MASTER"
|
||||
echo "Head: $HEAD"
|
||||
else
|
||||
echo "Vendored version of $lib differs from origin/master but matches HEAD"
|
||||
echo "Vendored: $VENDORED"
|
||||
echo "Master: $MASTER"
|
||||
fi
|
||||
elif [[ "$VENDORED" != "$HEAD" ]]; then
|
||||
echo ""
|
||||
echo "Vendored version of $lib matches origin/master but differs from HEAD"
|
||||
echo "Vendored: $VENDORED"
|
||||
echo "Head: $HEAD"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$UPTODATE" == "true" ]]; then
|
||||
echo "All vendored versions up to date"
|
||||
fi
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#! /bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# script to update the given dependency in the glide.lock file with the checked out branch on the local host
|
||||
|
||||
LIB=$1
|
||||
|
||||
TMCORE=$GOPATH/src/github.com/tendermint/tendermint
|
||||
set +u
|
||||
if [[ "$GLIDE" == "" ]]; then
|
||||
GLIDE=$TMCORE/glide.lock
|
||||
fi
|
||||
set -u
|
||||
|
||||
OLD_COMMIT=`bash $TMCORE/scripts/glide/parse.sh $LIB`
|
||||
|
||||
PWD=`pwd`
|
||||
cd $GOPATH/src/github.com/tendermint/$LIB
|
||||
|
||||
NEW_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
cd $PWD
|
||||
|
||||
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
|
||||
@@ -3,11 +3,11 @@
|
||||
go get -d github.com/tendermint/abci
|
||||
|
||||
# get the abci commit used by tendermint
|
||||
COMMIT=`bash scripts/glide/parse.sh abci`
|
||||
COMMIT=$(bash scripts/dep_utils/parse.sh abci)
|
||||
|
||||
echo "Checking out vendored commit for abci: $COMMIT"
|
||||
|
||||
cd $GOPATH/src/github.com/tendermint/abci
|
||||
git checkout $COMMIT
|
||||
glide install
|
||||
go install ./cmd/...
|
||||
cd "$GOPATH/src/github.com/tendermint/abci" || exit
|
||||
git checkout "$COMMIT"
|
||||
make get_vendor_deps
|
||||
make install
|
||||
|
||||
Reference in New Issue
Block a user