From: Jakub Jirutka Date: Sat, 11 Dec 2021 13:49:00 +0100 Subject: [PATCH] Add option --skip-default The built-in skip/exclude list (include/libtree/excludelist.hpp) has been taken [1] from the AppImages project [2] and it's quite major-glibc-distros-centric, so not very useful on Alpine Linux. This patch disables the usage of this list, unless --skip-default is used. [1]: https://github.com/haampie/libtree/commit/6f5e6bb3aa69f73d8ba0c02c11a876280f78497f [2]: https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,8 @@ ("l,ldconf", "Path to custom ld.conf to test settings", cxxopts::value()->default_value("/etc/ld.so.conf")) ("s,skip", "Skip library and its dependencies from being deployed or inspected", cxxopts::value>()) ("platform", "Platform used for interpolation in rpaths", cxxopts::value()->default_value(default_platform)) - ("b,binary", "Binary to inspect", cxxopts::value>()); + ("b,binary", "Binary to inspect", cxxopts::value>()) + ("skip-default", "Skip libraries on the AppImages' exclude list (Alpine-specific option; this is always enabled in the original libtree)", cxxopts::value()->default_value("false")); options.add_options("B. Copying libs") ("d,destination", "OPTIONAL: When a destination is set to a folder, all binaries and their dependencies are copied over", cxxopts::value()) @@ -79,6 +80,11 @@ return 0; } + if (!result["skip-default"].count()) + generatedExcludelist.clear(); + + generatedExcludelist.insert(std::string("libc.musl-") + platform + ".so.1"); + if (result["skip"].count()) { auto const &list = result["skip"].as>(); for (auto const &lib : list)