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<()> {
|
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()?;
|
let output = std::process::Command::new("tar").args(&args).output()?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
warn!(
|
warn!(
|
||||||
|
@ -1263,10 +1263,11 @@ impl Blockstore {
|
||||||
let f = fs::File::open(path);
|
let f = fs::File::open(path);
|
||||||
if f.is_err() {
|
if f.is_err() {
|
||||||
if let Some(archive) = tgz {
|
if let Some(archive) = tgz {
|
||||||
Self::extract_data(archive, shred_path)
|
if Path::new(archive).is_file() {
|
||||||
} else {
|
return Self::extract_data(archive, shred_path);
|
||||||
Ok(None)
|
}
|
||||||
}
|
}
|
||||||
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
let mut buf = vec![];
|
let mut buf = vec![];
|
||||||
f?.read_to_end(&mut buf)?;
|
f?.read_to_end(&mut buf)?;
|
||||||
|
|
Loading…
Reference in New Issue