From fb7b683a2988a7880b9d991f4e325aaa15fd2d42 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 15 Jan 2021 14:20:00 +0000 Subject: [PATCH] appliance: Avoid having ${exec_prefix} in guestfs appliance path. Normally packagers should try to use ./configure --with-guestfs-path=... However if they do not, then a regression in 1.44 caused the path to constain the literal string "${exec_prefix}". This was because of autoconf stupidity. Try to resolve this by expanding ${exec_prefix} to something sensible. The expansion will often be wrong (but at least it will now be a valid path), hence the recommendation to always set --libdir and/or --with-guestfs-path when configuring. Fixes: commit 94ff24b8800ebc79f19bd686ec2dda393906c454 Fixes: https://bugzilla.redhat.com/1915646 --- m4/guestfs-appliance.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/m4/guestfs-appliance.m4 b/m4/guestfs-appliance.m4 index b0a6ab40f..d7e0c0af5 100644 --- a/m4/guestfs-appliance.m4 +++ b/m4/guestfs-appliance.m4 @@ -135,12 +135,17 @@ AC_ARG_WITH([extra-packages], AC_SUBST([EXTRA_PACKAGES]) dnl Set guestfs default path +dnl Expand $libdir to the actual path to avoid autoconf stupidity. +real_libdir="$( + if test "$exec_prefix" = NONE ; then exec_prefix=/usr/local; fi + echo "$libdir" | sed "s|\${exec_prefix}|$exec_prefix|" + )" AC_MSG_CHECKING([for guestfs path]) AC_ARG_WITH([guestfs-path], [AS_HELP_STRING([--with-guestfs-path=PATH], - [specify guestfs path (default=$libdir/guestfs)])], + [specify guestfs path (default=$real_libdir/guestfs)])], [GUESTFS_DEFAULT_PATH="$withval"], - [GUESTFS_DEFAULT_PATH="$libdir/guestfs"]) + [GUESTFS_DEFAULT_PATH="$real_libdir/guestfs"]) AC_MSG_RESULT([$GUESTFS_DEFAULT_PATH]) AC_SUBST([GUESTFS_DEFAULT_PATH])