]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
UserGuide.lyx: adopt Martins Changes in r21531 to the doc style and the other maintai...
[lyx.git] / lib / configure.py
index 196bfc13dd229ca4b064213dddcb3ad2bfaaa507..210aad99b74ded4c40c79db60b90885ef4578bfe 100644 (file)
@@ -158,17 +158,19 @@ def checkProg(description, progs, rc_entry = [], path = [], not_found = ''):
         ac_word = ac_prog.split(' ')[0]
         print '+checking for "' + ac_word + '"... ',
         path = os.environ["PATH"].split(os.pathsep) + path
+        extlist = ['']
+        if os.environ.has_key("PATHEXT"):
+            extlist = extlist + os.environ["PATHEXT"].split(os.pathsep)
         for ac_dir in path:
-            # check both ac_word and ac_word.exe (for windows system)
-            if os.path.isfile( os.path.join(ac_dir, ac_word) ) or \
-                os.path.isfile( os.path.join(ac_dir, ac_word + ".exe") ):
-                print ' yes'
-                # write rc entries for this command
-                if len(rc_entry) == 1:
-                    addToRC(rc_entry[0].replace('%%', ac_prog))
-                elif len(rc_entry) > 1:
-                    addToRC(rc_entry[idx].replace('%%', ac_prog))
-                return [ac_dir, ac_word]
+            for ext in extlist:
+                if os.path.isfile( os.path.join(ac_dir, ac_word + ext) ):
+                    print ' yes'
+                    # write rc entries for this command
+                    if len(rc_entry) == 1:
+                        addToRC(rc_entry[0].replace('%%', ac_prog))
+                    elif len(rc_entry) > 1:
+                        addToRC(rc_entry[idx].replace('%%', ac_prog))
+                    return [ac_dir, ac_word]
         # if not successful
         print ' no'
     # write rc entries for 'not found'
@@ -202,7 +204,7 @@ def checkLatex(dtl_tools):
 \converter dvi2       dvi        "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""'''
     else:
         converter_entry = r'\converter latex      dvi        "%%"      "latex"'
-    path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', "platex", 'latex $$i', 'latex2e $$i'],
+    path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', 'platex $$i', 'latex $$i', 'latex2e $$i'],
         rc_entry = [converter_entry])
     # no latex
     if LATEX != '':