|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62221 - trunk/tools/build/v2/tools
From: steven_at_[hidden]
Date: 2010-05-25 20:31:42
Author: steven_watanabe
Date: 2010-05-25 20:31:42 EDT (Tue, 25 May 2010)
New Revision: 62221
URL: http://svn.boost.org/trac/boost/changeset/62221
Log:
Try to adjust the paths in boostbook_catalog.xml to be correct, whether we're using a windows or cygwin build of xsltproc
Text files modified:
trunk/tools/build/v2/tools/boostbook.jam | 27 ++++++++++++++++++++++++---
trunk/tools/build/v2/tools/xsltproc.jam | 30 ++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 3 deletions(-)
Modified: trunk/tools/build/v2/tools/boostbook.jam
==============================================================================
--- trunk/tools/build/v2/tools/boostbook.jam (original)
+++ trunk/tools/build/v2/tools/boostbook.jam 2010-05-25 20:31:42 EDT (Tue, 25 May 2010)
@@ -315,6 +315,27 @@
xslt $(target) : $(source) $(stylesheet) : $(properties) ;
}
+rule format-catalog-path ( path )
+{
+ local result = $(path) ;
+ if [ xsltproc.is-cygwin ]
+ {
+ if [ os.name ] = NT
+ {
+ drive = [ MATCH ^/(.):(.*)$ : $(path) ] ;
+ result = /cygdrive/$(drive[1])$(drive[2]) ;
+ }
+ }
+ else
+ {
+ if [ os.name ] = CYGWIN
+ {
+ result = [ path.make $(path:W) ] ;
+ }
+ }
+ return [ regex.replace $(result) " " "%20" ] ;
+}
+
rule generate-xml-catalog ( target : sources * : properties * )
{
print.output $(target) ;
@@ -323,7 +344,7 @@
local boostbook-dtd-dir = [ boostbook.dtd-dir ] ;
if $(boostbook-dtd-dir)
{
- boostbook-dtd-dir = [ regex.replace $(boostbook-dtd-dir) " " "%20" ] ;
+ boostbook-dtd-dir = [ format-catalog-path $(boostbook-dtd-dir) ] ;
}
print.text
@@ -348,7 +369,7 @@
}
else
{
- docbook-xsl-dir = [ regex.replace $(docbook-xsl-dir) " " "%20" ] ;
+ docbook-xsl-dir = [ format-catalog-path $(docbook-xsl-dir) ] ;
print.text " <rewriteURI uriStartString=\"http://docbook.sourceforge.net/release/xsl/current/\" rewritePrefix=\"file://$(docbook-xsl-dir)/\"/>" ;
}
@@ -365,7 +386,7 @@
}
else
{
- docbook-dtd-dir = [ regex.replace $(docbook-dtd-dir) " " "%20" ] ;
+ docbook-dtd-dir = [ format-catalog-path $(docbook-dtd-dir) ] ;
print.text " <rewriteURI uriStartString=\"http://www.oasis-open.org/docbook/xml/4.2/\" rewritePrefix=\"file://$(docbook-dtd-dir)/\"/>" ;
}
Modified: trunk/tools/build/v2/tools/xsltproc.jam
==============================================================================
--- trunk/tools/build/v2/tools/xsltproc.jam (original)
+++ trunk/tools/build/v2/tools/xsltproc.jam 2010-05-25 20:31:42 EDT (Tue, 25 May 2010)
@@ -13,6 +13,9 @@
import regex ;
import sequence ;
import common ;
+import os ;
+import modules ;
+import path ;
feature.feature xsl:param : : free ;
feature.feature xsl:path : : free ;
@@ -33,9 +36,36 @@
{
$(.initialized) = true ;
.xsltproc = $(xsltproc) ;
+ .is-cygwin = [ .is-cygwin $(xsltproc) ] ;
}
}
+# Returns a non-empty string if a cygwin xsltproc binary was specified.
+rule is-cygwin ( )
+{
+ return $(.is-cygwin) ;
+}
+
+rule .is-cygwin ( xsltproc )
+{
+ if [ os.on-windows ]
+ {
+ local file = [ path.make [ modules.binding $(__name__) ] ] ;
+ local dir = [ path.native
+ [ path.join [ path.parent $(file) ] xsltproc ] ] ;
+ if [ os.name ] = CYGWIN
+ {
+ cygdir = $(dir:W) ;
+ }
+ local command =
+ "\"$(xsltproc)\" \"$(dir)\\test.xsl\" \"$(dir)\\test.xml\" 2>&1" ;
+ local status = [ SHELL $(command) : no-output : exit-status ] ;
+ if $(status[2]) != "0"
+ {
+ return true ;
+ }
+ }
+}
rule compute-xslt-flags ( target : properties * )
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk