0.1.6 - fix extraction with multiple matching hashes

parent 4a939611
[package]
name = "pkgar"
version = "0.1.5"
version = "0.1.6"
description = "Redox Package Archive"
license = "MIT"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
......
......@@ -262,7 +262,12 @@ pub fn extract(public_path: &str, archive_path: &str, folder: &str) -> Result<()
}
let entry_hash = Hash::from(entry.hash());
let temp_name = format!(".pkgar.{}", entry_hash.to_hex());
let temp_name = if let Some(file_name) = entry_path.file_name().and_then(|x| x.to_str())
{
format!(".pkgar.{}", file_name)
} else {
format!(".pkgar.{}", entry_hash.to_hex())
};
let temp_path = if let Some(parent) = entry_path.parent() {
fs::create_dir_all(parent)
.map_err(Error::Io)?;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment