From eeb1a304e261eb785d07594794a25bbcdbf0f286 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 4 Oct 2001 09:57:02 +0000 Subject: [PATCH] win32 port updates git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2840 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/ChangeLog | 6 ++++++ development/Win32/lyxprofile | 28 ++++++++++++++------------- development/Win32/lyxwin32.C | 32 ------------------------------- development/Win32/lyxwin32.c | 37 ++++++++++++++++++++++++++++++++++++ src/ChangeLog | 4 ++++ src/lyx_cb.C | 4 ++-- src/support/ChangeLog | 9 +++++++++ src/support/os.h | 6 +++++- src/support/os_os2.C | 4 ++++ src/support/os_unix.C | 3 +++ src/support/os_win32.C | 17 ++++++++++++++++- 11 files changed, 101 insertions(+), 49 deletions(-) delete mode 100644 development/Win32/lyxwin32.C create mode 100644 development/Win32/lyxwin32.c diff --git a/development/ChangeLog b/development/ChangeLog index c99048afc8..03c7d3c0a6 100644 --- a/development/ChangeLog +++ b/development/ChangeLog @@ -1,3 +1,9 @@ +2001-07-02 Claus Hentschel + + * Win32/lyxwin32.c: renamed from lyxwin32.C + + * Win32/lyxprofile: update + 2001-09-21 Kayvan A. Sylvan * lyx.spec.in: last cleanup diff --git a/development/Win32/lyxprofile b/development/Win32/lyxprofile index 9bfa4a8a1f..0a64a188b2 100644 --- a/development/Win32/lyxprofile +++ b/development/Win32/lyxprofile @@ -1,27 +1,29 @@ -PATH="/usr/local/lyx/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin:$PATH" +# Set up your home directory (in Cygwin syntax) +export HOME="//x/YourHomeDirectory" + +# Set up your Language (if you do not want English) +# export LANG=DE + +# ======================================================== +# Below this line you should not change anything if you're +# not familiar with configuration of an unix application! +# ======================================================== +export PATH="/usr/bin:/usr/local/bin:/usr/X11R6/bin:/bin:$PATH" +export USER="`id -un`" +export DISPLAY=127.0.0.1:0.0 +export MAKE_MODE=unix + unset DOSDRIVE unset DOSDIR unset TMPDIR unset TMP -USER="`id -un`" - -# Set up USER's home directory; no spaces allowed in the path! -export HOME=//c/Docs/Lyx - -export USER PATH - for i in /etc/profile.d/*.sh ; do if [ -f $i ]; then . $i fi done -export DISPLAY=localhost:0 - -export MAKE_MODE=unix - - cd "$HOME" test -f ./.bashrc && . ./.bashrc diff --git a/development/Win32/lyxwin32.C b/development/Win32/lyxwin32.C deleted file mode 100644 index e479ef55ba..0000000000 --- a/development/Win32/lyxwin32.C +++ /dev/null @@ -1,32 +0,0 @@ -#include /* standard io library */ -#include /* standard library */ -#include /* sleep , fork & exec */ -#include /* standard string library */ -#include - -int main ( int argc, char *argv[] ) -{ -/*char cmd [32000] = "lyx " ; */ /* user command */ -char cmd [32000] = "lyx " ; -char *nargs [4 ] = { "/bin/bash", "-c" , cmd , NULL } ; /* execute with login /bin/bash */ -int i=1; - -putenv ( "BASH_ENV=/etc/lyxprofile" ) ; /* ensure bash reads my global env changes */ - -while ( i < argc ) /* do for all "real" args */ - { - strcat ( cmd , "\"" ) ; /* add quote before */ - strcat ( cmd , argv [ i ] ) ; /* add the argument */ - strcat ( cmd , "\" " ) ; /* add closing quote */ - i ++ ; - } - -strcat ( cmd, "/dev/null"); - -fprintf ( stderr , "Command is: |%s|\n" , cmd ); -execv ( "/bin/bash" , nargs ) ; /* exec sub command */ - -/* we should never reach here */ -fprintf ( stderr , "Execute failed, error = %d\n" , errno ) ; -return ( 0 ) ; /* exit with no error */ -} diff --git a/development/Win32/lyxwin32.c b/development/Win32/lyxwin32.c new file mode 100644 index 0000000000..404f2cff46 --- /dev/null +++ b/development/Win32/lyxwin32.c @@ -0,0 +1,37 @@ +#include /* standard io library */ +#include /* standard library */ +#include /* sleep , fork & exec */ +#include /* standard string library */ +#include + +int main ( int argc, char *argv[] ) +{ + char cmd [32000] = "lyx " ; /* user command */ + char *nargs [4 ] = { /* execute with login /bin/bash */ + "/bin/bash", + "-c" , cmd , + NULL + } ; + int i = 1; /* just to count */ + + /* ensure bash reads my global env changes */ + putenv ( "BASH_ENV=/etc/lyxprofile" ) ; + + /* do for all "real" args */ + while ( i < argc ) + { + strcat ( cmd , "\"" ) ; /* add quote before */ + strcat ( cmd , argv [ i ] ) ; /* add the argument */ + strcat ( cmd , "\" " ) ; /* add closing quote */ + i ++ ; + } + + strcat ( cmd, "/dev/null"); + + fprintf ( stderr , "Command is: |%s|\n" , cmd ); + execv ( "/bin/bash" , nargs ) ; /* exec sub command */ + + /* Oops: we should never reach here */ + perror ( "Execute failed") ; + return ( 1 ) ; /* exit with an error */ +} diff --git a/src/ChangeLog b/src/ChangeLog index 34333b1f42..bb7381986d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-10-03 Garst Reese + + * lyx_cb.C: fhange CheckTex error msg. + 2001-10-03 José Matos * buffer.C (simpleDocBookOnePar): add support for pass_thru. diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 75da0511a5..4d5787a354 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -263,11 +263,11 @@ int MenuRunChktex(Buffer * buffer) s = _("No warnings found."); } else if (ret == 1) { s = _("One warning found."); - t = _("Use 'Edit->Go to Error' to find it."); + t = _("Use `Navigate->Error' to find it."); } else { s += tostr(ret); s += _(" warnings found."); - t = _("Use 'Edit->Go to Error' to find them."); + t = _("Use `Navigate->Error' to find them."); } WriteAlert(_("Chktex run successfully"), s, t); } else { diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 351bd43e0a..ced558adac 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,12 @@ +2001-07-02 Claus Hentschel + + * os_win32.C: + * os_unix.C: + * os_os2.C: + * os.h: add internal_path method, which converts a unix-type file + name to the type known to the underlying file system (currently + only useful on cygwin) [from Ruurd A. Reitsma and Claus Hentschel] + 2001-08-18 Lars Gullik Bjønnes * smart_ptr.h: new file diff --git a/src/support/os.h b/src/support/os.h index 7abe2d0a4d..3f947734eb 100644 --- a/src/support/os.h +++ b/src/support/os.h @@ -45,14 +45,18 @@ public: // no-op on UNIX, '\\'->'/' on OS/2 and Win32, ':'->'/' on MacOS, etc. static string slashify_path(string p); + // converts a host OS path to unix style static string external_path(string p); + // converts a unix path to host OS style + static string internal_path(string p); static void warn(string mesg); private: static string binpath_; static string binname_; static string tmpdir_; static os::shell_type _shell; - static unsigned long cp_; // Used only on OS/2 to determine file system encoding. + // Used only on OS/2 to determine file system encoding. + static unsigned long cp_; // Never initialize static variables in the header! // Anyway I bet this class will never be constructed. diff --git a/src/support/os_os2.C b/src/support/os_os2.C index fd79f697a9..358d487eb0 100644 --- a/src/support/os_os2.C +++ b/src/support/os_os2.C @@ -158,3 +158,7 @@ string os::slashify_path(string p) { string os::external_path(string p) { return p; } + +string os::internal_path(string p) { + return p; +} diff --git a/src/support/os_unix.C b/src/support/os_unix.C index 19b8fa88ae..02da66050a 100644 --- a/src/support/os_unix.C +++ b/src/support/os_unix.C @@ -68,3 +68,6 @@ string os::external_path(string p) { return p; } +string os::internal_path(string p) { + return p; +} diff --git a/src/support/os_win32.C b/src/support/os_win32.C index 73abf6ef2d..a248f04a97 100644 --- a/src/support/os_win32.C +++ b/src/support/os_win32.C @@ -80,4 +80,19 @@ string os::external_path(string p) { << p << "]->>[" << dos_path << "]" << endl; return dos_path; -} \ No newline at end of file +} + +// (Claus H.) Parsing the latex log file in an Win32 environment all +// files are mentioned in Win32/DOS syntax. Because LyX uses the dep file +// entries to check if any file has been changed we must retranslate +// the Win32/DOS pathnames into Cygwin pathnames. +string os::internal_path(string p) { + char pp[256]; + cygwin_conv_to_posix_path(p.c_str(), pp); + string const posix_path = MakeLatexName(pp); + lyxerr[Debug::DEPEND] + << " [" + << p << "]->>[" + << posix_path << "]" << endl; + return posix_path; +}