[Libguestfs] [PATCH v2 REPOST] lib: Allow db_dump package to be a weak dependency (RHBZ#1409024).
ptoscano at redhat.com
Fri Nov 2 14:41:53 UTC 2018
On Friday, 2 November 2018 15:27:17 CET Richard W.M. Jones wrote:
> We do this by defining DB_DUMP unconditionally and then testing the
> special exit code given by the shell if the command is not found (see
> Packagers may either:
> (1) Provide db_dump as a build requirement, but make it a weak
> dependency at runtime, or:
> (2) Not provide db_dump at build time, but define DB_DUMP to its
> expected path when configuring, eg:
> DB_DUMP=/usr/bin/db_dump ./configure
> which will then be compiled into the library and used if available at
> runtime (or ignored as in case (1) if not available at runtime).
I still do think this approach (hardcoding paths at build time) is not
a correct idea. It might work for tools part of the same suite (say,
hardcode the path of virt-get-kernel in virt-builder), but it gets
messy for tools that you do not really control.
I originally posted a better solution for this:
which apparently was rejected with doubtful reasons.
Yes, I still do think a proper runtime check, instead of wild
hardcoding is better, and it avoids the workaround proposed in form of
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: This is a digitally signed message part.
More information about the Libguestfs