On Fri, Dec 31, 2004 at 04:24:37PM +0000, Angus Leeming wrote:
> Angus Leeming wrote:
> > Sure. This means that the s/slashify_path/internal_path/ switch was less
> > carefully done that it needed to be. Mea culpa.
> > 
> > I'll try and come up with something in the next couple of hours.
> 
> Ok, Kayvan. The problem (I believe) lies in the call to 'MakeLatexName',
> below, which invokes 'AddName' which invokes 'os::internal_path'.

Okay, Angus. That almost fixes it. See the attached "first_try.patch"
file for a working adaptation of your idea.

Now lyx starts up.

However, the path fixing is not right for the Cygwin tetex. See below:

$ lyx --export pdf2 u04a1.lyx 
This is BibTeX, Version 0.99c (Web2C 7.4.5)
The top-level auxiliary file: u04a1.aux
The style file: apalike.bst
I couldn't open database file C:/cygwin/home/ksylvan/src/capella/TS3130/refs.bib
---line 31 of file u04a1.aux
 : \bibdata{C:/cygwin/home/ksylvan/src/capella/TS3130/refs
 :                                                        }
I'm skipping whatever remains of this command
I found no database files---while reading file u04a1.aux
Warning--I didn't find a database entry for "mannino04"
(There were 2 error messages)

Here, I added a hack which I would love to get rid of. The Cygwin tetex
does not like Win32 paths (and does not need them), so I changed
os_win32.C (external_path) adding a LYX_NO_CYGPATH_FIX environment variable
to skip changing the external path. See the attached "second_try.patch".

With this patch, I see:

$ lyx --export pdf2 u04a1.lyx 
This is BibTeX, Version 0.99c (Web2C 7.4.5)
The top-level auxiliary file: u04a1.aux
The style file: apalike.bst
Database file #1: /home/ksylvan/src/capella/TS3130/refs.bib

So, now, it all works for me.

I recommend that you apply first_try.patch and we come up with
a better way to do what I need for Cygwin's tetex. Any suggestions?

One idea would be a configure test which then sets a variable in
lyxrc.defaults which would be consulted by LyX to know whether or not
Win32 paths are needed for external paths.

Best regards,
                                ---Kayvan
-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
Index: src/support/os_win32.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
retrieving revision 1.17
diff -u -r1.17 os_win32.C
--- src/support/os_win32.C      2004/12/20 16:59:33     1.17
+++ src/support/os_win32.C      2004/12/31 20:39:00
@@ -147,17 +147,21 @@
 string internal_path(string const & p)
 {
 #ifdef __CYGWIN__
-       char pp[MAX_PATH];
+       char pp[MAX_PATH]; pp[0] = '\0';
        cygwin_conv_to_posix_path(p.c_str(), pp);
-       string const posix_path = MakeLatexName(pp);
+       lyxerr[Debug::DEPEND]
+               << "<Win32 path correction> ["
+               << p << "]->>["
+               << pp << ']' << endl;
+       return pp;
 #else
        string const posix_path = subst(p,"\\","/");
-#endif
        lyxerr[Debug::DEPEND]
                << "<Win32 path correction> ["
                << p << "]->>["
                << posix_path << ']' << endl;
        return posix_path;
+#endif
 }
 
 
@@ -187,13 +191,13 @@
 }
 
 
-string binpath()
+const string& binpath()
 {
        return binpath_;
 }
 
 
-string binname()
+const string& binname()
 {
        return binname_;
 }
@@ -205,7 +209,7 @@
 }
 
 
-string getTmpDir()
+const string& getTmpDir()
 {
        return tmpdir_;
 }
Index: src/support/os_win32.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
retrieving revision 1.17
diff -u -r1.17 os_win32.C
--- src/support/os_win32.C      2004/12/20 16:59:33     1.17
+++ src/support/os_win32.C      2004/12/31 20:46:31
@@ -115,10 +115,11 @@
 
 string external_path(string const & p)
 {
+       char const * const disable_cygwin_fixup = getenv("LYX_NO_CYGPATH_FIX");
        string dos_path;
 #ifdef __CYGWIN__
        // Translate from cygwin path syntax to dos path syntax
-       if (is_absolute_path(p)) {
+       if ((! disable_cygwin_fixup) && is_absolute_path(p)) {
                char dp[MAX_PATH];
                cygwin_conv_to_full_win32_path(p.c_str(), dp);
                dos_path = !dp ? "" : dp;
@@ -147,17 +148,21 @@
 string internal_path(string const & p)
 {
 #ifdef __CYGWIN__
-       char pp[MAX_PATH];
+       char pp[MAX_PATH]; pp[0] = '\0';
        cygwin_conv_to_posix_path(p.c_str(), pp);
-       string const posix_path = MakeLatexName(pp);
+       lyxerr[Debug::DEPEND]
+               << "<Win32 path correction> ["
+               << p << "]->>["
+               << pp << ']' << endl;
+       return pp;
 #else
        string const posix_path = subst(p,"\\","/");
-#endif
        lyxerr[Debug::DEPEND]
                << "<Win32 path correction> ["
                << p << "]->>["
                << posix_path << ']' << endl;
        return posix_path;
+#endif
 }
 
 
@@ -187,13 +192,13 @@
 }
 
 
-string binpath()
+const string& binpath()
 {
        return binpath_;
 }
 
 
-string binname()
+const string& binname()
 {
        return binname_;
 }
@@ -205,7 +210,7 @@
 }
 
 
-string getTmpDir()
+const string& getTmpDir()
 {
        return tmpdir_;
 }

Reply via email to