-
Notifications
You must be signed in to change notification settings - Fork 19
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
crate source verification #110
Comments
might get away with checking if any files contained inside the extracted sources are newer than downloaded source archive (.crate) |
compare in-zip file against local source cache https://rust-lang-nursery.github.io/rust-cookbook/compression/tar.html use flate2::read::GzDecoder;
use std::fs::File;
use tar::Archive;
fn main() -> Result<(), std::io::Error> {
let path = "datetime-0.5.2.crate";
let tar_gz = File::open(path)?;
let tar = GzDecoder::new(tar_gz);
let mut archive = Archive::new(tar);
let files = archive.entries()?;
files.into_iter().for_each(|f| {
let file = f.unwrap();
// println!("{}", file.path().unwrap().display());
// println!("{:?}", file.header());
// print the file name and the size
println!("{}, {} bytes", file.path().unwrap().display(), file.size());
});
Ok(())
} |
For the git source, we can go into checkouts, for instance: |
still missing: git checkout verification, check something like |
It would be interesting if
cargo-cache
could find local extracted sources that differ from the contents of the respective .xz /.crate archives.EDIT: idea dump:
git fsck
all git repos (already implemented:--fsck
) todo: parallelize.crate
archives and make sure they are ok (not sure if this is needed since cargo would complain anyway I guess..?).crate
into a temp dir and compare hash sums / diffs of files, there might also be a ton of unexpected problems)The text was updated successfully, but these errors were encountered: