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

Enhancement: multifile should optionally extract tar files (-x set) #103

Open
tempusfrangit opened this issue Dec 10, 2023 · 3 comments
Open
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@tempusfrangit
Copy link
Contributor

multifile should opportunistically extract tar files when -x is set. This means looking at the content-type and knowing what to do.

@tempusfrangit tempusfrangit added enhancement New feature or request good first issue Good for newcomers labels Dec 10, 2023
@tempusfrangit tempusfrangit added this to the 1.0.0 milestone Dec 10, 2023
@AtharvaWaghchoure
Copy link

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

@tempusfrangit
Copy link
Contributor Author

tempusfrangit commented Dec 11, 2023

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:

  1. 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
  1. 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!

@AtharvaWaghchoure
Copy link

AtharvaWaghchoure commented Dec 12, 2023

Thank you for the clarification.
I'll start the work on this issue now.
Can you assigned this issue to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants