# @adig, pkgar() function is basically a wrapper function that builds the pkgar binary, in cookbook/pkgar cargo package, and runs it with the passed arguments
# Sets some environment variables for cross compilation, most are same as the one in mk/config.mk but just to be sure they are declared, also checks whether `find` and `stat` are installed
source config.sh
recipes=""
# @adig config.packages.keys() pass kiya tha args me, to matlab jo recipes hamko install krna hai specifically sirf wo pass karenge
for arg in"${@:1}"
do
if["$arg"=="--debug"]
...
...
@@ -15,6 +17,7 @@ do
fi
done
# @adig We already populated recipes, but if `recipes` was empty, so it will be populated will names of all directories (which refer to the package names), in `recipes/` directory, ie. all package names
if["$recipes"==""]
then
recipes="$(ls-1 recipes)"
...
...
@@ -24,8 +27,10 @@ for recipe in $recipes
do
if[-e"recipes/$recipe/recipe.toml"]
then
# @adig In case $recipe/recipe.toml exist karta hai, to ham `cook` binary ka use karenge (code in cookbook/src/bin/cook.rs), cook.rs basically calls cook function, which 1. fetches, 2. builds, 3. packages the package based on recipe.toml config file for that specific packages
target/release/cook "$recipe"
# @adig Currently kisi bhi recipe me stage.tar.gz nahi hai, to ./cook.sh script will do the packaging, and compile a .pkgar file for each package