summaryrefslogtreecommitdiffstats
path: root/coolwsd-systemplate-setup
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2022-04-22 14:12:05 +0300
committerAndras Timar <andras.timar@collabora.com>2022-04-27 17:36:21 +0200
commit04cf8d2cd040c199b1e97e259684233d912f4177 (patch)
tree238ab26d8a23a078d6c84e6c61a0235b068490d2 /coolwsd-systemplate-setup
parentEnable avoiding use of ETag for remote font files (diff)
downloadonline-04cf8d2cd040c199b1e97e259684233d912f4177.tar.gz
online-04cf8d2cd040c199b1e97e259684233d912f4177.zip
Avoid using only "real" paths for the tmpfont thing
If I have used a path with symlinks in it when changing directory to my build directory, what gets put in config.status as ac_pwd is that path, not a realpath version. That then propagates to ac_abs_to_builddir and to SYSTEMPLATE_PATH, which is what Makefile.am passes for the --o:sys_template_path option to coolwsd. To be on the safe side, do the tmpfonts dance both for the systemplate path that might include symlinks and for one that has been realpathed. Signed-off-by: Tor Lillqvist <tml@collabora.com> Change-Id: I7575120090986e6207497c5ce740aedd6075e48f
Diffstat (limited to 'coolwsd-systemplate-setup')
-rwxr-xr-xcoolwsd-systemplate-setup15
1 files changed, 15 insertions, 0 deletions
diff --git a/coolwsd-systemplate-setup b/coolwsd-systemplate-setup
index 74e5802878..e67caa5c95 100755
--- a/coolwsd-systemplate-setup
+++ b/coolwsd-systemplate-setup
@@ -15,6 +15,12 @@ test -d "$INSTDIR" || { echo "$0: No such directory: $INSTDIR"; exit 1; }
mkdir -p $CHROOT || exit 1
+# For the tmpfonts we need to use the pathnames as used by the
+# configure script, which does *not* look up realpaths, because the
+# Makefile.am uses @SYSTEMPLATE_PATH@ which uses abs_top_builddir
+# which uses ac_pwd which is not based on use of realpath.
+CHROOT_AS_GIVEN=$CHROOT
+
# Resolve the real paths, in case they are relative and/or symlinked.
# INSTDIR_LOGICAL will contain the logical path, if there are symlinks,
# while INSTDIR is the physical one. Both will most likely be the same,
@@ -117,10 +123,19 @@ done
# stored. Such are downloaded from other servers based on a separate
# configuration file. They need to be accessible using the same
# pathname both in the ForKit process and in the Kit processes.
+
mkdir -p $CHROOT/tmpfonts
mkdir -p $CHROOT$CHROOT
ln -f -s `${REALPATH} --relative-to=$CHROOT$CHROOT $CHROOT/tmpfonts` $CHROOT$CHROOT
+# To be safe we do this both for $CHROOT and $CHROOT_AS_GIVEN, in case they differ.
+
+if [ "$CHROOT_AS_GIVEN" != "$CHROOT" ]; then
+ mkdir -p $CHROOT_AS_GIVEN/tmpfonts
+ mkdir -p $CHROOT_AS_GIVEN$CHROOT_AS_GIVEN
+ ln -f -s `${REALPATH} --relative-to=$CHROOT_AS_GIVEN$CHROOT_AS_GIVEN $CHROOT_AS_GIVEN/tmpfonts` $CHROOT_AS_GIVEN$CHROOT_AS_GIVEN
+fi
+
# /usr/share/fonts needs to be taken care of separately because the
# directory time stamps must be preserved for fontconfig to trust
# its cache.