From ce76dd069678470da40ec46be2deec89de724eed Mon Sep 17 00:00:00 2001 From: hanwen Date: Wed, 22 Mar 2006 00:34:14 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 4 ++++ scripts/lilypond-book.py | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9e72da4972..77c4bd8fb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-22 Han-Wen Nienhuys + + * branch lilypond_2_8 + 2006-03-22 Han-Wen Nienhuys * scripts/lilypond-book.py (samefile): new function, for windoze diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 5acc2238bc..ea1f768a02 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1554,6 +1554,14 @@ def note_input_file (name, inputs=[]): inputs.append (name) return inputs +def samefile (f1, f2): + try: + return os.path.samefile (f1, f2) + except AttributeError: # Windoze + f1 = re.sub ("//*", "/", f1) + f2 = re.sub ("//*", "/", f2) + return f1 == f2 + def do_file (input_filename): # Ugh. if not input_filename or input_filename == '-': @@ -1590,7 +1598,7 @@ def do_file (input_filename): else: if os.path.exists (input_filename) \ and os.path.exists (output_filename) \ - and os.path.samefile (output_filename, input_fullname): + and samefile (output_filename, input_fullname): error ( _ ("Output would overwrite input file; use --output.")) exit (2) -- 2.39.5