From 5e3626f731cdb18981212a6a5e5292680abb460e Mon Sep 17 00:00:00 2001 From: hanwen Date: Fri, 18 Jun 2004 23:22:33 +0000 Subject: [PATCH] (ic_p.make_include_option): set error_p for single file error. --- ChangeLog | 3 +++ python/lilylib.py | 5 +++-- scripts/lilypond.py | 9 ++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50553656f8..f4b922c4f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-06-19 Han-Wen Nienhuys + * scripts/lilypond.py (ic_p.make_include_option): set error_p for + single file error. + * lily/bar-line.cc (compound_barline): add support for unbroken ||: 2004-06-17 Carl Sorensen (carl_sorensen@byu.edu) diff --git a/python/lilylib.py b/python/lilylib.py index da44570a57..df6ee12a61 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -129,6 +129,7 @@ def exit (i): if __main__.verbose_p: raise _ ('Exiting (%d)...') % i else: + print 'ex thoto' , i sys.exit (i) def getopt_args (opts): @@ -276,7 +277,7 @@ def read_pipe (cmd, mode = 'r'): if error_log_file: os.unlink (error_log_file) - exit (status) + exit (1) if __main__.verbose_p: progress ('\n') @@ -332,7 +333,7 @@ Exit status of CMD ''' sys.stderr.write (open (error_log_file).read ()) if error_log_file: os.unlink (error_log_file) - exit (status) + exit (1) if error_log_file: os.unlink (error_log_file) diff --git a/scripts/lilypond.py b/scripts/lilypond.py index 9e0e160ef1..6e2bf6c5d5 100644 --- a/scripts/lilypond.py +++ b/scripts/lilypond.py @@ -136,6 +136,9 @@ option_definitions = [ safe_mode_p = 0 preview_p = 0 page_images_p = 0 + +# need global variable. sys.exit() raises an exception, which is handled +# to do cleanups. lilypond_error_p = 0 html_p = 0 @@ -247,14 +250,15 @@ def run_lilypond (files, dep_prefix): ly.exit (status) if status: + global lilypond_error_p sys.stderr.write ('\n') if len (files) == 1: ly.error (_ ("LilyPond failed on input file %s (exit status %d)") % (files[0], exit_status)) - ly.exit (status) + lilypond_error_p = 1 + ly.exit (1) else: ly.error (_ ("LilyPond failed on an input file (exit status %d)") % exit_status) ly.error (_ ("Continuing...")) - global lilypond_error_p lilypond_error_p = 1 @@ -790,7 +794,6 @@ if 1: ### this should only catch lilypond nonzero exit status ### --hwn - # TODO: friendly message about LilyPond setup/failing? # targets = [] -- 2.39.5