Enhancement: multifile should optionally extract tar files (-x set)
multifile should opportunistically extract tar files when -x is set. This means looking at the content-type and knowing what to do.
i want to work on this issue but i don't exactly get what the is the required output? Can you just brief me about it? Thank you
Hi @AtharvaWaghchoure thanks for asking for clarification
The changes for this issue are fairly straight forward.
- Need to extend the -x flag to be a persistent flag instead of a rootcmd local flag
- Remove the guard against using the flag with multifile
- Enhance the consumer interface for Fetch to take a content-type value (most consumers will ignore it)
- Pass the content-type to the consumer (this is available in the http.Response
The output can run through the current tar-extractor consumer
However there are two approaches to untarring in multifile mode:
- New wrapper consumer for tar-extract when in multifile mode
- This consumer can fallthrough to the standard file-writer or pass to the current tar-extractor depending on content-type
- enhance current tar-extractor consumer to consider the content-type (if passed) before extracting
The current code that leans on pkg/extract/tar.go to handle tar files should be sufficient for actual extraction, but we need to make it so we can extract tar files (if they exist) in multifile mode when asked to do so. Multifile mode may have multiple tar files, some tar files, or a mix of tar and non-tar files.
I am open alternate solutions to what I've typed above. If you have additional thoughts on how to better handle the tar extraction -- I'm totally open to that!
Thank you for the clarification. I'll start the work on this issue now. Can you assigned this issue to me?