On Mon, Apr 17, 2006 at 03:30:36PM +0200, Georg Baum wrote:

> Am Samstag, 15. April 2006 19:47 schrieb Enrico Forestieri:
> > On Sat, Apr 15, 2006 at 06:54:56PM +0200, Georg Baum wrote:
> > I can't do that because it doesn't depend on cygwin or windows but
> > on miktex or tetex. If you use miktex SEP=';', if you use tetex SEP=':'.
> > I am attaching a revised patch taking into account your previous
> > counterexample, which now works.
> 
> But I still don't like it. The attached patch steals code from mktexlsr 
> (on which the original test was appareantly based). No need to reinvent 
> the wheel.
> If it works for you I am going to commit that.
> 
> This does still not support miktex with cygwin, but if you want that you 
> should pass an additional argument to TeXFiles.sh which tells what TeX 
> engine to use, based on the \cygwin_path_fix_needed configuration switch.

No need for that. I think that you gave me the right idea.
Please tell me if the attached patch is acceptable for you.

> > You are very right, but please admit that a ';' in a filename occurs
> > with a lower probability than a space in unix...
> 
> Yes. Your test is nevertheless a hack, and because of things like this I 
> wanted you to commit your stuff yourself. I am much less picky about 
> things others put in, but I am not going to commit anything with what I 
> do not agree 100%.

I understand that. Also, given that I tend to be "hackish", it is not a
good idea giving me commit privileges. It seems that I need a watchdog ;-)

-- 
Enrico
Index: lib/scripts/TeXFiles.sh
===================================================================
--- lib/scripts/TeXFiles.sh     (revision 13690)
+++ lib/scripts/TeXFiles.sh     (working copy)
@@ -41,15 +41,20 @@ types=$1
 test -z "$types" && types="cls sty bst bib"
 
 #
-# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use ';' to separate
-# directories in path lists whereas Unixes uses ':'.
-# $SEP holds the right character to be used by the scripts.
-#
-#???????????????
-# never used this one with windows and what happens with mac??
-#???????????????
-#
-if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi
+# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
+# directories in path lists whereas Unix uses `:'.  Make an exception for
+# Cygwin, where we could have either teTeX (using `:') or MikTeX (using `;').
+# Create a variable that holds the right character to be used by the scripts.
+DOSISH=no
+case `uname -s` in
+  CYGWIN*|Cygwin*|cygwin*)
+    # MikTeX's kpsewhich says "kpathsea emulation version x.x.x", whereas
+    # teTeX's simply "kpathsea version x.x.x".
+    KPATHSEA="`kpsewhich --version | sed 's/.*\(emulation\).*/\1/'`"
+    if test "$KPATHSEA" = "emulation"; then DOSISH=yes; fi ;;
+  *) if test -n "$COMSPEC" || test -n "$ComSpec"; then DOSISH=yes; fi
+esac
+if test "$DOSISH" = "no"; then SEP=':'; else SEP=';'; fi
 
 #
 # A copy of some stuff from mktex.opt, so we can run in the presence of

Reply via email to