Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIs for file checksums? #36

Open
VorpalBlade opened this issue Feb 6, 2024 · 3 comments
Open

APIs for file checksums? #36

VorpalBlade opened this issue Feb 6, 2024 · 3 comments

Comments

@VorpalBlade
Copy link

pacman -Qii can list changed config files, and paccheck can find any changed files from packages. I can find neither functionality in the alpm crate (but maybe I missed something?). I would have expected it to be found in https://docs.rs/alpm/latest/alpm/struct.File.html

Is this something that would be possible to expose (getting the expected checksums of installed files). I'm also interested in getting the expected file contents of any of those changed files (in order to generate diffs for changed config files).

@VorpalBlade
Copy link
Author

So I figured this out: You need to enable the mtree feature. Which is not enabled when building the docs on docs.rs. I believe it is possible to build with all features in the future though by adding some lines in Cargo.toml: https://docs.rs/about/metadata

So, I'm not closing this bug yet (I think it morphed into "enable all features for docs.rs")

@Morganamilo
Copy link
Member

Yeah mtree is the way to get this. Tell me if it works for you as I believe there were some issues with it last time I checked (a few years ago) which come from the libarchive library segfaulting.

@VorpalBlade
Copy link
Author

Unfortunately it seems your/libarchive's mtree API doesn't expose the checksums though, so it isn't usable for my needs anyway. I found an old native-rust crate for parsing mtrees that does support this, but it seems unmaintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants