config_host.mk.in                   |    1 +
 configure.ac                        |    4 ++++
 writerfilter/CustomTarget_source.mk |   13 +++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit f8bed01825a72c906c320cd41751db35ff6d5b89
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Sat Aug 16 17:33:42 2014 +0200

    writerfilter: abort build if model.xml does not validate
    
    Most of the scripts parsing model.xml just load it as a DOM and extract
    info from it needed for their task, which means if you have a typo in an
    element / attribute name, it's just silently ignored.
    
    This is annoying, let's prevent that by validating the model before
    doing anything with it.
    
    Change-Id: I4229e57c12840fead62cbd150dd1408f2f0d29eb

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 1ac643c..6e751c0 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -13,6 +13,7 @@ writerfilter_WORK := $(call 
gb_CustomTarget_get_workdir,writerfilter/source)
 writerfilter_SRC := $(SRCDIR)/writerfilter/source
 
 writerfilter_PYTHONCOMMAND := $(call gb_ExternalExecutable_get_command,python)
+writerfilter_XMLLINTCOMMAND := $(call 
gb_ExternalExecutable_get_command,xmllint)
 
 writerfilter_OOXMLNAMESPACES= \
        dml-baseStylesheet \
@@ -51,6 +52,7 @@ writerfilter_ALL = \
        $(writerfilter_GEN_ooxml_NamespaceIds_hxx) \
        $(writerfilter_GEN_ooxml_QNameToStr_cxx) \
        $(writerfilter_GEN_ooxml_ResourceIds_hxx) \
+       $(writerfilter_GEN_ooxml_Model_validated) \
        $(writerfilter_GEN_ooxml_Model_processed) \
        $(patsubst 
%,$(writerfilter_WORK)/ooxml/OOXMLFactory_%.hxx,$(writerfilter_OOXMLNAMESPACES))
 \
        $(patsubst 
%,$(writerfilter_WORK)/ooxml/OOXMLFactory_%.cxx,$(writerfilter_OOXMLNAMESPACES))
 \
@@ -59,6 +61,7 @@ writerfilter_DEP_ooxml_Namespaces_txt=$(call 
gb_CustomTarget_get_workdir,oox/gen
 
writerfilter_GEN_ooxml_FactoryValues_hxx=$(writerfilter_WORK)/ooxml/OOXMLFactory_values.hxx
 
writerfilter_GEN_ooxml_Factory_cxx=$(writerfilter_WORK)/ooxml/OOXMLFactory_generated.cxx
 
writerfilter_GEN_ooxml_Factory_hxx=$(writerfilter_WORK)/ooxml/OOXMLFactory_generated.hxx
+writerfilter_GEN_ooxml_Model_validated=$(writerfilter_WORK)/ooxml/model.validated
 
writerfilter_GEN_ooxml_Model_processed=$(writerfilter_WORK)/ooxml/model_preprocessed.xml
 
writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespaceids.hxx
 writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
@@ -76,7 +79,13 @@ $(writerfilter_GEN_ooxml_Factory_hxx) : 
$(writerfilter_SRC)/ooxml/factoryinc.py
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
        $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $< 
$(writerfilter_GEN_ooxml_Model_processed)) > $@
 
-$(writerfilter_GEN_ooxml_Model_processed) : 
$(writerfilter_SRC_ooxml_Preprocess_py) 
$(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model) | 
$(writerfilter_WORK)/ooxml/.dir
+$(writerfilter_GEN_ooxml_Model_validated) : $(writerfilter_SRC_ooxml_Model)
+       $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,VAL,1)
+       $(call gb_Helper_abbreviate_dirs,\
+               $(writerfilter_XMLLINTCOMMAND) --noout --relaxng 
$(writerfilter_SRC)/../documentation/ooxml/model.rng 
$(writerfilter_SRC_ooxml_Model) > $@ 2>&1 \
+               || (cat $@; false))
+
+$(writerfilter_GEN_ooxml_Model_processed) : 
$(writerfilter_SRC_ooxml_Preprocess_py) 
$(writerfilter_DEP_ooxml_Namespaces_txt) 
$(writerfilter_GEN_ooxml_Model_validated)
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
        $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_Preprocess_py) 
$(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model)) > $@
 
@@ -103,6 +112,6 @@ $(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : 
$(writerfilter_SRC)/ooxml/factory
 
 $(call gb_CustomTarget_get_target,writerfilter/source) : $(writerfilter_ALL)
 
-$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,python) 
$(writerfilter_WORK)/ooxml/.dir
+$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,python) 
$(call gb_ExternalExecutable_get_dependencies,xmllint) 
$(writerfilter_WORK)/ooxml/.dir
 
 # vim: set noet sw=4 ts=4:
commit c9cf219dc57393d6efbfa756834c8c97b7cd4dff
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Sat Aug 16 17:33:04 2014 +0200

    Fix $(call gb_ExternalExecutable_get_command,xmllint) in case of system 
libxml
    
    Change-Id: If9b32b09fd8cbf8b194b75357494d99aaa3fe06e

diff --git a/config_host.mk.in b/config_host.mk.in
index 1d4520cf..f438432 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -544,6 +544,7 @@ export SYSTEM_LIBLANGTAG=@SYSTEM_LIBLANGTAG@
 export SYSTEM_LIBORCUS=@SYSTEM_LIBORCUS@
 export SYSTEM_LIBPNG=@SYSTEM_LIBPNG@
 export SYSTEM_LIBXML=@SYSTEM_LIBXML@
+export SYSTEM_LIBXML_FOR_BUILD=@SYSTEM_LIBXML_FOR_BUILD@
 export SYSTEM_LIBXSLT=@SYSTEM_LIBXSLT@
 export SYSTEM_LIBXSLT_FOR_BUILD=@SYSTEM_LIBXSLT_FOR_BUILD@
 export SYSTEM_LPSOLVE=@SYSTEM_LPSOLVE@
diff --git a/configure.ac b/configure.ac
index 20e2405..b5d7373 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7984,6 +7984,10 @@ else
     BUILD_TYPE="$BUILD_TYPE LIBXML2"
 fi
 AC_SUBST(SYSTEM_LIBXML)
+if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
+    SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
+fi
+AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
 AC_SUBST(LIBXML_CFLAGS)
 AC_SUBST(LIBXML_LIBS)
 AC_SUBST(XMLLINT)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to