]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/book_latex.py
Imported Upstream version 2.18.2
[lilypond.git] / python / book_latex.py
index a47c950e248152e2f01158880e58d52cab835265..a3b2b18b78907134b3b9c0e4035d473fc6f3d52a 100644 (file)
@@ -189,16 +189,18 @@ def get_latex_textwidth (source, global_options):
 
     progress (_ ("Running `%s' on file `%s' to detect default page settings.\n")
               % (global_options.latex_program, tmpfile))
-    cmd = 'TEXINPUTS="%s:$TEXINPUTS" %s %s' \
-        % (global_options.input_dir, global_options.latex_program, tmpfile)
+    cmd = '%s %s' % (global_options.latex_program, tmpfile)
     debug ("Executing: %s\n" % cmd)
     run_env = os.environ.copy()
     run_env['LC_ALL'] = 'C'
+    run_env['TEXINPUTS'] = '%s:%s' % \
+                           (global_options.input_dir, run_env.get('TEXINPUTS',""))
 
     ### unknown why this is necessary
     universal_newlines = True
     if sys.platform == 'mingw32':
         universal_newlines = False
+    if (sys.platform == 'mingw32') and (sys.version_info < (2, 6)):
         ### use os.system to avoid weird sleep() problems on
         ### GUB's python 2.4.2 on mingw
         # make file to write to