[Libreoffice-commits] core.git: bin/officeotron.sh.in configure.ac download.lst .gitignore Makefile.fetch

Vasily Melenchuk vasily.melenchuk at cib.de
Tue Aug 9 13:34:28 UTC 2016


 .gitignore            |    1 
 Makefile.fetch        |    1 
 bin/officeotron.sh.in |    2 +
 configure.ac          |   55 +++++++++++++++++++++++++++++---------------------
 download.lst          |    1 
 5 files changed, 37 insertions(+), 23 deletions(-)

New commits:
commit 3011a704d9ff8ddd052165150a5cd91166fad69d
Author: Vasily Melenchuk <vasily.melenchuk at cib.de>
Date:   Thu Jul 21 19:26:12 2016 +0300

    officeotron usage in export tests without external dependencies
    
    officeotron is a OOXML documents validator which can be used for
    verification of export files in tests. Previously it was possible
    to use it only from external repository with extra build steps.
    
    Change-Id: Iae6ec3695fdfaf738d180405047ff04b2024c906
    Reviewed-on: https://gerrit.libreoffice.org/27388
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/.gitignore b/.gitignore
index de258c9..aac380d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,6 +57,7 @@
 /lo.xcent
 /bin/bffvalidator.sh
 /bin/odfvalidator.sh
+/bin/officeotron.sh
 /Makefile
 /NEWS
 /TODO
diff --git a/Makefile.fetch b/Makefile.fetch
index f695219..bd96f12 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -216,6 +216,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
 		$(call fetch_Optional,DBGHELP,DBGHELP_DLL) \
 		$(call fetch_Optional,ODK,UNOWINREG_DLL) \
 		$(call fetch_Optional,ODFVALIDATOR,ODFVALIDATOR_JAR) \
+		$(call fetch_Optional,OFFICEOTRON,OFFICEOTRON_JAR) \
 	,$(call fetch_Download_item,http://dev-www.libreoffice.org/extern,$(item)))
 	$(foreach item, \
 		$(call fetch_Optional_pack,BARCODE_EXTENSION_PACK) \
diff --git a/bin/officeotron.sh.in b/bin/officeotron.sh.in
new file mode 100644
index 0000000..7281f1b
--- /dev/null
+++ b/bin/officeotron.sh.in
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+java -jar @TARFILE_LOCATION@/@OFFICEOTRON_JAR@ "$@"
diff --git a/configure.ac b/configure.ac
index 8346458..5759408 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2756,39 +2756,46 @@ if test "$with_export_validation" = yes; then
         if test -z "$ODFVALIDATOR_JAR"; then
             AC_MSG_ERROR([odfvalidator jar location is not determined (--with-export-validation)])
         fi
-
-        if test "$build_os" = "cygwin"; then
-            # In case of CygWin it will be executed from Windows,
-            # so we need to run bash and absolute path to validator
-            # so instead of "odfvalidator" it will be
-            # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
-            ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
-        fi
     fi
-    AC_SUBST(ODFVALIDATOR)
-
     if test "$build_os" = "cygwin"; then
         # In case of CygWin it will be executed from Windows,
         # so we need to run bash and absolute path to validator
-        # so instead of "officeotron" it will be
-        # something like "bash.exe C:\cygwin\opt\lo\bin\officeotron"
-        AC_PATH_PROGS(OFFICEOTRON, officeotron)
-        if test -z "$OFFICEOTRON"; then
-            AC_MSG_ERROR([officeotron not found, but required by --with-export-validation])
+        # so instead of "odfvalidator" it will be
+        # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
+        ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
+    fi
+    AC_SUBST(ODFVALIDATOR)
+
+
+    AC_PATH_PROGS(OFFICEOTRON, officeotron)
+    if test -z "$OFFICEOTRON"; then
+        # remember to download the officeotron with validator later
+        AC_MSG_NOTICE([no officeotron found, will download it])
+        BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
+        OFFICEOTRON="bin/officeotron.sh"
+
+        # and fetch name of officeotron jar name from download.lst
+        OFFICEOTRON_JAR=`sed -ne "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" download.lst`
+        AC_SUBST(OFFICEOTRON_JAR)
+
+        if test -z "$OFFICEOTRON_JAR"; then
+            AC_MSG_ERROR([officeotron jar location is not determined (--with-export-validation)])
         fi
-        OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
     else
-        AC_CHECK_PROGS(OFFICEOTRON, officeotron)
-        if test -z "$OFFICEOTRON"; then
-            AC_MSG_ERROR([officeotron not found, but required by --with-export-validation])
+        # check version of existing officeotron
+        OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
+        if test 0"$OFFICEOTRON_VER" -lt 704; then
+            AC_MSG_ERROR([officeotron too old])
         fi
     fi
-    OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
-    if test 0"$OFFICEOTRON_VER" -lt 704; then
-        AC_MSG_ERROR([officeotron too old])
+    if test "$build_os" = "cygwin"; then
+        # In case of CygWin it will be executed from Windows,
+        # so we need to run bash and absolute path to validator
+        # so instead of "odfvalidator" it will be
+        # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
+        OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
     fi
     AC_SUBST(OFFICEOTRON)
-
 else
     AC_MSG_RESULT([no])
 fi
@@ -4677,6 +4684,7 @@ if test "$cross_compiling" = "yes"; then
         lo.xcent.in \
         bin/bffvalidator.sh.in \
         bin/odfvalidator.sh.in \
+        bin/officeotron.sh.in \
         instsetoo_native/util/openoffice.lst.in \
         config_host/*.in \
         sysui/desktop/macosx/Info.plist.in \
@@ -13018,6 +13026,7 @@ AC_CONFIG_FILES([config_host.mk
                  lo.xcent
                  bin/bffvalidator.sh
                  bin/odfvalidator.sh
+                 bin/officeotron.sh
                  instsetoo_native/util/openoffice.lst
                  sysui/desktop/macosx/Info.plist
                  ios/lo.xcconfig])
diff --git a/download.lst b/download.lst
index 6f716d0..457f08d 100644
--- a/download.lst
+++ b/download.lst
@@ -115,6 +115,7 @@ export ODFGEN_MD5SUM := 32572ea48d9021bbd6fa317ddb697abc
 export ODFGEN_VERSION_MICRO := 6
 export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
 export ODFVALIDATOR_JAR := e7f181c1d969dbd553644b191cb0a6d3-odfvalidator-1.1.8-incubating-SNAPSHOT-jar-with-dependencies.jar
+export OFFICEOTRON_JAR := c038af04c1431525e3fdee57d32b865e-officeotron-0.7.4-master.jar
 export OPENCOLLADA_MD5SUM := 4ca8a6ef0afeefc864e9ef21b9f14bd6
 export OPENCOLLADA_TARBALL := OpenCOLLADA-master-6509aa13af.tar.bz2
 export OPENLDAP_TARBALL := 804c6cb5698db30b75ad0ff1c25baefd-openldap-2.4.31.tgz


More information about the Libreoffice-commits mailing list