>>>>> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:
Bennett> On Sep 7, 2004, at 8:18 AM, Jean-Marc Lasgouttes wrote:
>> The following patch should make Tools>Reconfigure work even when
>> LyX is in a directory like /My Applications/.
>>
>> Bennett, I would appreciate if you could try it. Remember to run
>> 'make' in the lib directory after applying it.
Bennett> It doesn't work: placing LyX in "~/Desktop/testing testing"
Bennett> and trying to reconfigure gives the following:
Bennett> sh: line 1: /Users/bennett/Desktop/testing: No such file or
Bennett> directory
It is even worse that I thought, and I am sure that many other things
are broken.
Please try the next version.
JMarc
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.622
diff -u -p -r1.622 ChangeLog
--- lib/ChangeLog 15 Aug 2004 20:59:44 -0000 1.622
+++ lib/ChangeLog 9 Sep 2004 14:52:03 -0000
@@ -1,3 +1,16 @@
+2004-09-07 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * configure.m4: instead of \input-ing the layout files directly in
+ latex, grep out the correct command from them; remove need for
+ \srcdir. This should fix the bug where latex configuration cannot
+ be done because LyX is installed in a directory which name
+ contains spaces.
+
+ * chkconfig.ltx: remove use of macro \srcdir
+ (\TestDocClass): change to take two arguments
+ (\DeclareLaTeXClass, \DeclareLinuxDocClass, \DeclareDocBookClass):
+ do not exit after execution
+
2004-08-15 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* Makefile.am (dist_lyx2lyx_DATA): fix entry for lyx2lyx/LyX.py
Index: lib/chkconfig.ltx
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/chkconfig.ltx,v
retrieving revision 1.13
diff -u -p -r1.13 chkconfig.ltx
--- lib/chkconfig.ltx 13 Oct 2003 09:50:08 -0000 1.13
+++ lib/chkconfig.ltx 9 Sep 2004 14:52:03 -0000
@@ -35,24 +35,16 @@
% we do not want to stop on errors
\nonstopmode\makeatletter
-% Have we been called from the configure script?
[EMAIL PROTECTED]
- {\message{%
-**** WARNING: For proper results, you should not run this script directly.^^J%
-**** Please use the `configure' script.^^J}
- \newcommand\srcdir{.}}
- [EMAIL PROTECTED]/}}}
%%% Some useful macros.
% Several commands are defined to test for packages:
% \AddLayout{<layout>} adds an entry for <layout> in textclass.lst
% \AddVariable{<name>}{<value>} creates a new variable chk_<name>,
% and gives it the value <value>.
-% \TestDocClass[<file>]{<name>} tests whether <name>.cls (or <file>,
-% if it is provided) exists and creates a new entry with
-% \AddLayout if this is the case. Note that you will probably not
-% need to use this directly, since the configure script generates
-% the needed macro calls automatically.
+% \TestDocClass{<name>}{<command>} if layout <name> has not already
+% been tested for, execute <command>. Note that you will
+% probably not need to use this directly, since the configure
+% script generates the needed macro calls automatically.
% \TestPackage[<file>]{<name>} tests whether <name>.sty (or <file>,
% if it is provided) exists.
% Both commands call \AddVariable to give value 'yes' or 'no' to
@@ -95,13 +87,10 @@
\fi}
\newcommand{\TestPackage}[2][\default]{
\TestItem[#1]{#2}{package}{sty}{\AddPackage{#2}}{}}
-\newcommand{\TestDocClass}[1]{
+\newcommand{\TestDocClass}[2]{
\def\layoutname{#1} % remember the name of the layout file
[EMAIL PROTECTED]@#1}
- {\bgroup
- \catcode`\#=9 % consider # as a space
- \input{layouts/#1.layout} % read the layout file
- \egroup
+ {#2 % execute the command
[EMAIL PROTECTED]@#1}{}}
{} % we have already tried this one.
}
@@ -109,7 +98,6 @@
\TestItem[#1]{\layoutname}{document class}{cls}
{\AddLayout[\firstelement]{\layoutname}{#2}{true}}
{\AddLayout[\firstelement]{\layoutname}{#2}{false}}
- \expandafter\endinput
}
\newcommand{\DeclareLinuxDocClass}[2][\default]{
\message{^^J\prefix checking for linuxdoc class \layoutname... }
@@ -118,7 +106,6 @@
\AddLayout[#1]{\layoutname}{#2}{false}}
{\message{yes^^J}
\AddLayout[#1]{\layoutname}{#2}{true}}
- \expandafter\endinput
}
% Only for compatibility. Will be removed later.
\let\DeclareSGMLClass=\DeclareDocBookClass
@@ -130,7 +117,6 @@
\AddLayout[#1]{\layoutname}{#2}{false}}
{\message{yes^^J}
\AddLayout[#1]{\layoutname}{#2}{true}}
- \expandafter\endinput
}
% Stolen from article.cls
Index: lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.80
diff -u -p -r1.80 configure.m4
--- lib/configure.m4 28 May 2004 07:14:55 -0000 1.80
+++ lib/configure.m4 9 Sep 2004 14:52:03 -0000
@@ -426,8 +426,8 @@ if test ${lyx_check_config} = no ; then
# for some reason. Run ./configure if you need to update it after a
# configuration change.
EOF
- # build the list of available layout files and convert it to commands
- # for chkconfig.ltx
+ # build the list of available layout files and convert it to entries
+ # for the default textclass.lst file
for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
case $file in
*/\*.layout) ;;
@@ -464,11 +464,14 @@ changequote(,)dnl
else
MSG_RESULT(auto)
rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
+ if ! test -r "chkconfig.ltx" ; then
+ ln -s ${srcdir}/chkconfig.ltx .
+ rmlink=true
+ fi
cat >wrap_chkconfig.ltx <<EOF
-\\newcommand\\srcdir{${srcdir}}
${linuxdoc_cmd}
${docbook_cmd}
-\\input{${srcdir}/chkconfig.ltx}
+\\input{chkconfig.ltx}
EOF
## Construct the list of classes to test for.
# build the list of available layout files and convert it to commands
@@ -476,14 +479,19 @@ EOF
for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
case $file in
*/\*.layout) ;;
- *) test -r "$file" && echo $file ;;
+ *) if test -r "$file" ; then
+ class=`echo $file | sed -e 's%^.*layouts/\(.*\)\.layout$%\1%'`
+ # Generate the proper TestDocClass command for this layout
+ grep '\\Declare\(LaTeX\|DocBook\|LinuxDoc\)Class' "$file" \
+ | sed -e 's/^\# *\(.*\)$/\\TestDocClass{'${class}'}{\1}/'
+ fi ;;
esac
- done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
- > chklayouts.tex
+ done > chklayouts.tex
changequote([,])dnl
[eval] ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
[eval] `cat chkconfig.vars | sed 's/-/_/g'`
changequote(,)dnl
+ test -n "${rmlink}" && rm -f chkconfig.ltx
fi
# Do we have all the files we need? Useful if latex did not run
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1977
diff -u -p -r1.1977 ChangeLog
--- src/ChangeLog 4 Sep 2004 12:13:48 -0000 1.1977
+++ src/ChangeLog 9 Sep 2004 14:52:05 -0000
@@ -1,3 +1,8 @@
+2004-09-09 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * lyx_cb.C (Reconfigure): quote the name of configure script in
+ case it contains spaces
+
2004-09-04 Lars Gullik Bjonnes <[EMAIL PROTECTED]>
* client: new dir
Index: src/lyx_cb.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
retrieving revision 1.241
diff -u -p -r1.241 lyx_cb.C
--- src/lyx_cb.C 16 Aug 2004 11:27:47 -0000 1.241
+++ src/lyx_cb.C 9 Sep 2004 14:52:05 -0000
@@ -62,6 +62,7 @@ using lyx::support::MakeDisplayPath;
using lyx::support::OnlyFilename;
using lyx::support::OnlyPath;
using lyx::support::Path;
+using lyx::support::QuoteName;
using lyx::support::removeAutosaveFile;
using lyx::support::rename;
using lyx::support::split;
@@ -446,7 +447,7 @@ void Reconfigure(BufferView * bv)
Path p(user_lyxdir());
Systemcall one;
one.startscript(Systemcall::Wait,
- AddName(system_lyxdir(), "configure"));
+ QuoteName(AddName(system_lyxdir(), "configure")));
p.pop();
bv->owner()->message(_("Reloading configuration..."));
lyxrc.read(LibFileSearch(string(), "lyxrc.defaults"));
Index: src/frontends/qt2/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.712
diff -u -p -r1.712 ChangeLog
--- src/frontends/qt2/ChangeLog 19 Aug 2004 06:30:43 -0000 1.712
+++ src/frontends/qt2/ChangeLog 9 Sep 2004 14:52:05 -0000
@@ -1,3 +1,8 @@
+2004-09-09 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * qfont_loader.C (addFontPath): quote the name of the font dir in
+ case it contains a space
+
2004-08-19 Georg Baum <[EMAIL PROTECTED]>
* BulletsModule.C (setBullet): use toqstr() for a string passed to
Index: src/frontends/qt2/qfont_loader.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qfont_loader.C,v
retrieving revision 1.49
diff -u -p -r1.49 qfont_loader.C
--- src/frontends/qt2/qfont_loader.C 20 May 2004 09:36:28 -0000 1.49
+++ src/frontends/qt2/qfont_loader.C 9 Sep 2004 14:52:05 -0000
@@ -36,6 +36,7 @@
using lyx::support::contains;
using lyx::support::LibFileSearch;
using lyx::support::OnlyPath;
+using lyx::support::QuoteName;
using lyx::support::Systemcall;
using std::endl;
@@ -63,7 +64,7 @@ void addFontPath()
return;
lyxerr[Debug::FONT] << "Adding " << dir
<< " to the font path." << endl;
- string const command = "xset fp+ " + dir;
+ string const command = "xset fp+ " + QuoteName(dir);
Systemcall s;
if (!s.startscript(Systemcall::Wait, command))
return;