[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Fixes meinproc/docbook can't handle paths with spaces (was:
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2007-12-19 22:43:06
Message-ID: 200712192343.10175 () erwin ! ingo-kloecker ! de
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


On Tuesday 18 December 2007, Alexander Neundorf wrote:
> On Tuesday 18 December 2007, Ingo Klöcker wrote:
> > FWIW, below you'll find the function that parses the result of
> > getenv("SGML_CATALOG_FILES"). The code is pretty straightforward
> > and it's obvious that nobody thought about spaces in a catalog's
> > path.
>
> Can you file a bug report for libxml ?

Instead of doing this I have converted the SGML catalogs in kdoctools to 
XML catalogs and made meinproc write the catalog paths (encoded as file 
URLs) to the environment variable XML_CATALOG_FILES.

Now kdelibs builds even if the source dir contains spaces.

Is it okay to commit this patch and to svn add the new XML catalogs (see 
attached tar ball)?


Regards,
Ingo

["meinproc.diff" (text/x-diff)]

Index: meinproc.cpp
===================================================================
--- meinproc.cpp	(revision 750721)
+++ meinproc.cpp	(working copy)
@@ -32,6 +32,7 @@
 #include <QtCore/QFileInfo>
 #include <kshell.h>
 #include <QtCore/QList>
+#include <QtCore/QUrl>
 
 class MyPair {
 public:
@@ -135,12 +136,12 @@
         QString pwd_buffer = QDir::currentPath();
         QFileInfo file( args->arg( 0 ) );
 
-        QString catalogs;
-        catalogs += KStandardDirs::locate( "dtd", "customization/catalog" );
+        QByteArray catalogs;
+        catalogs += QUrl::fromLocalFile( KStandardDirs::locate( "dtd", \
"customization/catalog.xml" ) ).toEncoded();  catalogs += ' ';
-        catalogs += KStandardDirs::locate( "dtd", \
"docbook/xml-dtd-4.1.2/docbook.cat" ); +        catalogs += QUrl::fromLocalFile( \
KStandardDirs::locate( "dtd", "docbook/xml-dtd-4.1.2/catalog.xml" ) ).toEncoded();  
-        setenv( "SGML_CATALOG_FILES", QFile::encodeName( catalogs ).constData(), 1);
+        setenv( "XML_CATALOG_FILES", catalogs.constData(), 1 );
         QString exe;
 #if defined( XMLLINT )
         exe = XMLLINT;
@@ -153,7 +154,7 @@
         if ( QFileInfo( exe ).isExecutable() ) {
             QDir::setCurrent( file.absolutePath() );
             QString cmd = exe;
-            cmd += " --catalogs --valid --noout ";
+            cmd += " --valid --noout ";
 #ifdef Q_OS_WIN
             cmd += file.fileName();
 #else


["xmlcatalogs.tar.bz2" (application/x-tbz)]
["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic