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 94ff24b880
Fixes: https://bugzilla.redhat.com/1915646
This commit is contained in:
Richard W.M. Jones
2021-01-15 14:20:00 +00:00
parent 0c82987531
commit fb7b683a29

View File

@@ -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])