Untar is called for shred archives that do not exist. (#9565)
automerge
This commit is contained in:
parent
addbdcb660
commit
729cb5eec6
|
@ -344,7 +344,7 @@ impl Blockstore {
|
|||
}
|
||||
|
||||
fn tar_dir(dir: String, archive: String) -> Result<()> {
|
||||
let args = ["cfz", &archive, &dir];
|
||||
let args = ["cfzP", &archive, &dir];
|
||||
let output = std::process::Command::new("tar").args(&args).output()?;
|
||||
if !output.status.success() {
|
||||
warn!(
|
||||
|
@ -1263,10 +1263,11 @@ impl Blockstore {
|
|||
let f = fs::File::open(path);
|
||||
if f.is_err() {
|
||||
if let Some(archive) = tgz {
|
||||
Self::extract_data(archive, shred_path)
|
||||
} else {
|
||||
Ok(None)
|
||||
if Path::new(archive).is_file() {
|
||||
return Self::extract_data(archive, shred_path);
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
} else {
|
||||
let mut buf = vec![];
|
||||
f?.read_to_end(&mut buf)?;
|
||||
|
|
Loading…
Reference in New Issue