pull: extract orig tarball as well on archive download
Some checks failed
CI / build (push) Failing after 7m50s
Some checks failed
CI / build (push) Failing after 7m50s
This commit is contained in:
18
src/pull.rs
18
src/pull.rs
@@ -329,6 +329,24 @@ async fn fetch_archive_sources(
|
||||
std::fs::remove_file(&path)?;
|
||||
}
|
||||
|
||||
// Extract the orig tarball if present and not native package
|
||||
if !info.is_native()
|
||||
&& let Some(orig_file) = info
|
||||
.stanza
|
||||
.files
|
||||
.iter()
|
||||
.find(|f| f.name.contains(".orig.tar."))
|
||||
{
|
||||
let path = package_dir.join(&orig_file.name);
|
||||
let extract_dir = package_dir.join(&info.stanza.package);
|
||||
|
||||
if (orig_file.name.ends_with(".tar.xz") || orig_file.name.ends_with(".tar.gz"))
|
||||
&& let Err(e) = extract_archive(&path, &extract_dir)
|
||||
{
|
||||
return Err(format!("Failed to extract {}: {}", orig_file.name, e).into());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user