On Wed, Jul 17, 2002 at 01:49:24PM +0100, Angus Leeming wrote:
> But I'm not going to delve deeply at the moment. Fancy having a go?

See attachment. 

[I don't like the 'extern' stuff, but it is used in othre places too, so I
guess it does not matter much]

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
Index: converter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v
retrieving revision 1.53
diff -u -p -r1.53 converter.C
--- converter.C 16 Jul 2002 21:17:08 -0000      1.53
+++ converter.C 17 Jul 2002 14:39:02 -0000
@@ -46,11 +46,14 @@ using std::find_if;
 using std::reverse;
 using std::sort;
 
+extern string system_lyxdir;
+
 namespace {
 
 string const token_from("$$i");
 string const token_base("$$b");
 string const token_to("$$o");
+string const token_lib("$$s");
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -624,15 +627,15 @@ bool Converters::convert(Buffer const * 
                                runLaTeX(buffer, latex_command_);
                        }
 
-                       string infile2 = (conv.original_dir)
+                       string const infile2 = (conv.original_dir)
                                ? infile : MakeRelPath(infile, path);
-                       string outfile2 = (conv.original_dir)
+                       string const outfile2 = (conv.original_dir)
                                ? outfile : MakeRelPath(outfile, path);
-
                        string command = conv.command;
                        command = subst(command, token_from, QuoteName(infile2));
                        command = subst(command, token_base, QuoteName(from_base));
                        command = subst(command, token_to, QuoteName(outfile2));
+                       command = subst(command, token_lib, system_lyxdir + "scripts");
 
                        if (!conv.parselog.empty())
                                command += " 2> " + QuoteName(infile2 + ".out");
Index: lyx_main.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.113
diff -u -p -r1.113 lyx_main.C
--- lyx_main.C  24 Jun 2002 20:28:00 -0000      1.113
+++ lyx_main.C  17 Jul 2002 14:39:02 -0000
@@ -240,7 +240,7 @@ void LyX::init(bool gui)
        // If we had a command line switch, system_lyxdir is already set
        string searchpath;
        if (!system_lyxdir.empty())
-               searchpath= MakeAbsPath(system_lyxdir) + ';';
+               searchpath = MakeAbsPath(system_lyxdir) + ';';
 
        // LYX_DIR_13x environment variable
        string const lyxdir = GetEnvPath("LYX_DIR_13x");
Index: graphics/GraphicsConverter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/GraphicsConverter.C,v
retrieving revision 1.10
diff -u -p -r1.10 GraphicsConverter.C
--- graphics/GraphicsConverter.C        15 Jul 2002 10:19:45 -0000      1.10
+++ graphics/GraphicsConverter.C        17 Jul 2002 14:39:02 -0000
@@ -28,6 +28,8 @@
 #include <fstream>
 #include <sys/types.h> // needed for pid_t
 
+extern string system_lyxdir;
+
 using std::endl;
 
 namespace grfx {
@@ -272,6 +274,7 @@ bool build_script(string const & from_fi
        string const token_from("$$i");
        string const token_base("$$b");
        string const token_to("$$o");
+       string const token_lib("$$s");
 
        EdgePath::const_iterator it  = edgepath.begin();
        EdgePath::const_iterator end = edgepath.end();
@@ -292,6 +295,7 @@ bool build_script(string const & from_fi
                command = subst(command, token_from, "${infile}");
                command = subst(command, token_base, "${infile_base}");
                command = subst(command, token_to,   "${outfile}");
+               command = subst(command, token_lib,  system_lyxdir + "scripts");
 
                // Store in the shell script
                script << "\n" << command << "\n\n";
Index: support/filetools.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/filetools.C,v
retrieving revision 1.128
diff -u -p -r1.128 filetools.C
--- support/filetools.C 16 Jul 2002 21:17:10 -0000      1.128
+++ support/filetools.C 17 Jul 2002 14:39:02 -0000
@@ -79,8 +79,6 @@ using std::getline;
 extern string system_lyxdir;
 extern string build_lyxdir;
 extern string user_lyxdir;
-extern string system_tempdir;
-extern string system_packageList;
 
 
 bool IsLyXFilename(string const & filename)

Reply via email to