dumpfile: Add some test code to convert to tar#328
Merged
jeckersb merged 1 commit intocomposefs:mainfrom Sep 10, 2024
Merged
Conversation
a62554d to
a6117e1
Compare
jeckersb
requested changes
Sep 10, 2024
Collaborator
jeckersb
left a comment
There was a problem hiding this comment.
👍 Looks good to me, pretty straightforward, just a few nits from latest clippy (1.81), most important being the MSRV one:
warning: this import is redundant
--> rust/composefs/examples/cfs-dumpfile2tar.rs:14:1
|
14 | use composefs;
| ^^^^^^^^^^^^^^ help: remove it entirely
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
= note: `#[warn(clippy::single_component_path_imports)]` on by default
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> rust/composefs/examples/cfs-dumpfile2tar.rs:66:36
|
66 | pax_data.write_all(&value)?;
| ^^^^^^ help: change this to: `value`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
warning: useless conversion to the same type: `u64`
--> rust/composefs/examples/cfs-dumpfile2tar.rs:95:29
|
95 | let rdev: u64 = (*rdev).into();
| ^^^^^^^^^^^^^^ help: consider removing `.into()`: `(*rdev)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
warning: current MSRV (Minimum Supported Rust Version) is `1.70.0` but this item is stable since `1.77.0`
--> rust/composefs/examples/cfs-dumpfile2tar.rs:150:15
|
150 | let dst = File::create_new(dst)
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
= note: `#[warn(clippy::incompatible_msrv)]` on by default
warning: `composefs` (example "cfs-dumpfile2tar") generated 4 warnings (run `cargo clippy --fix --example "cfs-dumpfile2tar"` to apply 3 suggestions)
a6117e1 to
59dd785
Compare
Add code to go from dumpfile -> tar (notably, ignoring non-inline regular file content). This is *testing* only code right now, though clearly mapping to/from tar would be very useful in general. I plan to use this code for various testing purposes especially to *manually* create tarballs from various dumpfiles to e.g. feed directly to `mkfs.erofs` for example. But we at least get some sanity checking this way. Signed-off-by: Colin Walters <walters@verbum.org>
59dd785 to
0d80ba5
Compare
Contributor
Author
|
Good catch, I had to upgrade from 1.80 -> 1.81 to get that new clippy check. |
jeckersb
approved these changes
Sep 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add code to go from dumpfile -> tar (notably, ignoring non-inline regular file content). This is testing only code right now, though clearly mapping to/from tar would be very useful in general. I plan to use this code for various testing purposes especially to manually create tarballs from various dumpfiles to e.g. feed directly to
mkfs.erofsfor example.But we at least get some sanity checking this way.