Move handling of multiple recipes into cook

This commit is contained in:
bjorn3 2025-09-02 20:52:44 +02:00
parent 7388bc9d01
commit 13d9e4794f
3 changed files with 13 additions and 21 deletions

View File

@ -6,10 +6,7 @@ source config.sh
recipes=""
for arg in "${@:1}"
do
if [ "$arg" == "--nonstop" ]
then
set +e
elif [ "$arg" == "--offline" ]
if [ "$arg" == "--offline" ]
then
export COOKBOOK_OFFLINE="1"
else
@ -17,7 +14,4 @@ do
fi
done
for recipe_name in $recipes
do
target/release/cook --fetch-only "$recipe_name"
done
target/release/cook --fetch-only $recipes

12
repo.sh
View File

@ -12,15 +12,12 @@ do
if [ "$arg" == "--appstream" ]
then
APPSTREAM="1"
elif [ "$arg" == "--debug" ]
then
DEBUG=--debug
elif [ "$arg" == "--with-package-deps" ]
then
COOK_OPT=--with-package-deps
COOK_OPT+=" --with-package-deps"
elif [ "$arg" == "--nonstop" ]
then
set +e
COOK_OPT+=" --nonstop"
elif [ "$arg" == "--offline" ]
then
export COOKBOOK_OFFLINE="1"
@ -29,10 +26,7 @@ do
fi
done
for recipe in $recipes
do
target/release/cook $COOK_OPT "$recipe"
done
target/release/cook $COOK_OPT $recipes
repo="$ROOT/repo/$TARGET"
mkdir -p "$repo"

View File

@ -928,7 +928,7 @@ EOF
-Wno-dev \
"${COOKBOOK_CMAKE_FLAGS[@]}" \
"$@"
"${COOKBOOK_NINJA}" -j"${COOKBOOK_MAKE_JOBS}"
DESTDIR="${COOKBOOK_STAGE}" "${COOKBOOK_NINJA}" install -j"${COOKBOOK_MAKE_JOBS}"
}
@ -996,7 +996,7 @@ function cookbook_meson {
let post_script = r#"# Common post script
# Strip binaries
for dir in "${COOKBOOK_STAGE}/bin" "${COOKBOOK_STAGE}/usr/bin"
for dir in "${COOKBOOK_STAGE}/bin" "${COOKBOOK_STAGE}/usr/bin"
do
if [ -d "${dir}" ] && [ -z "${COOKBOOK_NOSTRIP}" ]
then
@ -1005,7 +1005,7 @@ do
done
# Remove libtool files
for dir in "${COOKBOOK_STAGE}/lib" "${COOKBOOK_STAGE}/usr/lib"
for dir in "${COOKBOOK_STAGE}/lib" "${COOKBOOK_STAGE}/usr/lib"
do
if [ -d "${dir}" ]
then
@ -1282,6 +1282,7 @@ fn main() {
let mut fetch_only = false;
let mut with_package_deps = false;
let mut quiet = false;
let mut nonstop = false;
let mut recipe_names = Vec::new();
for arg in env::args().skip(1) {
match arg.as_str() {
@ -1290,6 +1291,7 @@ fn main() {
"--with-package-deps" if matching => with_package_deps = true,
"--fetch-only" if matching => fetch_only = true,
"-q" | "--quiet" if matching => quiet = true,
"--nonstop" => nonstop = true,
_ => recipe_names.push(arg.try_into().expect("Invalid package name")),
}
}
@ -1370,7 +1372,9 @@ fn main() {
style::Reset,
err,
);
process::exit(1);
if !nonstop {
process::exit(1);
}
}
}
}