summarylogtreecommitdiffstats
path: root/fix_lilypond_eps_file_mismatch.patch
blob: 6cfa08dd786587ef2f0ba9457104c11d2f018d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Author: Francois Mazen <francois@mzf.fr>
Description: Fix the mismatch of intermediate eps filename when generating theory-intervals-seconds.png and theory-intervals-seconds-1.png in parallel. This issue lead to reproducible issue and sometimes wrong generation of png files.


--- a/help/Makefile
+++ b/help/Makefile
@@ -153,7 +153,12 @@
 ifeq "$(LILYPOND_VERSION)" "2.10"
 	$(LILYPOND) -I ../../C/ly --png -b eps -dno-gs-load-fonts -dinclude-eps-fonts -o $(basename $@) $<
 else
-	$(LILYPOND) -I ../../C/ly --png -d backend=eps -o $(basename $@) $<
+	# Generate the file in a unique temporary folder, in order to avoid mismatch of eps filenames.
+	mkdir $(basename $@)-tempdir
+	$(LILYPOND) -I ../../../C/ly --png -d backend=eps -o $(basename $@)-tempdir/temp_output $<
+	cp $(basename $@)-tempdir/temp_output.png $(basename $@).png
+	rm $(basename $@)-tempdir/*
+	rmdir $(basename $@)-tempdir
 endif
 
 stupid-step1: