On Thu, Mar 30, 2006 at 09:46:57PM +0200, Enrico Forestieri wrote:

> Please, attached find a patch correcting this problems.

I forgot to attach the patch.

-- 
Enrico
--- configure.py.orig   Thu Mar 30 12:58:18 2006
+++ configure.py        Thu Mar 30 21:27:14 2006
@@ -33,7 +33,7 @@
 
 def removeFiles(filenames):
   '''utility function: 'rm -f'
-    ignore erroes when file does not exist, or is a directory.
+    ignore errors when file does not exist, or is a directory.
   '''
   for file in filenames:
     try:
@@ -78,7 +78,7 @@
         sys.exit(1)
 
 
-def checkCygwinPath():
+def checkCygwinPath(srcdir):
   ''' Adjust PATH for Win32 (Cygwin) '''
   if sys.platform == 'cygwin':
     from tempfile import mkstemp
@@ -88,19 +88,23 @@
 \begin{document}\end{document}
   ''')
     os.close(fd)
-    inpname = cmdOutput('cygpath -w ' + tmpfname).replace('\\', '/')
+    inpname = cmdOutput('cygpath -m ' + tmpfname)
     # a wrapper file
     wfd, wtmpfname = mkstemp(suffix='.ltx')
+    wtmpfname = cmdOutput('cygpath -m ' + wtmpfname)
     os.write(wfd, r'\input{' + inpname + '}' )
     os.close(wfd)
     if cmdOutput('latex ' + wtmpfname).find('Error') != -1:
+      print "configure: cygwin detected; path correction is not needed"
+    else:
       print "configure: cygwin detected; path correction"
-      srcdir = cmdOutput('cygpath -w ' + srcdir).replace(r'\\', '')
+      srcdir = cmdOutput('cygpath -m ' + srcdir)
       print "srcdir = ", srcdir
       addToRC(r'\cygwin_path_fix_needed true')
-    else:
-      print "configure: cygwin detected; path correction is not needed"
-    removeFiles( [ tmpfname, wtmpfname ])
+    tmpbname,ext = os.path.splitext(os.path.basename(tmpfname))
+    wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname))
+    removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \
+           tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] )
 
 
 ## Searching some useful programs
@@ -672,7 +676,7 @@
     sys.exit(1)
   setEnviron()
   createDirectories()
-  checkCygwinPath()
+  checkCygwinPath(srcdir)
   ## Write the first part of outfile
   writeToFile(outfile, '''# This file has been automatically generated by LyX' 
lib/configure.py
 # script. It contains default settings that have been determined by

Reply via email to