On Fri, Feb 17, 2012 at 04:49:58PM +0100, Pavel Sanda wrote:
> Waluyo Adi Siswanto wrote:
> > I have found the cause. It could be a bug?
> > ANY file using SPACE in its filename will fail to export archive.
> > I tried in Ubuntu 11.10 and Windows 7, both fail.
>
> Yes, the problem is due to spacing in path. Enrico may know whether
> is it easy to fix..
The lyxpak.py script has no problem with spaces in filenames. It is LyX
that is passing a mangled filename. Specifically, LyX calls lyxpak.py
using the mangled name meant for latex processing in the temporary dir.
The attached patch fixes the problem for me.
--
Enrico
Index: src/Converter.cpp
===================================================================
--- src/Converter.cpp (revisione 40771)
+++ src/Converter.cpp (copia locale)
@@ -50,6 +50,7 @@ string const token_base("$$b");
string const token_to("$$o");
string const token_path("$$p");
string const token_orig_path("$$r");
+string const token_orig_from("$$f");
string const token_encoding("$$e");
string const token_latex_encoding("$$E");
@@ -412,6 +413,7 @@ bool Converters::convert(Buffer const *
command = subst(command, token_to, quoteName(outfile2));
command = subst(command, token_path,
quoteName(onlyPath(infile.absFileName())));
command = subst(command, token_orig_path,
quoteName(onlyPath(orig_from.absFileName())));
+ command = subst(command, token_orig_from,
quoteName(onlyFileName(orig_from.absFileName())));
command = subst(command, token_encoding, buffer ?
buffer->params().encoding().iconvName() : string());
command = libScriptSearch(command);
Index: lib/configure.py
===================================================================
--- lib/configure.py (revisione 40771)
+++ lib/configure.py (copia locale)
@@ -920,7 +920,7 @@ def checkConverterEntries():
# Currently, lyxpak outputs a gzip compressed tar archive on *nix
# and a zip archive on Windows.
# So, we configure the appropriate version according to the platform.
- cmd = r'\converter lyx %s "python -tt $$s/scripts/lyxpak.py $$r/$$i" ""'
+ cmd = r'\converter lyx %s "python -tt $$s/scripts/lyxpak.py $$r/$$f" ""'
if os.name == 'nt':
addToRC(r'\Format lyxzip zip "LyX Archive (zip)" "" "" ""
"document,menu=export"')
addToRC(cmd % "lyxzip")