Skip to content

Commit

Permalink
wire: update how experimental csv patches are managed
Browse files Browse the repository at this point in the history
We used to append new patches to a single file. This caused
some problems and is a lot harder to cleanup later.

This patch moves the experimental patches to their own, individual
patch files, that are named for the current BOLTVERSION, which they're
taken from.

Also moves the current patchfile over to a 'gossipqueries' one,
as it already exists.
  • Loading branch information
niftynei authored and rustyrussell committed Sep 16, 2019
1 parent 6360ffb commit aef5b30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions wire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ extract-bolt-csv: bolt-precheck
@echo '#include <wire/onion_defs.h>' > wire/extracted_onion_wire_csv
@$(BOLT_EXTRACT) $(LOCAL_BOLTDIR)/04*.md >> wire/extracted_onion_wire_csv

# Explicit command to add diff of BOLT CSV's to an experimental_csv file
# Explicit command to add patchfile for BOLT CSV's
extract-experimental-bolt-csv: bolt-precheck
@$(BOLT_EXTRACT) $(LOCAL_BOLTDIR)/0[127]*.md | diff -u wire/extracted_peer_wire_csv - >>wire/extracted_peer_experimental_csv | if [ $$? -lt 0 ];then exit 1;fi
@{ echo '#include <wire/onion_defs.h>'; $(BOLT_EXTRACT) $(LOCAL_BOLTDIR)/04*.md; } | diff -u wire/extracted_onion_wire_csv - >>wire/extracted_onion_experimental_csv | if [ $$? -lt 0 ];then exit 1;fi
@$(BOLT_EXTRACT) $(LOCAL_BOLTDIR)/0[127]*.md | diff -u wire/extracted_peer_wire_csv - >wire/extracted_peer_experimental_$(BOLTVERSION) | if [ $$? -lt 0 ];then exit 1;fi
@{ echo '#include <wire/onion_defs.h>'; $(BOLT_EXTRACT) $(LOCAL_BOLTDIR)/04*.md; } | diff -u wire/extracted_onion_wire_csv - > wire/extracted_onion_experimental_$(BOLTVERSION) | if [ $$? -lt 0 ];then exit 1;fi

wire/extracted_peer_experimental_csv:
@touch $@
Expand All @@ -50,11 +50,14 @@ wire/extracted_onion_experimental_csv:
@touch $@

ifeq ($(EXPERIMENTAL_FEATURES),1)
wire/gen_peer_wire_csv: wire/extracted_peer_experimental_csv wire/extracted_peer_wire_csv
@patch --silent -o $@ wire/extracted_peer_wire_csv $<
EXPERIMENTAL_PEER_PATCHES := $(wildcard wire/extracted_peer_experimental_*)
EXPERIMENTAL_ONION_PATCHES := $(wildcard wire/extracted_onion_experimental_*)

wire/gen_onion_wire_csv: wire/extracted_onion_experimental_csv wire/extracted_onion_wire_csv
@patch --silent -o $@ wire/extracted_onion_wire_csv $<
wire/gen_peer_wire_csv: wire/extracted_peer_wire_csv $(EXPERIMENTAL_PEER_PATCHES)
@set -e; trap "rm -f $@.$$$$" 0; cp $< $@.$$$$; for exp in $(EXPERIMENTAL_PEER_PATCHES); do patch --silent $@.$$$$ $$exp; done; mv $@.$$$$ $@

wire/gen_onion_wire_csv: wire/extracted_onion_wire_csv $(EXPERIMENTAL_ONION_PATCHES)
@set -e; trap "rm -f $@.$$$$" 0; cp $< $@.$$$$; for exp in $(EXPERIMENTAL_ONION_PATCHES); do patch --silent $@.$$$$ $$exp; done; mv $@.$$$$ $@

else # /* EXPERIMENTAL_FEATURES */
wire/gen_peer_wire_csv: wire/extracted_peer_wire_csv
Expand Down
Empty file.
File renamed without changes.

0 comments on commit aef5b30

Please sign in to comment.