mirror of
https://github.com/rust-lang/cargo
synced 2024-07-05 01:19:13 +00:00
Upgrade flate2 crate to 1.0
Unblocks rust#46278.
This commit is contained in:
parent
67e80336f7
commit
33fbc02424
|
@ -26,7 +26,7 @@ docopt = "0.8.1"
|
|||
env_logger = "0.4"
|
||||
failure = "0.1.1"
|
||||
filetime = "0.1"
|
||||
flate2 = "0.2"
|
||||
flate2 = "1.0"
|
||||
fs2 = "0.4"
|
||||
git2 = "0.6"
|
||||
git2-curl = "0.7"
|
||||
|
|
|
@ -196,7 +196,7 @@ fn tar(ws: &Workspace,
|
|||
// Prepare the encoder and its header
|
||||
let filename = Path::new(filename);
|
||||
let encoder = GzBuilder::new().filename(util::path2bytes(filename)?)
|
||||
.write(dst, Compression::Best);
|
||||
.write(dst, Compression::best());
|
||||
|
||||
// Put all package files into a compressed archive
|
||||
let mut ar = Builder::new(encoder);
|
||||
|
@ -282,7 +282,7 @@ fn run_verify(ws: &Workspace, tar: &FileLock, opts: &PackageOpts) -> CargoResult
|
|||
|
||||
config.shell().status("Verifying", pkg)?;
|
||||
|
||||
let f = GzDecoder::new(tar.file())?;
|
||||
let f = GzDecoder::new(tar.file());
|
||||
let dst = tar.parent().join(&format!("{}-{}", pkg.name(), pkg.version()));
|
||||
if fs::metadata(&dst).is_ok() {
|
||||
fs::remove_dir_all(&dst)?;
|
||||
|
|
|
@ -323,7 +323,7 @@ impl<'cfg> RegistrySource<'cfg> {
|
|||
return Ok(dst)
|
||||
}
|
||||
|
||||
let gz = GzDecoder::new(tarball.file())?;
|
||||
let gz = GzDecoder::new(tarball.file());
|
||||
let mut tar = Archive::new(gz);
|
||||
let prefix = dst.file_name().unwrap();
|
||||
let parent = dst.parent().unwrap();
|
||||
|
|
|
@ -47,7 +47,7 @@ fn simple_cross_package() {
|
|||
|
||||
// Check that the tarball contains the files
|
||||
let f = File::open(&p.root().join("target/package/foo-0.0.0.crate")).unwrap();
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
|
|
@ -54,7 +54,7 @@ src[/]main.rs
|
|||
execs().with_status(0).with_stdout(""));
|
||||
|
||||
let f = File::open(&p.root().join("target/package/foo-0.0.1.crate")).unwrap();
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
@ -531,7 +531,7 @@ src[..]main.rs
|
|||
execs().with_status(0).with_stdout(""));
|
||||
|
||||
let f = File::open(&p.root().join("target/package/nested-0.0.1.crate")).unwrap();
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
@ -617,7 +617,7 @@ See [..]
|
|||
|
||||
// Check that the tarball contains the added file
|
||||
let f = File::open(&p.root().join("target/package/foo-0.0.1.crate")).unwrap();
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
@ -748,7 +748,7 @@ fn generated_manifest() {
|
|||
execs().with_status(0));
|
||||
|
||||
let f = File::open(&p.root().join("target/package/foo-0.0.1.crate")).unwrap();
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
@ -827,7 +827,7 @@ fn ignore_workspace_specifier() {
|
|||
execs().with_status(0));
|
||||
|
||||
let f = File::open(&p.root().join("target/package/bar-0.1.0.crate")).unwrap();
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
|
|
@ -54,8 +54,8 @@ See [..]
|
|||
f.seek(SeekFrom::Current(sz as i64 + 4)).unwrap();
|
||||
|
||||
// Verify the tarball
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
assert_eq!(rdr.header().filename().unwrap(), b"foo-0.0.1.crate");
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
assert_eq!(rdr.header().unwrap().filename().unwrap(), b"foo-0.0.1.crate");
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
@ -121,8 +121,8 @@ See [..]
|
|||
f.seek(SeekFrom::Current(sz as i64 + 4)).unwrap();
|
||||
|
||||
// Verify the tarball
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
assert_eq!(rdr.header().filename().unwrap(), "foo-0.0.1.crate".as_bytes());
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
assert_eq!(rdr.header().unwrap().filename().unwrap(), "foo-0.0.1.crate".as_bytes());
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
@ -189,8 +189,8 @@ See [..]
|
|||
f.seek(SeekFrom::Current(sz as i64 + 4)).unwrap();
|
||||
|
||||
// Verify the tarball
|
||||
let mut rdr = GzDecoder::new(f).unwrap();
|
||||
assert_eq!(rdr.header().filename().unwrap(), "foo-0.0.1.crate".as_bytes());
|
||||
let mut rdr = GzDecoder::new(f);
|
||||
assert_eq!(rdr.header().unwrap().filename().unwrap(), "foo-0.0.1.crate".as_bytes());
|
||||
let mut contents = Vec::new();
|
||||
rdr.read_to_end(&mut contents).unwrap();
|
||||
let mut ar = Archive::new(&contents[..]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user