X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Flilypond-book.py;h=8dea1fc1a795623d446582a690a4c625f9918f18;hb=8848da24e00c75d7de626b2ecc409fb45e87ce4a;hp=1e0f7abf661d9ede9773e81d1277fdd91f6c57d7;hpb=5e3f01b8ce09646a55838687ba4f1f38e2989afb;p=lilypond.git diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 1e0f7abf66..8dea1fc1a7 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -277,6 +277,11 @@ if 'bindir' in globals () and bindir: if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary): lilypond_binary = 'lilypond' +# Need to shell-quote, issue 3468 + +import pipes +lilypond_binary = pipes.quote (lilypond_binary) + global_options = None @@ -438,7 +443,10 @@ def split_output_files(directory): Return value is a set of strings. """ files = [] - for subdir in glob.glob (os.path.join (directory, '[a-f0-9][a-f0-9]')): + def globquote(x): + return re.sub ("[][*?]", r"[\g<0>]", x) + for subdir in glob.glob (os.path.join (globquote (directory), + '[a-f0-9][a-f0-9]')): base_subdir = os.path.split (subdir)[1] sub_files = [os.path.join (base_subdir, name) for name in os.listdir (subdir)] @@ -544,10 +552,12 @@ def do_file (input_filename, included=False): in_handle = file (input_fullname) if input_filename == '-': + global_options.input_dir = os.getcwd () input_base = 'stdin' elif included: input_base = os.path.splitext (input_filename)[0] else: + global_options.input_dir = os.path.split (input_absname)[0] input_base = os.path.basename ( os.path.splitext (input_filename)[0]) @@ -651,7 +661,7 @@ def do_options (): nr = 0 for i in global_options.custom_packages: nr += 1 - print imp.load_source ("book_custom_package%s" % nr, i) + progress (str(imp.load_source ("book_custom_package%s" % nr, i))) if global_options.warranty: