Skip to content

Commit

Permalink
Makefile: Fix ticket page layer modifications
Browse files Browse the repository at this point in the history
It appears that the page layers in the updated cornwall_tickets.svg has
reordered style="display:{inline,none}" and inkscape:label="Page XX"
attributes, resulting in the first page repeating 6 times.

Update the sed commands in the Makefile to find the two attributes
within 3 lines of one another *in either order* before adjusting
visibility.

Signed-off-by: James Hogan <james@albanarts.com>
  • Loading branch information
amalon committed May 17, 2020
1 parent cd83617 commit 77d478f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ $(TILED_OUTPUTS): $(OUT)/%: $(TMP)/%
$(SVG_TICKETS): cornwall_tickets.svg | $(TMP)
rm -f $@
cp cornwall_tickets.svg $@.tmp
sed -i '/inkscape:label="Page [0-9]\+"/{N;N;N;/style=/{s/style="display:inline"/style="display:none"/}}' $@.tmp
sed -i '/inkscape:label="Page $(patsubst $(TMP)/cornwall_tickets.page%.svg,%,$@)"/{N;N;N;/style=/{s/style="display:none"/style="display:inline"/}}' $@.tmp
sed -i '/\(inkscape:label="Page [0-9]\+"\|style="display:inline"\)/{N;N;N;/inkscape:label="Page [0-9]\+"/{/style=/{s/style="display:inline"/style="display:none"/}}}' $@.tmp
sed -i '/\(inkscape:label="Page $(patsubst $(TMP)/cornwall_tickets.page%.svg,%,$@)"\|style="display:none"\)/{N;N;N;/inkscape:label="Page $(patsubst $(TMP)/cornwall_tickets.page%.svg,%,$@)"/{/style=/{s/style="display:none"/style="display:inline"/}}}' $@.tmp
mv $@.tmp $@

# This symlink is required due to links in the ticket SVG which we have
Expand Down

0 comments on commit 77d478f

Please sign in to comment.