From: Reinhold Kainhofer Date: Tue, 30 Aug 2011 11:42:39 +0000 (+0200) Subject: Fix 1821: Write pathes for ly-to-tely to a separate file rather than passing as cmd... X-Git-Tag: release/2.15.10-1~16 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=623197430a7ed9b755d92cb053b64c21678af803;p=lilypond.git Fix 1821: Write pathes for ly-to-tely to a separate file rather than passing as cmd line args For out-of-source builds, the collated files list has the whole absolute path for each and every file (>1000 for our regtests), which blows up the cmd line length to values that don't work with the shell (<=131000 chars allowed...). This patch takes the list in the makefile and writes the filenames in several patches (300 at a time for now) to a .list file and then passes just this one file to lys-to-tely, which reads in the whole long list of file names from that file. The trick is that while make can handle long variables, we can't pass it to ly-to-tely on the cmd line, but have to use a helper file. --- diff --git a/make/lysdoc-rules.make b/make/lysdoc-rules.make index 5c38f7d4ab..e8fe8a182e 100644 --- a/make/lysdoc-rules.make +++ b/make/lysdoc-rules.make @@ -1,2 +1,19 @@ -$(outdir)/collated-files.tely: $(COLLATED_FILES) - $(LYS_TO_TELY) --name=$(outdir)/collated-files.tely --title="$(TITLE)" --author="$(AUTHOR)" $^ +$(outdir)/collated-files.list: $(COLLATED_FILES) + echo "(Re-)Generating $@" + # We can't print the list in one go, as it might be longer than a + # shell command is allowed (as of linux 2.6.3x >131000 chars) + @echo $(wordlist 1, 299,$^)>$@ + @echo $(wordlist 300, 599,$^)>>$@ + @echo $(wordlist 600, 899,$^)>>$@ + @echo $(wordlist 900,1199,$^)>>$@ + @echo $(wordlist 1200,1499,$^)>>$@ + @echo $(wordlist 1500,1799,$^)>>$@ + @echo $(wordlist 1800,2099,$^)>>$@ + @echo $(wordlist 2100,2399,$^)>>$@ + @echo $(wordlist 2400,2699,$^)>>$@ + @echo $(wordlist 2700,2999,$^)>>$@ + # Print the rest, just in case the list is that long + echo $(wordlist 3000,$(words $^),$^)>>$@ + +$(outdir)/collated-files.tely: $(outdir)/collated-files.list + $(LYS_TO_TELY) --name=$(outdir)/collated-files.tely --title="$(TITLE)" --author="$(AUTHOR)" --input-filename=$^ diff --git a/scripts/build/lys-to-tely.py b/scripts/build/lys-to-tely.py index 6a2a05ed7d..a868ea2903 100644 --- a/scripts/build/lys-to-tely.py +++ b/scripts/build/lys-to-tely.py @@ -151,7 +151,7 @@ def name2line (n): if glob_input: files = glob.glob(glob_input) elif input_filename: - files = open(input_filename).read().splitlines() + files = open(input_filename).read().split() if files: dir = os.path.dirname (name) or "."