From d90e61afb82b40fcaf795ce76dc83f08e18b0573 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 13 Jul 2005 08:07:48 +0000 Subject: [PATCH] Applied Yoshinobu Ishizaki's patch. --- ChangeLog | 9 +++++++++ THANKS | 1 + scripts/lilypond-book.py | 17 +++++++++-------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21fb99d8bb..03677cc680 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-07-13 Yoshinobu Isizaki + + * scripts/lilypond-book.py: Prevent occuring error when + 'lilypond-book --output=foo/ somefile.ly' is executed multiple + times and target file shoud be overwritten. (Error message said + 'input file and output file is same'.) + 2005-07-13 Graham Percival * input/regression/slur-extreme.ly, input/regression/slur-scoring.ly, @@ -7,6 +14,8 @@ * Documentation/user/converters.itely: fix URL for Noteedit and Rosegarden. + * THANKS: added Yoshinobu Isizaki. + 2005-07-12 Han-Wen Nienhuys * scm/define-markup-commands.scm (justify-field): add. diff --git a/THANKS b/THANKS index 4712da10e6..7f59ec951b 100644 --- a/THANKS +++ b/THANKS @@ -12,6 +12,7 @@ Graham Percival - Documentation Editor CONTRIBUTORS Joe Neeman +Yoshinobu Ishizaki SPONSORS diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 9ca2640b05..c21f0e3f53 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1428,18 +1428,19 @@ def do_file (input_filename): output_filename = '-' output_file = sys.stdout else: + # don't complain when output_name is existing + output_filename = input_base + format2ext[format] if output_name: if not os.path.isdir (output_name): os.mkdir (output_name, 0777) os.chdir (output_name) - - output_filename = input_base + format2ext[format] - if os.path.exists (input_filename) \ - and os.path.exists (output_filename) \ - and os.path.samefile (output_filename, input_fullname): - ly.error ( - _ ("Output would overwrite input file; use --output.")) - ly.exit (2) + else: + if os.path.exists (input_filename) \ + and os.path.exists (output_filename) \ + and os.path.samefile (output_filename, input_fullname): + ly.error ( + _ ("Output would overwrite input file; use --output.")) + ly.exit (2) try: ly.progress (_ ("Reading %s...") % input_fullname) -- 2.39.5