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

How to extract from rpm #222

Open
kpcyrd opened this issue Apr 14, 2024 · 4 comments
Open

How to extract from rpm #222

kpcyrd opened this issue Apr 14, 2024 · 4 comments

Comments

@kpcyrd
Copy link

kpcyrd commented Apr 14, 2024

Hello! :)

I found this parsing library and I already figured out how to use rpm::Package::parse and get_file_entries(), but I couldn't figure out how to read a file from the archive. It seems rpm::FileEntry does not have any way to be read.

Do you have any pointers?

Thanks!

@dralley
Copy link
Collaborator

dralley commented Apr 14, 2024

There isn't an API for that yet unfortunately. We absolutely need one though. Maybe I can find some time for that this week.

@kpcyrd
Copy link
Author

kpcyrd commented Apr 14, 2024

This for the quick reply, is there a way I could work around this in the meantime? :)

@dralley
Copy link
Collaborator

dralley commented Apr 14, 2024

The payload is (99.999% of the time) just a standard SVR4 CPIO archive. You can process it with a CPIO library of choice.

@kpcyrd
Copy link
Author

kpcyrd commented Apr 15, 2024

I see, I assume it's available in this field (which makes sense):

https://docs.rs/rpm/latest/rpm/struct.Package.html#structfield.content

In the meantime I wrote a somewhat chaotic solution based on /usr/bin/bsdtar:

kpcyrd/what-the-src@2013e1b this has the advantage of being AsyncRead though.

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