From: Steven Fackler Date: Thu, 21 Dec 2017 21:58:49 +0000 (-0800) Subject: Untar into the right dir when verifying X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~4^2~9^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c4565a63114f43e4f64ab15ae2b566e11f0b52db;p=cargo.git Untar into the right dir when verifying We'd previously dump it in the package's directory which is wrong when working in a workspace. Closes #4304 --- diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index c09d786ff..84a20c641 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -82,7 +82,7 @@ pub fn package(ws: &Workspace, })?; if opts.verify { dst.seek(SeekFrom::Start(0))?; - run_verify(ws, dst.file(), opts).chain_err(|| { + run_verify(ws, &dst, opts).chain_err(|| { "failed to verify package tarball" })? } @@ -276,15 +276,14 @@ fn tar(ws: &Workspace, Ok(()) } -fn run_verify(ws: &Workspace, tar: &File, opts: &PackageOpts) -> CargoResult<()> { +fn run_verify(ws: &Workspace, tar: &FileLock, opts: &PackageOpts) -> CargoResult<()> { let config = ws.config(); let pkg = ws.current()?; config.shell().status("Verifying", pkg)?; - let f = GzDecoder::new(tar)?; - let dst = pkg.root().join(&format!("target/package/{}-{}", - pkg.name(), pkg.version())); + 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)?; }