Restore most scripts

This commit is contained in:
Wildan M 2026-07-29 11:18:53 +07:00
parent 67a88b9c76
commit 3e15ec059f
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
12 changed files with 53 additions and 43 deletions

View File

@ -67,7 +67,7 @@ endif
# Find recipe for one or more targets separated by comma
find.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
@$(PODMAN_RUN) make $@
else
@$(REPO_BIN) find $(foreach f,$(subst $(comma), ,$*),$(f))
endif

View File

@ -37,7 +37,7 @@ done
if [ -z "$recipes" ]
then
recipes="$(target/release/list_recipes)"
recipes="$(target/release/repo repo-list --all-compiled --display=path)"
fi
for recipe in $recipes
@ -45,7 +45,7 @@ do
if [[ "$recipe" == *\/* ]]
then
recipe_name="$(basename $recipe)"
recipe_path="recipes/$recipe"
recipe_path="$recipe"
else
recipe_name="$recipe"
recipe_path="$(target/release/repo find $recipe_name)"

9
scripts/open-recipe.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# This script open the recipe configuration files with chosen EDITOR env, or chosen by "open" cli.
# This script must be launched outside podman
EDITOR=${EDITOR:-open}
$EDITOR $(make find.$1)/recipe.toml

View File

@ -1,30 +1,13 @@
#!/usr/bin/env bash
# This script show the package size of the recipes ("stage.pkgar" and "stage.tar.gz")
# This script show all or some package size of the recipes ("stage.pkgar")
# It must be used by package maintainers to enforce the library linking size policy
if [ $# = 0 ]
then
find recipes \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
exit 0
fi
# This script must be inside podman `make env`
for recipe in $@
RECIPES=$(target/release/repo cook-list ${*:---all-compiled} --display=csv | grep ",Built" | sort -t ',' -k 3 -V | cut -d ',' -f2)
TARGET=$(target/release/cookbook_redoxer --target)
for recipe in $RECIPES
do
if [ "$recipe" = "-h" ] || [ "$recipe" = "--help" ]
then
echo "Usage: $0 [recipe] ..."
echo " For the recipe(s), prints the size of 'stage.pkgar' and 'stage.tar.gz'."
echo " If no recipe is given, then all packages are listed."
exit 0
fi
recipe_paths=$(find recipes -name $recipe)
for recipe_path in $recipe_paths
do
if [ -f "$recipe_path/recipe.toml" ] || [ -f "$recipe_path/recipe.sh" ]
then
find "$recipe_path" \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
fi
done
done
ls -hs "$recipe/target/$TARGET/stage.pkgar"
done

View File

@ -2,4 +2,4 @@
# This script print the recipe configuration
cat $(target/release/repo find "$1")/recipe.*
cat $(make find.$1)/recipe.toml

View File

@ -1,8 +1,6 @@
#!/usr/bin/env bash
FIND_RECIPE="find recipes -maxdepth 4 -name"
# Return list of paths from recipes
for recipe in $*
do
${FIND_RECIPE} "${recipe}"
done
IFS=","
make "find.$*"

View File

@ -3,5 +3,6 @@
# This script generates build/relibc-doc and build/relibc-doc.tar.gz
rm -rf build/relibc-doc build/relibc-doc.tar.gz
make ri.relibc-doc DESTDIR=./build/relibc-doc
mkdir -p build/relibc-doc
make ri.relibc-doc DESTDIR=./build/relibc-doc CI=1
tar -czvf ./build/relibc-doc.tar.gz ./build/relibc-doc/usr/share/doc/relibc/

View File

@ -11,7 +11,7 @@ then
exit 1
fi
find_recipe="target/release/find_recipe"
find_recipe="target/release/repo"
if [ ! -x "$find_recipe" ]
then
echo "$find_recipe not found."
@ -21,6 +21,6 @@ fi
for recipe in $*
do
recipe_dir="$("$find_recipe" "$recipe")"
recipe_dir="$("$find_recipe" find "$recipe")"
ls -1 "$recipe_dir/target"/*/{stage,sysroot}
done

9
scripts/unused-libs.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# This script show all unused packages in given category, or "wip/libs" by default.
# This script must be inside podman `make env`
CATEGORY=${1:-wip/libs}
target/release/repo cook-list --all --display=csv | grep ",$" | grep ",recipes/$CATEGORY" | cut -d ',' -f2

View File

@ -14,5 +14,10 @@ fn main() {
}
}
}
redoxer::main(&args);
match args[1].as_str() {
"--target" => println!("{}", redoxer::target()),
"--gnu-target" => println!("{}", redoxer::gnu_target()),
"--host-target" => println!("{}", redoxer::host_target()),
_ => redoxer::main(&args),
}
}

View File

@ -173,9 +173,9 @@ impl FromStr for CliCommand {
"clean" => Ok(CliCommand::Clean),
"clean-target" => Ok(CliCommand::CleanTarget),
"push" => Ok(CliCommand::Push),
"repo-tree" => Ok(CliCommand::RepoList),
"push-tree" => Ok(CliCommand::PushList),
"cook-tree" => Ok(CliCommand::CookList),
"repo-list" => Ok(CliCommand::RepoList),
"push-list" => Ok(CliCommand::PushList),
"cook-list" => Ok(CliCommand::CookList),
// alias for scripts
"find" => Ok(CliCommand::RepoList),
"capture-rev" => Ok(CliCommand::CaptureRev),
@ -195,9 +195,9 @@ impl ToString for CliCommand {
CliCommand::Clean => "clean".to_string(),
CliCommand::CleanTarget => "clean-target".to_string(),
CliCommand::Push => "push".to_string(),
CliCommand::PushList => "push-tree".to_string(),
CliCommand::CookList => "cook-tree".to_string(),
CliCommand::RepoList => "repo-tree".to_string(),
CliCommand::PushList => "push-list".to_string(),
CliCommand::CookList => "cook-list".to_string(),
CliCommand::RepoList => "repo-list".to_string(),
CliCommand::CaptureRev => "capture-rev".to_string(),
CliCommand::ChangeRule => "change-rule".to_string(),
CliCommand::ChangeRuleLocal => "change-rule-local".to_string(),

View File

@ -197,6 +197,11 @@ pub fn walk_tree_entry(
data: &mut TreeData,
op: fn(TreeItem) -> Result<bool>,
) -> Result<()> {
// To avoid confusion
if package_name.is_host() {
return Ok(());
}
let cook_recipe = match recipe_map.get(package_name) {
Some(r) => r,
None => {