summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-04 01:13:09 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-04 01:16:43 +0200
commit1896ea04204b8086a4f25e257dc5605e5505d768 (patch)
tree694b5298958c0152ce4fe58c42f864980fd6b9df
parentaa914e75251af3f9691be621a8c266320158bace (diff)
downloadrebel-1896ea04204b8086a4f25e257dc5605e5505d768.tar
rebel-1896ea04204b8086a4f25e257dc5605e5505d768.zip
driver: recipe: move each recipe into a separate directory
-rw-r--r--crates/driver/src/recipe.rs14
-rw-r--r--examples/recipes/bar/build.yml (renamed from examples/recipes/bar.yml)0
-rw-r--r--examples/recipes/binutils/build.yml (renamed from examples/recipes/binutils.yml)0
-rw-r--r--examples/recipes/busybox/build.yml (renamed from examples/recipes/busybox.yml)0
-rw-r--r--examples/recipes/e2fsprogs/build.yml (renamed from examples/recipes/e2fsprogs.yml)0
-rw-r--r--examples/recipes/foo/build.yml (renamed from examples/recipes/foo.yml)0
-rw-r--r--examples/recipes/gcc-libs/build.yml (renamed from examples/recipes/gcc-libs.yml)0
-rw-r--r--examples/recipes/gcc/build.yml (renamed from examples/recipes/gcc.yml)0
-rw-r--r--examples/recipes/glibc/build.yml (renamed from examples/recipes/glibc.yml)0
-rw-r--r--examples/recipes/gmp/build.yml (renamed from examples/recipes/gmp.yml)0
-rw-r--r--examples/recipes/image/build.yml (renamed from examples/recipes/image.yml)0
-rw-r--r--examples/recipes/libgcc-initial/build.yml (renamed from examples/recipes/libgcc-initial.yml)0
-rw-r--r--examples/recipes/libgcc/build.yml (renamed from examples/recipes/libgcc.yml)0
-rw-r--r--examples/recipes/linux-uapi-headers/build.yml (renamed from examples/recipes/linux-uapi-headers.yml)0
-rw-r--r--examples/recipes/linux/build.yml (renamed from examples/recipes/linux.yml)0
-rw-r--r--examples/recipes/ls/build.yml (renamed from examples/recipes/ls.yml)0
-rw-r--r--examples/recipes/make_ext4fs/build.yml (renamed from examples/recipes/make_ext4fs.yml)0
-rw-r--r--examples/recipes/mpc/build.yml (renamed from examples/recipes/mpc.yml)0
-rw-r--r--examples/recipes/mpfr/build.yml (renamed from examples/recipes/mpfr.yml)0
-rw-r--r--examples/recipes/toolchain/build.yml (renamed from examples/recipes/toolchain.yml)0
-rw-r--r--examples/recipes/zlib/build.yml (renamed from examples/recipes/zlib.yml)0
21 files changed, 9 insertions, 5 deletions
diff --git a/crates/driver/src/recipe.rs b/crates/driver/src/recipe.rs
index ec1c116..3a033f1 100644
--- a/crates/driver/src/recipe.rs
+++ b/crates/driver/src/recipe.rs
@@ -1,4 +1,4 @@
-use std::{collections::HashMap, fs::File, path::Path, result};
+use std::{collections::HashMap, ffi::OsStr, fs::File, path::Path, result};
use scoped_tls_hkt::scoped_thread_local;
use serde::{Deserialize, Deserializer};
@@ -47,8 +47,8 @@ fn read_recipe(path: &Path) -> Result<Recipe> {
Ok(recipe)
}
-fn is_yml(path: &Path) -> bool {
- path.extension() == Some("yml".as_ref())
+fn is_recipe(path: &Path) -> bool {
+ path.file_name().unwrap_or_default() == "build.yml"
}
pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<HashMap<TaskID, Vec<TaskDef>>> {
@@ -60,11 +60,15 @@ pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<HashMap<TaskID, Vec<TaskD
.filter_map(|e| e.ok())
{
let path = entry.path();
- if !path.is_file() || !is_yml(path) {
+ if !path.is_file() || !is_recipe(path) {
continue;
}
- let Some(Some(basename)) = path.file_stem().map(|n| n.to_str()) else {
+ let Some(basename) = path
+ .parent()
+ .and_then(Path::file_name)
+ .and_then(OsStr::to_str)
+ else {
continue;
};
diff --git a/examples/recipes/bar.yml b/examples/recipes/bar/build.yml
index f25322e..f25322e 100644
--- a/examples/recipes/bar.yml
+++ b/examples/recipes/bar/build.yml
diff --git a/examples/recipes/binutils.yml b/examples/recipes/binutils/build.yml
index fb69750..fb69750 100644
--- a/examples/recipes/binutils.yml
+++ b/examples/recipes/binutils/build.yml
diff --git a/examples/recipes/busybox.yml b/examples/recipes/busybox/build.yml
index 273ceb5..273ceb5 100644
--- a/examples/recipes/busybox.yml
+++ b/examples/recipes/busybox/build.yml
diff --git a/examples/recipes/e2fsprogs.yml b/examples/recipes/e2fsprogs/build.yml
index 5c916dc..5c916dc 100644
--- a/examples/recipes/e2fsprogs.yml
+++ b/examples/recipes/e2fsprogs/build.yml
diff --git a/examples/recipes/foo.yml b/examples/recipes/foo/build.yml
index 2982795..2982795 100644
--- a/examples/recipes/foo.yml
+++ b/examples/recipes/foo/build.yml
diff --git a/examples/recipes/gcc-libs.yml b/examples/recipes/gcc-libs/build.yml
index 2f566b8..2f566b8 100644
--- a/examples/recipes/gcc-libs.yml
+++ b/examples/recipes/gcc-libs/build.yml
diff --git a/examples/recipes/gcc.yml b/examples/recipes/gcc/build.yml
index 4931052..4931052 100644
--- a/examples/recipes/gcc.yml
+++ b/examples/recipes/gcc/build.yml
diff --git a/examples/recipes/glibc.yml b/examples/recipes/glibc/build.yml
index 20e2363..20e2363 100644
--- a/examples/recipes/glibc.yml
+++ b/examples/recipes/glibc/build.yml
diff --git a/examples/recipes/gmp.yml b/examples/recipes/gmp/build.yml
index f2585c2..f2585c2 100644
--- a/examples/recipes/gmp.yml
+++ b/examples/recipes/gmp/build.yml
diff --git a/examples/recipes/image.yml b/examples/recipes/image/build.yml
index 3f6d8f3..3f6d8f3 100644
--- a/examples/recipes/image.yml
+++ b/examples/recipes/image/build.yml
diff --git a/examples/recipes/libgcc-initial.yml b/examples/recipes/libgcc-initial/build.yml
index 81cacfd..81cacfd 100644
--- a/examples/recipes/libgcc-initial.yml
+++ b/examples/recipes/libgcc-initial/build.yml
diff --git a/examples/recipes/libgcc.yml b/examples/recipes/libgcc/build.yml
index d7433fe..d7433fe 100644
--- a/examples/recipes/libgcc.yml
+++ b/examples/recipes/libgcc/build.yml
diff --git a/examples/recipes/linux-uapi-headers.yml b/examples/recipes/linux-uapi-headers/build.yml
index 3fadccd..3fadccd 100644
--- a/examples/recipes/linux-uapi-headers.yml
+++ b/examples/recipes/linux-uapi-headers/build.yml
diff --git a/examples/recipes/linux.yml b/examples/recipes/linux/build.yml
index 53a0bd7..53a0bd7 100644
--- a/examples/recipes/linux.yml
+++ b/examples/recipes/linux/build.yml
diff --git a/examples/recipes/ls.yml b/examples/recipes/ls/build.yml
index 633336d..633336d 100644
--- a/examples/recipes/ls.yml
+++ b/examples/recipes/ls/build.yml
diff --git a/examples/recipes/make_ext4fs.yml b/examples/recipes/make_ext4fs/build.yml
index f77fde4..f77fde4 100644
--- a/examples/recipes/make_ext4fs.yml
+++ b/examples/recipes/make_ext4fs/build.yml
diff --git a/examples/recipes/mpc.yml b/examples/recipes/mpc/build.yml
index 0d17661..0d17661 100644
--- a/examples/recipes/mpc.yml
+++ b/examples/recipes/mpc/build.yml
diff --git a/examples/recipes/mpfr.yml b/examples/recipes/mpfr/build.yml
index 2c87912..2c87912 100644
--- a/examples/recipes/mpfr.yml
+++ b/examples/recipes/mpfr/build.yml
diff --git a/examples/recipes/toolchain.yml b/examples/recipes/toolchain/build.yml
index ab8e6de..ab8e6de 100644
--- a/examples/recipes/toolchain.yml
+++ b/examples/recipes/toolchain/build.yml
diff --git a/examples/recipes/zlib.yml b/examples/recipes/zlib/build.yml
index 65c0d19..65c0d19 100644
--- a/examples/recipes/zlib.yml
+++ b/examples/recipes/zlib/build.yml