mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
improve debug logging on extraction
This commit is contained in:
parent
87449e29e7
commit
7aaba5e1ee
1 changed files with 5 additions and 5 deletions
|
@ -50,7 +50,7 @@ pub fn extract<S: AsRef<Path>, P: AsRef<Path>>(source: S, fmt: PkgFmt, path: P)
|
||||||
match fmt {
|
match fmt {
|
||||||
PkgFmt::Tar => {
|
PkgFmt::Tar => {
|
||||||
// Extract to install dir
|
// Extract to install dir
|
||||||
debug!("Extracting from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
debug!("Extracting from tar archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||||
|
|
||||||
let dat = std::fs::File::open(source)?;
|
let dat = std::fs::File::open(source)?;
|
||||||
let mut tar = Archive::new(dat);
|
let mut tar = Archive::new(dat);
|
||||||
|
@ -59,7 +59,7 @@ pub fn extract<S: AsRef<Path>, P: AsRef<Path>>(source: S, fmt: PkgFmt, path: P)
|
||||||
},
|
},
|
||||||
PkgFmt::Tgz => {
|
PkgFmt::Tgz => {
|
||||||
// Extract to install dir
|
// Extract to install dir
|
||||||
debug!("Decompressing from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
debug!("Decompressing from tgz archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||||
|
|
||||||
let dat = std::fs::File::open(source)?;
|
let dat = std::fs::File::open(source)?;
|
||||||
let tar = GzDecoder::new(dat);
|
let tar = GzDecoder::new(dat);
|
||||||
|
@ -69,7 +69,7 @@ pub fn extract<S: AsRef<Path>, P: AsRef<Path>>(source: S, fmt: PkgFmt, path: P)
|
||||||
},
|
},
|
||||||
PkgFmt::Txz => {
|
PkgFmt::Txz => {
|
||||||
// Extract to install dir
|
// Extract to install dir
|
||||||
debug!("Decompressing from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
debug!("Decompressing from txz archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||||
|
|
||||||
let dat = std::fs::File::open(source)?;
|
let dat = std::fs::File::open(source)?;
|
||||||
let tar = XzDecoder::new(dat);
|
let tar = XzDecoder::new(dat);
|
||||||
|
@ -79,7 +79,7 @@ pub fn extract<S: AsRef<Path>, P: AsRef<Path>>(source: S, fmt: PkgFmt, path: P)
|
||||||
},
|
},
|
||||||
PkgFmt::Zip => {
|
PkgFmt::Zip => {
|
||||||
// Extract to install dir
|
// Extract to install dir
|
||||||
debug!("Decompressing from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
debug!("Decompressing from zip archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||||
|
|
||||||
let dat = std::fs::File::open(source)?;
|
let dat = std::fs::File::open(source)?;
|
||||||
let mut zip = ZipArchive::new(dat)?;
|
let mut zip = ZipArchive::new(dat)?;
|
||||||
|
@ -87,7 +87,7 @@ pub fn extract<S: AsRef<Path>, P: AsRef<Path>>(source: S, fmt: PkgFmt, path: P)
|
||||||
zip.extract(path)?;
|
zip.extract(path)?;
|
||||||
},
|
},
|
||||||
PkgFmt::Bin => {
|
PkgFmt::Bin => {
|
||||||
debug!("Copying data from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
debug!("Copying binary '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||||
// Copy to install dir
|
// Copy to install dir
|
||||||
std::fs::copy(source, path)?;
|
std::fs::copy(source, path)?;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue