--nextPart1358117.MDPzXVtxnL Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 17 December 2007, Ingo Kl=F6cker wrote: > On Monday 17 December 2007, Alexander Neundorf wrote: > > On Monday 17 December 2007, Andreas Pakulat wrote: > > > On 17.12.07 21:12:28, Alexander Neundorf wrote: > > > > currently kdelibs doesn't build if the source dir contains > > > > spaces: man-checkXML.1.docbook:4: warning: failed to load > > > > external entity "dtd/kdex.dtd" > > > > > > > > strace says the following: > > > > stat64("/home/alex/src/kde4-svn/KDE", 0xbfcf68ec) =3D -1 ENOENT > > > > (No such file or directory) > > > > stat64("dir/kdelibs/kdoctools/customization/catalog", > > > > 0xbfcf68ec) =3D -1 ENOENT (No such file or directory) > > > > > > > > This is obviously wrong and should be: > > > > stat64("/home/alex/src/kde4-svn/KDE\ > > > > dir/kdelibs/kdoctools/customization/catalog", ... ) > > > > > > > > So, is libxml actually able to deal with paths which contains > > > > spaces ? Or are we just forgetting somewhere to escape some > > > > paths ? > > > > > > > > (libxml docs seem to say that separators are the colon and > > > > spaces, which doesn't sound good...) > > > > > > That would be really bad, however calling xmllint with a file > > > that lies in a dir with spaces works fine. So hopefully its just > > > some CMake-part that doesn't quote properly. > > > > My mail was too short. > > Here are the results from running it manually: > > kdelibs-cmake-HEAD/doc/kbuildsycoca4$ ../../bin/meinproc4 > > --stylesheet /home/alex/src/kde4-svn/KDE\ > > dir/kdelibs/kdoctools/docbook/xsl/manpages/docbook.xsl --check > > --srcdir=3D/home/alex/src/kde4-svn/KDE\ dir/kdelibs/kdoctools/ > > /home/alex/src/kde4-svn/KDE\ > > dir/kdelibs/doc/kbuildsycoca4/man-kbuildsycoca4.8.docbook > > meinproc4(27435) KLocalePrivate::initFormat: > > KLocalePrivate::KLocalePrivate -- srcdir=3D > > -/home/alex/src/kde4-svn/KDE dir/kdelibs/kdoctools- > > man-kbuildsycoca4.8.docbook:4: warning: failed to load external > > entity "dtd/kdex.dtd" > > ]> > > ^ > > man-kbuildsycoca4.8.docbook:6: validity error : Validation failed: > > no DTD found ! > > > > > > > > This is the command as it is executed when building. As you can see > > the spaces are escaped with backslashes. > > Now I replaced them with double quotes: > > > > kdelibs-cmake-HEAD/doc/kbuildsycoca4$ ../../bin/meinproc4 > > --stylesheet "/home/alex/src/kde4-svn/KDE > > dir/kdelibs/kdoctools/docbook/xsl/manpages/docbook.xsl" --check > > --srcdir=3D"/home/alex/src/kde4-svn/KDE dir/kdelibs/kdoctools/" > > "/home/alex/src/kde4-svn/KDE > > dir/kdelibs/doc/kbuildsycoca4/man-kbuildsycoca4.8.docbook" > > meinproc4(27458) KLocalePrivate::initFormat: > > KLocalePrivate::KLocalePrivate -- srcdir=3D > > -/home/alex/src/kde4-svn/KDE dir/kdelibs/kdoctools- > > man-kbuildsycoca4.8.docbook:4: warning: failed to load external > > entity "dtd/kdex.dtd" > > ]> > > ^ > > man-kbuildsycoca4.8.docbook:6: validity error : Validation failed: > > no DTD found ! > > > > ^ > > man-kbuildsycoca4.8.docbook:9: parser error : Entity 'kde' not > > defined &kde; User's Manual > > > > > > The strace output was in my first mail. > > > > Actually it is already one month ago when I found that, and I sent > > an email to kdelibs-bugs then, so the details are not completely > > fresh. But I think somewhere in libxml the arguments are parsed and > > escaping space isn't supported. Can somebody confirm this ? > > The following code-snippet in meinproc.cpp looks highly suspicious to > me: > =3D=3D=3D=3D=3D > QString catalogs; > catalogs +=3D > KStandardDirs::locate( "dtd", "customization/catalog" ); > catalogs +=3D ' '; > catalogs +=3D > KStandardDirs::locate( "dtd", "docbook/xml-dtd-4.1.2/docbook.cat" ); > > setenv( "SGML_CATALOG_FILES", QFile::encodeName( > catalogs ).constData(), 1); > =3D=3D=3D=3D=3D > > I haven't verified, but it seems the spaces in the return value of > KStandardDirs::locate() are not escaped and thus an incorrect value > is put into SGML_CATALOG_FILES. So the bug is obviously in > meinproc.cpp and not in libxml. > > Maybe > > catalogs +=3D KShell::quoteArg( > KStandardDirs::locate( "dtd", "customization/catalog" ) ); > catalogs +=3D ' '; > catalogs +=3D KShell::quoteArg( > KStandardDirs::locate( "dtd", "docbook/xml-dtd-4.1.2/docbook.cat" ) > ); > > fixes the problem, but that's just a wild guess. No. That leads to [pid 28837] stat("\'/home/ingo/svn/kde/branches/work/new",=20 0x7fff16a1a0f0) =3D -1 ENOENT (No such file or directory) [pid 28837] stat("ssl/kdelibs/kdoctools/customization/catalog\'",=20 0x7fff16a1a0f0) =3D -1 ENOENT (No such file or directory) i.e. xmllint escapes the single quotes around the filename. Same procedure with double quotes: stat("\"/home/ingo/svn/kde/branches/work/new", 0x7fffd7d2f390) =3D -1=20 ENOENT (No such file or directory) stat("ssl/kdelibs/kdoctools/customization/catalog\"", 0x7fffd7d2f390)=20 =3D -1 ENOENT (No such file or directory) And escaping the spaces in the catalog names with a backslash also does=20 not work: stat("/home/ingo/svn/kde/branches/work/new\\", 0x7fff0ecaa310) =3D -1=20 ENOENT (No such file or directory) stat("ssl/kdelibs/kdoctools/customization/catalog", 0x7fff0ecaa310) =3D -1= =20 ENOENT (No such file or directory) Again the backslash is escaped again. Conclusion: =2D meinproc4 did not quote the catalog names correctly before putting=20 them in the environment variable. =2D xmllint does not seem to be able to extract catalog names containing=20 spaces correctly from the environment variable no matter how they are=20 escaped. Regards, Ingo --nextPart1358117.MDPzXVtxnL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQBHZwNOGnR+RTDgudgRArFNAJ49hUtAYthGv9BzGFOjYa+aIx3plACg0vVa Cbb8KhASeDhL9iiih14gVUM= =IB4o -----END PGP SIGNATURE----- --nextPart1358117.MDPzXVtxnL--