fn unpack_package(&self, pkg: &PackageId, tarball: PathBuf)
                      -> CargoResult<PathBuf> {
        let dst = self.src_path.join(&format!("{}-{}", pkg.name(),
                                              pkg.version()));
        if fs::metadata(&dst.join(".cargo-ok")).is_ok() { return Ok(dst) }

        try!(fs::create_dir_all(dst.parent().unwrap()));
        let f = try!(File::open(&tarball));
        let gz = try!(GzDecoder::new(f));
        let mut tar = Archive::new(gz);
        try!(tar.unpack(dst.parent().unwrap()));
        try!(File::create(&dst.join(".cargo-ok")));
        Ok(dst)
    }
/// Unpacks a downloaded package into a location where it's ready to be
/// compiled.
///
/// No action is taken if the source looks like it's already unpacked.
Unpacks a downloaded package into a location where it's ready to be
compiled.

No action is taken if the source looks like it's already unpacked.
Unpacks a downloaded package into a location where it ' s ready to be compiled . No action is taken if the source looks like it ' s already unpacked .
fn unpack_package(&self, pkg: &PackageId, tarball: PathBuf)
                      -> CargoResult<PathBuf> {
        let dst = self.src_path.join(&format!("{}-{}", pkg.name(),
                                              pkg.version()));
        if fs::metadata(&dst.join(".cargo-ok")).is_ok() { return Ok(dst) }
        try!(fs::create_dir_all(dst.parent().unwrap()));
        let f = try!(File::open(&tarball));
        let gz = try!(GzDecoder::new(f));
        let mut tar = Archive::new(gz);
        try!(tar.unpack(dst.parent().unwrap()));
        try!(File::create(&dst.join(".cargo-ok")));
        Ok(dst)
    }
fn unpack_package ( & self , pkg : & PackageId , tarball : PathBuf ) -> CargoResult < PathBuf > { let dst = self . src_path . join ( & format ! ( " " pkg name ( ) pkg version ( ) ) ) ; if fs :: metadata ( & dst . join ( " " ) ) . is_ok ( ) { return Ok ( dst ) } try ! ( fs create_dir_all ( dst parent ( ) unwrap ( ) ) ) ; let f = try ! ( File open ( tarball ) ) ; let gz = try ! ( GzDecoder new ( f ) ) ; let mut tar = Archive :: new ( gz ) ; try ! ( tar unpack ( dst parent ( ) unwrap ( ) ) ) ; try ! ( File create ( dst join ( " " ) ) ) ; Ok ( dst ) }
Unpacks a downloaded package into a location where it's ready to be
compiled.
Unpacks a downloaded package into a location where it ' s ready to be compiled .
&self
pkg
&PackageId
tarball
PathBuf
&self
pkg
&PackageId
tarball
PathBuf