alpm-soname
A library and command line toolkit for looking up soname data in an ALPM context
Examples
The examples below assume that the following shared object setup exists in a package file example-1.0.0-1-x86_64.pkg.tar.zst:
/usr/lib/libexample.so -> libexample.so.1
/usr/lib/libexample.so.1 -> libexample.so.1.0.0
/usr/lib/libexample.so.1.0.0
Here, /usr/lib/libexample.so.1.0.0 encodes the soname libexample.so.1 in its ELF dynamic section.
For the examples below, the environment variables are set as follows:
LIB_PACKAGE_PATH:example-1.0.0-1-x86_64.pkg.tar.zstBIN_PACKAGE_PATH:application-1.0.0-1-x86_64.pkg.tar.zst
Command Line
You can use the subcommands to find the sonames provided by a package and the sonames required by a package.
The -v option can be used to set the verbosity level. (e.g. -v for debug and -vv for trace)
Finding Provisions
You can retrieve the sonames provided by the package:
|
# lib:libexample.so.1
Finding Dependencies
You can retrieve the sonames required by the package:
|
# lib:libexample.so.1
Finding Raw Dependencies
get-dependencies subcommand only returns the soname dependencies, that have a matching entry in the package's metadata.
If you are interested in all soname dependencies encoded in the ELF files of a package, you can use the get-raw-dependencies subcommand.
|
# [{"name":"libc.so","version":"6"},{"name":"libexample.so","version":"1"}]
As demonstrated above, the output format can be set to json using the --output-format option.
Library
Finding Provisions
use ;
use find_provisions;
use SonameLookupDirectory;
Finding Dependencies
use ;
use find_dependencies;
use SonameLookupDirectory;
Extracting Soname Data
use PathBuf;
use extract_elf_sonames;
Features
cliadds the commandline handling needed for thealpm-sonamebinary (enabled by default).
Contributing
Please refer to the contribution guidelines to learn how to contribute to this project.
License
This project can be used under the terms of the Apache-2.0 or MIT. Contributions to this project, unless noted otherwise, are automatically licensed under the terms of both of those licenses.