mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 21:36:26 +00:00
glide: update lock and add util scripts
This commit is contained in:
34
scripts/glide/glide_status.sh
Normal file
34
scripts/glide/glide_status.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#! /bin/bash
|
||||
|
||||
# for every github.com/tendermint dependency, warn is if its not synced with origin/master
|
||||
|
||||
GLIDE=$1
|
||||
|
||||
# make list of libs
|
||||
LIBS=($(grep "github.com/tendermint" $GLIDE | awk '{print $3}'))
|
||||
|
||||
|
||||
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
|
||||
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
|
||||
fi
|
||||
done
|
||||
|
||||
23
scripts/glide/glide_update.sh
Normal file
23
scripts/glide/glide_update.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#! /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
|
||||
|
||||
GLIDE=$1
|
||||
LIB=$2
|
||||
|
||||
# get vendored commit for given lib
|
||||
function parseGlide() {
|
||||
cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}'
|
||||
}
|
||||
|
||||
OLD_COMMIT=`parseGlide $GLIDE $LIB`
|
||||
|
||||
PWD=`pwd`
|
||||
cd $GOPATH/src/github.com/tendermint/$LIB
|
||||
|
||||
NEW_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
cd $PWD
|
||||
sed -i "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE
|
||||
Reference in New Issue
Block a user