mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
devtools/bolt-catchup.sh: a tool to update the specs, one commit at a time.
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>
This commit is contained in:
25
devtools/bolt-catchup.sh
Executable file
25
devtools/bolt-catchup.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#! /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
|
||||
Reference in New Issue
Block a user