[Libguestfs] [PATCH v2 REPOST] lib: Allow db_dump package to be a weak dependency (RHBZ#1409024).
Pino Toscano
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
> http://www.tldp.org/LDP/abs/html/exitcodes.html).
>
> 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:
https://www.redhat.com/archives/libguestfs/2017-February/msg00043.html
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
this patch.
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181102/22be7d72/attachment.sig>
More information about the Libguestfs
mailing list