]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3874: lilypond-book: Fix TEXINPUTS environment manipulation on W32
authorDavid Kastrup <dak@gnu.org>
Fri, 4 Apr 2014 19:51:08 +0000 (21:51 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 5 Apr 2014 15:30:10 +0000 (17:30 +0200)
This transfers the TEXINPUTS manipulation into the mingw32 workaround
where it was not previously being done.

python/book_latex.py

index 22dc3a5f19540ef1d192c255b51b7f0f27da607b..ec5412b1d8192bee41e292e31bc62a78798cc45d 100644 (file)
@@ -207,7 +207,13 @@ def get_latex_textwidth (source, global_options):
         output_filename = os.path.join(output_dir, 'output.txt')
         # call command
         cmd += " > %s" % output_filename
+        oldtexinputs = os.environ.get ('TEXINPUTS')
+        os.environ['TEXINPUTS'] = run_env['TEXINPUTS']
         returncode = os.system(cmd)
+        if oldtexinputs:
+            os.environ['TEXINPUTS'] = oldtexinputs
+        else:
+            del os.environ['TEXINPUTS']
         parameter_string = open(output_filename).read()
         if returncode != 0:
             warning (_ ("Unable to auto-detect default settings:\n"))