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

Add unsquashfs utility to lib #354

Open
lovesegfault opened this issue Nov 17, 2023 · 4 comments · May be fixed by #389
Open

Add unsquashfs utility to lib #354

lovesegfault opened this issue Nov 17, 2023 · 4 comments · May be fixed by #389
Labels
A-backhand-cli C-enhancement New feature or request

Comments

@lovesegfault
Copy link

Currently, if you want to replace a std::process::Command::new("unsquashfs") call with backhand, you need to replicate a large portion of the code in backhand-cli's unsquashfs bin.

It would be nice if the functionality of extracting a squashfs into a dir was provided by the library.

@wcampbell0x2a
Copy link
Owner

Surely. I already have backhand-cli for the next release, I could just extract the cli as-a- llibrary.

@lovesegfault
Copy link
Author

I wanted to try my hand at this, what would you prefer:

  1. Adding the utility to backhand's lib (will increase dependency closure)
  2. Adding it to backhand under a helpers feature
  3. Adding it in a new backhand-helpers crate

@wcampbell0x2a
Copy link
Owner

I haven't thought much about where the code would be, or what the API would be. But I expect the duplication to be the most between this package and backhand-cli. I fact, maybe just have the code be in that package, just as the lib.rs.

@wcampbell0x2a
Copy link
Owner

The API would mostly have the main of the bins, with the Clap argument structs as arguments? Just thinking out loud.

@lovesegfault lovesegfault linked a pull request Dec 18, 2023 that will close this issue
lovesegfault added a commit to lovesegfault/backhand that referenced this issue Dec 18, 2023
This is mostly a copy from `backhand-cli`'s `unsquashfs`, but with all
the args/progress handling removed and more thorough error handling.

Due to the dependency on `rayon`, the utility is currently gated behind
the `util` feature of `backhand`.

I tried also gating the `nix` dependency on the feature, but it was hard
due to it showing up in `BackhandError`.

Fixes: wcampbell0x2a#354
lovesegfault added a commit to lovesegfault/backhand that referenced this issue Dec 18, 2023
This is mostly a copy from `backhand-cli`'s `unsquashfs`, but with all
the args/progress handling removed and more thorough error handling.

Due to the dependency on `rayon`, the utility is currently gated behind
the `util` feature of `backhand`.

I tried also gating the `nix` dependency on the feature, but it was hard
due to it showing up in `BackhandError`.

Fixes: wcampbell0x2a#354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backhand-cli C-enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants