capture-libs: Add if-not-in-container flag

When pressure-vessel maps LD_PRELOAD options into a container, it's not
completely obvious what to do with a plain basename. If it's, then we'll want to import that library into
the container and load it. However, if it's something like, then arbitrarily deciding that we will load
the one from the host system seems like it defeats the object of the
predictable runtime environment.

We can avoid this by assuming that if a particular SONAME exists in the
container, then we should probably interpret LD_PRELOADing it as meaning
use the container's version, even if the version from the provider
(host system) appears newer. The if-not-in-container flag makes this

If the library has dependencies, they are compared between container
and provider as usual.

Signed-off-by: Simon McVittie <>
7 jobs for wip/if-not-in-container in 8 minutes and 31 seconds (queued for 8 seconds)