mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-07-01 09:08:42 +08:00
Run cookbook rust version for fetch, if possible
This commit is contained in:
parent
4961de867c
commit
0265403146
6
fetch.sh
6
fetch.sh
@ -12,5 +12,11 @@ fi
|
||||
|
||||
for recipe in $recipes
|
||||
do
|
||||
if [ -e "recipes/$recipe/recipe.toml" ]
|
||||
then
|
||||
target/release/cook --fetch-only "$recipe"
|
||||
continue
|
||||
fi
|
||||
|
||||
./cook.sh "$recipe" fetch
|
||||
done
|
||||
|
||||
@ -557,12 +557,14 @@ fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Resu
|
||||
Ok(package_file)
|
||||
}
|
||||
|
||||
fn cook(recipe_dir: &Path, recipe: &Recipe) -> Result<(), String> {
|
||||
fn cook(recipe_dir: &Path, recipe: &Recipe, fetch_only: bool) -> Result<(), String> {
|
||||
let source_dir = fetch(&recipe_dir, &recipe.source).map_err(|err| format!(
|
||||
"failed to fetch: {}",
|
||||
err
|
||||
))?;
|
||||
|
||||
if fetch_only { return Ok(()); }
|
||||
|
||||
let stage_dir = build(&recipe_dir, &source_dir, &recipe.build).map_err(|err| format!(
|
||||
"failed to build: {}",
|
||||
err
|
||||
@ -658,12 +660,14 @@ impl CookRecipe {
|
||||
fn main() {
|
||||
let mut matching = true;
|
||||
let mut dry_run = false;
|
||||
let mut fetch_only = false;
|
||||
let mut quiet = false;
|
||||
let mut recipe_names = Vec::new();
|
||||
for arg in env::args().skip(1) {
|
||||
match arg.as_str() {
|
||||
"--" if matching => matching = false,
|
||||
"-d" | "--dry-run" if matching => dry_run = true,
|
||||
"--fetch-only" if matching => fetch_only = true,
|
||||
"-q" | "--quiet" if matching => quiet = true,
|
||||
_ => recipe_names.push(arg),
|
||||
}
|
||||
@ -702,7 +706,7 @@ fn main() {
|
||||
}
|
||||
Ok(())
|
||||
} else {
|
||||
cook(&recipe.dir, &recipe.recipe)
|
||||
cook(&recipe.dir, &recipe.recipe, fetch_only)
|
||||
};
|
||||
|
||||
match res {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user