mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
fbcdf2c565
This would be more effective if we didn't *merge* in the specs repo, but still. Usage: ./devtools/bolt-catchup.sh It goes through one commit at a time, up to current HEAD, and stops when there are changes, or quotes change. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
26 lines
878 B
Bash
Executable File
26 lines
878 B
Bash
Executable File
#! /bin/sh
|
|
# A script to upgrade spec versions one at a time, stop when something changes.
|
|
|
|
set -e
|
|
BOLTDIR=${1:-../bolts}
|
|
|
|
HEAD=$(git -C "$BOLTDIR" show --format=%H -s)
|
|
VERSION=$(sed -n 's/^DEFAULT_BOLTVERSION[ ]*:=[ ]*\([0-9a-f]*\)/\1/p' < Makefile)
|
|
|
|
# We only change Makefile at exit, otherwise git diff shows the difference, of course!
|
|
finalize_and_exit()
|
|
{
|
|
sed "s/^DEFAULT_BOLTVERSION[ ]*:=[ ]*\([0-9a-f]*\)/DEFAULT_BOLTVERSION := $v/" < Makefile > Makefile.$$ && mv Makefile.$$ Makefile
|
|
exit 0
|
|
}
|
|
|
|
for v in $(git -C "$BOLTDIR" show "$VERSION..$HEAD" --format=%H -s | tac); do
|
|
echo "Trying $v..."
|
|
make -s extract-bolt-csv DEFAULT_BOLTVERSION="$v" || finalize_and_exit
|
|
git diff --exit-code || finalize_and_exit
|
|
make -s check-source-bolt DEFAULT_BOLTVERSION="$v" || finalize_and_exit
|
|
done
|
|
|
|
echo "No changes, simply upgrading to $v..."
|
|
finalize_and_exit
|