From 07224653a0e65c7b7ec0b2d4dd212351db26fb7d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 25 Mar 2008 00:37:03 -0300 Subject: [PATCH] Add a --skip-png-check option. This fixes test generation, which generates PNGs only for changed files. --- make/lilypond-vars.make | 5 ++++- scripts/lilypond-book.py | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 6932c718f7..5cbd5537cb 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -37,10 +37,13 @@ LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_VERBOSE) $(LILYPOND_BOOK_INFO_IMAGES_DIR) ifeq ($(out),) LILYPOND_BOOK_PROCESS = true -LILYPOND_BOOK_FLAGS = --no-lily-run +LILYPOND_BOOK_FLAGS += --no-lily-run else LILYPOND_BOOK_PROCESS = $(LILYPOND_BINARY) endif +ifeq ($(out),test) +LILYPOND_BOOK_FLAGS += --skip-png-check +endif TEXINPUTS=$(top-src-dir)/tex/:: export TEXINPUTS diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index f2052910f3..553bbed1ff 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -146,11 +146,17 @@ def get_option_parser (): action='store', dest='output_dir', default='') - p.add_option ('--no-lily-run', + p.add_option ('--skip-lily-check', help=_ ("do not fail if no lilypond output is found."), metavar=_ ("DIR"), action='store_true', dest='skip_lilypond_run', default=False) + + p.add_option ('--skip-png-check', + help=_ ("do not fail if no PNG images are found for EPS files"), + metavar=_ ("DIR"), + action='store_true', dest='skip_png_check', + default=False) p.add_option ('--lily-output-dir', help=_ ("write lily-XXX files to DIR, link into --output dir."), @@ -1156,6 +1162,7 @@ class LilypondSnippet (Snippet): else: missing.add (name) + # UGH - junk global_options skip_lily = global_options.skip_lilypond_run for required in [base + '.ly', base + '.txt']: @@ -1170,7 +1177,9 @@ class LilypondSnippet (Snippet): base + '-systems.tex', base + '-systems.pdftexi']) - if base + '.eps' in result and self.format in (HTML, TEXINFO): + # UGH - junk global_options + if (base + '.eps' in result and self.format in (HTML, TEXINFO) + and not global_options.skip_png_check): page_count = ps_page_count (full + '.eps') if page_count <= 1: require_file (base + '.png') @@ -1179,7 +1188,7 @@ class LilypondSnippet (Snippet): require_file (base + '-page%d.png' % page) system_count = 0 - if not skip_lily: + if not skip_lily and not missing: system_count = int(file (full + '-systems.count').read()) for number in range(1, system_count + 1): systemfile = '%s-%d' % (base, number) -- 2.39.2