Commit 35b20897 authored by Simon McVittie's avatar Simon McVittie
Browse files

capture-libs: Rename literal: to soname:



Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent a37fce75
......@@ -43,7 +43,7 @@ my $libdir = "${test_tempdir}/libdir";
ok(! system('rm', '-fr', $libdir));
mkdir($libdir);
run_ok([$CAPSULE_CAPTURE_LIBS_TOOL, 'literal:libc.so.6'], '>&2',
run_ok([$CAPSULE_CAPTURE_LIBS_TOOL, 'soname:libc.so.6'], '>&2',
init => sub { chdir $libdir or die $!; });
ok(-e "$libdir/libc.so.6", 'libc.so.6 was captured');
like(readlink "$libdir/libc.so.6", qr{^$LIBDIR/libc\.so\.6$},
......@@ -89,7 +89,7 @@ run_ok([qw(bwrap --ro-bind / / --ro-bind /), $host,
qw(--dev-bind /dev /dev),
$CAPSULE_CAPTURE_LIBS_TOOL,
"--dest=$libdir",
"--provider=$host", 'literal:libc.so.6'], '>&2');
"--provider=$host", 'soname:libc.so.6'], '>&2');
{
opendir(my $dir_iter, $libdir);
my @links = sort grep { $_ ne '.' and $_ ne '..' } readdir $dir_iter;
......@@ -110,7 +110,7 @@ run_ok([qw(bwrap --ro-bind / / --ro-bind /), $host,
qw(--dev-bind /dev /dev),
$CAPSULE_CAPTURE_LIBS_TOOL, '--link-target=/run/host',
"--dest=$libdir",
"--provider=$host", 'literal:libc.so.6'], '>&2');
"--provider=$host", 'soname:libc.so.6'], '>&2');
{
opendir(my $dir_iter, $libdir);
my @links = sort grep { $_ ne '.' and $_ ne '..' } readdir $dir_iter;
......
......@@ -747,7 +747,7 @@ make_path("$tmpdir/updates", verbose => 1);
if ($libc_provider_tree eq 'auto') {
diag "Choosing GL provider's libc or container's libc automatically";
capture_libs($gl_provider_tree, $container_tree, \@multiarch_tuples,
$updates_tree, ['literal:libc.so.6'], "$tmpdir/scratch", '/gl-provider');
$updates_tree, ['soname:libc.so.6'], "$tmpdir/scratch", '/gl-provider');
# See what we've got
foreach my $tuple (@multiarch_tuples) {
......@@ -773,7 +773,7 @@ if ($libc_provider_tree eq 'auto') {
}
elsif ($libc_provider_tree =~ m/^(?:gl-provider|host)$/) {
capture_libs($gl_provider_tree, $container_tree, \@multiarch_tuples,
$updates_tree, ['even-if-older:literal:libc.so.6'],
$updates_tree, ['even-if-older:soname:libc.so.6'],
"$tmpdir/scratch", '/gl-provider');
diag "${ansi_bright}${ansi_green}Adding GL provider's libc via /updates ".
"as requested${ansi_reset}";
......@@ -788,7 +788,7 @@ else {
diag "${ansi_bright}${ansi_magenta}Adding ${libc_provider_tree} libc ".
"via /updates as requested${ansi_reset}";
capture_libs($libc_provider_tree, $container_tree, \@multiarch_tuples,
$updates_tree, ['even-if-older:literal:libc.so.6'],
$updates_tree, ['even-if-older:soname:libc.so.6'],
"$tmpdir/scratch", '/libc-provider');
push @bwrap, use_ldso($libc_provider_tree, $container_tree,
\@multiarch_tuples, "$tmpdir/scratch");
......@@ -849,7 +849,7 @@ else {
if ($libcapsule_tree eq 'auto') {
diag "Using libcapsule from $gl_provider_tree if newer";
capture_libs($gl_provider_tree, $container_tree,
\@multiarch_tuples, $updates_tree, ['literal:libcapsule.so.0'],
\@multiarch_tuples, $updates_tree, ['soname:libcapsule.so.0'],
"$tmpdir/scratch", '/gl-provider');
}
elsif ($libcapsule_tree eq 'container') {
......@@ -859,14 +859,14 @@ elsif ($libcapsule_tree =~ m/^(?:gl-provider|host)$/) {
diag "${ansi_green}Using libcapsule from GL provider as requested${ansi_reset}";
capture_libs($gl_provider_tree, $container_tree,
\@multiarch_tuples, $updates_tree,
['even-if-older:literal:libcapsule.so.0'],
['even-if-older:soname:libcapsule.so.0'],
"$tmpdir/scratch", '/gl-provider');
}
else {
diag "${ansi_magenta}Using libcapsule from $libcapsule_tree${ansi_reset}";
capture_libs($libcapsule_tree, $container_tree,
\@multiarch_tuples, $updates_tree,
['even-if-older:literal:libcapsule.so.0'],
['even-if-older:soname:libcapsule.so.0'],
"$tmpdir/scratch", '/libcapsule-provider');
push @bwrap, bind_usr($libcapsule_tree, '/libcapsule-provider');
}
......
......@@ -156,14 +156,15 @@ static void usage (int code)
"SONAMEs (which will usually need to be quoted when using\n"
"a shell), or one of the following special strings:\n" );
fprintf( fh, "\n" );
fprintf( fh, "soname:SONAME\n"
"\tCapture the library in ld.so.cache whose name is\n"
"\texactly SONAME\n" );
fprintf( fh, "soname-match:GLOB\n"
"\tCapture every library in ld.so.cache that matches\n"
"\ta shell-style glob (which will usually need to be\n"
"\tquoted when using a shell)\n" );
fprintf( fh, "if-exists:SONAME\n"
"\tCapture SONAME, but don't fail if it doesn't exist\n" );
fprintf( fh, "literal:SONAME\n"
"\tTake ':', '*' etc. in SONAME literally\n" );
fprintf( fh, "even-if-older:SONAME\n"
"\tCapture SONAME, even if the version in CONTAINER\n"
"\tappears newer\n" );
......@@ -517,9 +518,9 @@ capture_pattern( const char *pattern, capture_flags flags,
{
DEBUG( DEBUG_TOOL, "%s", pattern );
if( strstarts( pattern, "literal:" ) )
if( strstarts( pattern, "soname:" ) )
{
return capture_one( pattern + strlen( "literal:" ),
return capture_one( pattern + strlen( "soname:" ),
flags, code, message );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment