More stuff, didn't test
This commit is contained in:
+8
-13
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user