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
LD_PRELOAD=libMangoHud.so, then we'll want to import that library into
the container and load it. However, if it's something like
LD_PRELOAD=libcurl.so.4, 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
implementable.

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

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 jobs for wip/if-not-in-container in 8 minutes and 31 seconds (queued for 8 seconds)
latest
Status Name Job ID Coverage
  Test
manual build:arch #104969
allowed to fail manual
passed build:asan #104965

00:04:04

passed build:bionic #104968

00:08:30

passed build:buster #104967

00:08:02

passed build:stretch #104966

00:08:22

passed build:ubsan #104964

00:03:54

passed reuse #104970

00:02:12