archiver icon indicating copy to clipboard operation
archiver copied to clipboard

Support for .deb .rpm .cpio?

Open ducktype opened this issue 6 years ago • 8 comments

I think will be cool to support .deb and .rpm and probably others linux packages formats .deb are custom wrapped tar.gz/tar.bz2/tar.xz/tar.lz4/tar.sz archives .rpm are custom wrapped cpio archives the only program that handle these archive types that i'm aware of is 7zip that have a linux port p7zip, but in the latest versions of 7zip some problems arise and i needed to use an older version, having a multiplatform/dependencies free archiver that handle also that common type of linux packages will be great, for my needs will be enought to have the extract operation!

What do you think about that? thank you in advice :)

ducktype avatar Nov 30 '18 18:11 ducktype

Sure, pull requests welcome to add additional archive formats.

mholt avatar Nov 30 '18 23:11 mholt

@ducktype Hey actually, I just updated the issue templates. Would you mind re-creating one issue per format using the template specifically for requesting new archive formats? Thanks!

mholt avatar Dec 02 '18 23:12 mholt

Only 5 years later 🤣 https://github.com/trufflesecurity/trufflehog/pull/1625

ahrav avatar Aug 15 '23 23:08 ahrav

@ahrav That could be a reference implementation, yeah? Feel free to make a PR if we can / want to use it!

mholt avatar Aug 16 '23 03:08 mholt

@ahrav That could be a reference implementation, yeah? Feel free to make a PR if we can / want to use it!

Yea that's correct. It's not a great solution, but it does provide us a way to extract .rpm and .deb file formats. It's really just a convenience helper to extract the files into tarballs which your pkg then nicely takes care of.

ahrav avatar Aug 16 '23 04:08 ahrav

Very cool :)

mholt avatar Aug 16 '23 05:08 mholt

Seems the proposed solution uses external commands, i feel archiver should handle extractions by itself and also avoid double copying the archive.

There are native golang libs, also recently updated, that handle ar (Deb) and cpio (RPM) formats

https://pkg.go.dev/pault.ag/go/debian/deb https://pkg.go.dev/github.com/u-root/u-root/pkg/cpio

RPM add some header before the cpio stream so some code to parse and skip to the start cpio offset Is required i think this lib have some of that stuff, but Is old:

https://pkg.go.dev/github.com/sassoftware/go-rpmutils

ducktype avatar Aug 16 '23 16:08 ducktype

Would like to see support for .rpm as well!

taoxinyi avatar Apr 11 '24 03:04 taoxinyi