Laszlo Ersek
2022-Jul-20 11:53 UTC
[Libguestfs] [p2v PATCH] virt-p2v-make-*.in: make @datadir@ and @libdir@ resolvable
./configure expands @datadir@ and @libdir@ to "${prefix}/share" and "${exec_prefix}/lib" by default (verbatim); $prefix and $exec_prefix are supposed to be substituted by the shell when the generated shell scripts are executed. For this, capture the prefix and exec_prefix values at the time ./configure runs. This fixes failures such as> $ virt-p2v-make-kickstart fedora > base64: /share/virt-p2v/issue: No such file or directoryfor such scripts that were installed with "make install". Note that the patch does not help when running virt-p2v-make-* from a git checkout that was just built, such as> $ ./virt-p2v-make-kickstart fedoraIn that case, VIRT_P2V_DATA_DIR still needs to be set to $PWD, as there is no "share" subdirectory in the checkout. Suggested-by: Richard W.M. Jones <rjones at redhat.com> Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- virt-p2v-make-disk.in | 2 ++ virt-p2v-make-kickstart.in | 2 ++ virt-p2v-make-kiwi.in | 2 ++ 3 files changed, 6 insertions(+) diff --git a/virt-p2v-make-disk.in b/virt-p2v-make-disk.in index ac477eb39be8..218ff1531872 100644 --- a/virt-p2v-make-disk.in +++ b/virt-p2v-make-disk.in @@ -20,6 +20,8 @@ unset CDPATH program="virt-p2v-make-disk" version="@PACKAGE_VERSION@" +prefix="@prefix@" +exec_prefix="@exec_prefix@" if [ -n "$VIRT_P2V_DATA_DIR" ]; then datadir="$VIRT_P2V_DATA_DIR" diff --git a/virt-p2v-make-kickstart.in b/virt-p2v-make-kickstart.in index d139c9bb554b..1706102d05c7 100644 --- a/virt-p2v-make-kickstart.in +++ b/virt-p2v-make-kickstart.in @@ -20,6 +20,8 @@ unset CDPATH program="virt-p2v-make-kickstart" version="@PACKAGE_VERSION@" +prefix="@prefix@" +exec_prefix="@exec_prefix@" # Parse the command line arguments. shortopts=o:vV diff --git a/virt-p2v-make-kiwi.in b/virt-p2v-make-kiwi.in index 987de11b54aa..a648f6a3886c 100644 --- a/virt-p2v-make-kiwi.in +++ b/virt-p2v-make-kiwi.in @@ -20,6 +20,8 @@ unset CDPATH program="virt-p2v-make-kiwi" version="@PACKAGE_VERSION@" +prefix="@prefix@" +exec_prefix="@exec_prefix@" # Parse the command line arguments. shortopts=o:V -- 2.19.1.3.g30247aa5d201
Richard W.M. Jones
2022-Jul-20 12:01 UTC
[Libguestfs] [p2v PATCH] virt-p2v-make-*.in: make @datadir@ and @libdir@ resolvable
On Wed, Jul 20, 2022 at 01:53:22PM +0200, Laszlo Ersek wrote:> ./configure expands @datadir@ and @libdir@ to "${prefix}/share" and > "${exec_prefix}/lib" by default (verbatim); $prefix and $exec_prefix are > supposed to be substituted by the shell when the generated shell scripts > are executed. > > For this, capture the prefix and exec_prefix values at the time > ./configure runs. > > This fixes failures such as > > > $ virt-p2v-make-kickstart fedora > > base64: /share/virt-p2v/issue: No such file or directory > > for such scripts that were installed with "make install". > > Note that the patch does not help when running virt-p2v-make-* from a git > checkout that was just built, such as > > > $ ./virt-p2v-make-kickstart fedora > > In that case, VIRT_P2V_DATA_DIR still needs to be set to $PWD, as there is > no "share" subdirectory in the checkout. > > Suggested-by: Richard W.M. Jones <rjones at redhat.com> > Signed-off-by: Laszlo Ersek <lersek at redhat.com> > --- > virt-p2v-make-disk.in | 2 ++ > virt-p2v-make-kickstart.in | 2 ++ > virt-p2v-make-kiwi.in | 2 ++ > 3 files changed, 6 insertions(+) > > diff --git a/virt-p2v-make-disk.in b/virt-p2v-make-disk.in > index ac477eb39be8..218ff1531872 100644 > --- a/virt-p2v-make-disk.in > +++ b/virt-p2v-make-disk.in > @@ -20,6 +20,8 @@ unset CDPATH > > program="virt-p2v-make-disk" > version="@PACKAGE_VERSION@" > +prefix="@prefix@" > +exec_prefix="@exec_prefix@" > > if [ -n "$VIRT_P2V_DATA_DIR" ]; then > datadir="$VIRT_P2V_DATA_DIR" > diff --git a/virt-p2v-make-kickstart.in b/virt-p2v-make-kickstart.in > index d139c9bb554b..1706102d05c7 100644 > --- a/virt-p2v-make-kickstart.in > +++ b/virt-p2v-make-kickstart.in > @@ -20,6 +20,8 @@ unset CDPATH > > program="virt-p2v-make-kickstart" > version="@PACKAGE_VERSION@" > +prefix="@prefix@" > +exec_prefix="@exec_prefix@" > > # Parse the command line arguments. > shortopts=o:vV > diff --git a/virt-p2v-make-kiwi.in b/virt-p2v-make-kiwi.in > index 987de11b54aa..a648f6a3886c 100644 > --- a/virt-p2v-make-kiwi.in > +++ b/virt-p2v-make-kiwi.in > @@ -20,6 +20,8 @@ unset CDPATH > > program="virt-p2v-make-kiwi" > version="@PACKAGE_VERSION@" > +prefix="@prefix@" > +exec_prefix="@exec_prefix@" > > # Parse the command line arguments. > shortopts=o:VAcked-by: Richard W.M. Jones <rjones at redhat.com> (I think you may find that autoconf additionally whinges about this - if it does, it's safe to ignore that!) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Eric Blake
2022-Jul-20 15:06 UTC
[Libguestfs] [p2v PATCH] virt-p2v-make-*.in: make @datadir@ and @libdir@ resolvable
On Wed, Jul 20, 2022 at 01:53:22PM +0200, Laszlo Ersek wrote:> ./configure expands @datadir@ and @libdir@ to "${prefix}/share" and > "${exec_prefix}/lib" by default (verbatim); $prefix and $exec_prefix are > supposed to be substituted by the shell when the generated shell scripts > are executed. > > For this, capture the prefix and exec_prefix values at the time > ./configure runs. > > This fixes failures such as > > > $ virt-p2v-make-kickstart fedora > > base64: /share/virt-p2v/issue: No such file or directory > > for such scripts that were installed with "make install". >> +++ b/virt-p2v-make-disk.in > @@ -20,6 +20,8 @@ unset CDPATH > > program="virt-p2v-make-disk" > version="@PACKAGE_VERSION@" > +prefix="@prefix@" > +exec_prefix="@exec_prefix@"I'm late to the conversation, but I also recommend adding a third line: datarootdir="@datarootdir@" as it will then silence the autoconf warnings about not honoring --datarootdir in a file that dereferenced @datadir at . With that addition in all relevant .in files, Acked-by: Eric Blake <eblake at redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org