[Libreoffice-commits] online.git: 2 commits - loolwsd/configure.ac loolwsd/LOOLKit.cpp loolwsd/loolwsd-systemplate-setup loolwsd/Makefile.am

Michael Meeks michael.meeks at collabora.com
Fri Apr 15 13:36:35 UTC 2016


 loolwsd/LOOLKit.cpp               |    4 +---
 loolwsd/Makefile.am               |    6 ++++--
 loolwsd/configure.ac              |    4 +---
 loolwsd/loolwsd-systemplate-setup |   17 ++++++++++++++++-
 4 files changed, 22 insertions(+), 9 deletions(-)

New commits:
commit 7376b7475e0363c766058c6d4bcc29fac12dc2ac
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 15 14:34:23 2016 +0100

    Font bits: create symlink in jail at OS instdir path, to point at /lo
    
    This ensures that bundled fonts in instdir/share end up resolved to
    the same path that they were in when the forkit font config was setup.
    
    It may also help locate other pre-inited resources.
    
    Also copy in ~/.fonts in debug mode - can't hurt.

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 7f63ace..18b0da2 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -117,6 +117,7 @@ namespace
         switch (typeflag)
         {
         case FTW_F:
+        case FTW_SLN:
             File(newPath.parent()).createDirectories();
             if (link(fpath, newPath.toString().c_str()) == -1)
             {
@@ -155,9 +156,6 @@ namespace
         case FTW_NS:
             Log::error("nftw: stat failed for '" + std::string(fpath) + "'");
             return 1;
-        case FTW_SLN:
-            Log::error("nftw: symlink to nonexistent file: '" + std::string(fpath) + "', ignored.");
-            break;
         default:
             Log::error("nftw: unexpected type: '" + std::to_string(typeflag));
             assert(false);
diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index abf73a3..e3c5f7a 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -131,7 +131,7 @@ clean-local:
 	if test "z at JAILS_PATH@" != "z"; then rm -rf "@JAILS_PATH@"; fi
 	if test "z at SYSTEMPLATE_PATH@" != "z"; then rm -rf "@SYSTEMPLATE_PATH@"; fi
 
-run: @JAILS_PATH@ @SYSTEMPLATE_PATH@/system_stamp
+run: all @JAILS_PATH@ @SYSTEMPLATE_PATH@/system_stamp
 	@echo "Launching loolwsd - launch this in your browser:"
 	@cp $(abs_top_srcdir)/test/data/hello.odt $(abs_top_srcdir)/test/data/hello-world.odt
 	@PROTOCOL="http" ; if test "z at ENABLE_SSL@" != "z"; then PROTOCOL="https" ; fi ; \
diff --git a/loolwsd/loolwsd-systemplate-setup b/loolwsd/loolwsd-systemplate-setup
index 4e6ee24..54a2df0 100755
--- a/loolwsd/loolwsd-systemplate-setup
+++ b/loolwsd/loolwsd-systemplate-setup
@@ -88,12 +88,14 @@ if [ -h usr/share/fonts/ghostscript ]; then
 fi
 
 # Our Libreoffice install often comes with pre-bundled fonts.
-mkdir -p $CHROOT/$INSTDIR/share
-cp -r -p -L $INSTDIR/share/fonts $CHROOT/$INSTDIR/share/
-
-#
-# A debugging hackery to avoid confusion.
-#
+# we need to ensure that there is a link to these with the same
+# path that fontconfig found.
+mkdir -p ./lo
+mkdir -p ./$INSTDIR
+rmdir ./$INSTDIR
+ln -s /lo $CHROOT/$INSTDIR
+
+# Debugging only hackery to avoid confusion.
 if test "z$ENABLE_DEBUG" != "z" -a "z$HOME" != "z"; then
     echo "Copying development users's fonts into systemplate"
     mkdir -p $CHROOT/$HOME
commit ab6cc4135bd734d091419e5fe610fef7745fd596
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 15 14:23:44 2016 +0100

    Copy fonts into systemplate from libreoffice install.

diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index a81842b..abf73a3 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -1,5 +1,7 @@
 SUBDIRS = . test
 
+export ENABLE_DEBUG
+
 bin_PROGRAMS = loolwsd loolforkit loolmap loolmount looltool
 
 dist_bin_SCRIPTS = loolwsd-systemplate-setup
@@ -118,7 +120,7 @@ if HAVE_LO_PATH
 
 SYSTEM_STAMP = @SYSTEMPLATE_PATH@/system_stamp
 
-$(SYSTEM_STAMP) :
+$(SYSTEM_STAMP) : ${top_srcdir}/loolwsd-systemplate-setup
 	if test "z at SYSTEMPLATE_PATH@" != "z"; then rm -rf "@SYSTEMPLATE_PATH@"; fi
 	${top_srcdir}/loolwsd-systemplate-setup "@SYSTEMPLATE_PATH@" "@LO_PATH@" && touch $@
 
diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index a5cdd3a..90a1a46 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -84,9 +84,7 @@ debug_msg="secure mode: product build"
 if test "$enable_debug" = "yes"; then
    AC_DEFINE([ENABLE_DEBUG],1,[Whether to compile in some extra debugging support code and disable some security pieces])
    ENABLE_DEBUG=true
-   if test "$enable_debug" = yes; then
-      debug_msg="low security debugging mode"
-   fi
+   debug_msg="low security debugging mode"
 else
     AC_DEFINE([ENABLE_DEBUG],0,[Whether to compile in some extra debugging support code and disable some security pieces])
 fi
diff --git a/loolwsd/loolwsd-systemplate-setup b/loolwsd/loolwsd-systemplate-setup
index 87af9e0..4e6ee24 100755
--- a/loolwsd/loolwsd-systemplate-setup
+++ b/loolwsd/loolwsd-systemplate-setup
@@ -74,7 +74,7 @@ mkdir -p $CHROOT/tmp
 mkdir -p $CHROOT/usr/bin/
 
 # /usr/share/fonts needs to be taken care of separately because the
-# directory time stamps must be preserved are for fontconfig to trust
+# directory time stamps must be preserved for fontconfig to trust
 # its cache.
 
 cd $CHROOT || exit 1
@@ -86,3 +86,16 @@ if [ -h usr/share/fonts/ghostscript ]; then
     mkdir usr/share/ghostscript || exit 1
     cp -r -p /usr/share/ghostscript/fonts usr/share/ghostscript
 fi
+
+# Our Libreoffice install often comes with pre-bundled fonts.
+mkdir -p $CHROOT/$INSTDIR/share
+cp -r -p -L $INSTDIR/share/fonts $CHROOT/$INSTDIR/share/
+
+#
+# A debugging hackery to avoid confusion.
+#
+if test "z$ENABLE_DEBUG" != "z" -a "z$HOME" != "z"; then
+    echo "Copying development users's fonts into systemplate"
+    mkdir -p $CHROOT/$HOME
+    cp -r -p -L $HOME/.fonts $CHROOT/$HOME
+fi


More information about the Libreoffice-commits mailing list