More stuff, didn't test

This commit is contained in:
Marvin Friedrich
2026-05-19 18:12:11 +02:00
parent b71906f402
commit 312750c61b
32 changed files with 978 additions and 170 deletions
+8 -13
View File
@@ -111,21 +111,16 @@ impl<'a> Layout<'a> {
}
pub fn recipe_patches(&self, recipe: &Recipe) -> anyhow::Result<Vec<PathBuf>> {
let patches_dir = recipe.dir().join("patches");
if !patches_dir.exists() {
let Some(data_dir) = recipe.data_dir() else {
return Ok(Vec::new());
}
let mut patches = Vec::new();
for entry in fs::read_dir(&patches_dir)
.with_context(|| format!("reading patches directory {}", patches_dir.display()))?
{
let entry = entry?;
let path = entry.path();
if path.is_file() {
patches.push(path);
};
let patches_dir = data_dir.join("patches");
let mut out = Vec::new();
for (_, source) in recipe.sources().entries() {
for name in source.patches() {
out.push(patches_dir.join(name));
}
}
patches.sort();
Ok(patches)
Ok(out)
}
}