From 04cf8d2cd040c199b1e97e259684233d912f4177 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 22 Apr 2022 14:12:05 +0300 Subject: 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 Change-Id: I7575120090986e6207497c5ce740aedd6075e48f --- coolwsd-systemplate-setup | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'coolwsd-systemplate-setup') 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. -- cgit