summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Soller <jackpot51@gmail.com>2024-03-03 20:02:52 +0000
committerJeremy Soller <jackpot51@gmail.com>2024-03-03 20:02:52 +0000
commit7fc6893d22eabb2de1066c9c66bc20d3cf753739 (patch)
tree3f95df6ad32c5a2482a40b014204c830b75aa70f
parent554a854c7dad6d83c8d4582cc831b8eef3dc1700 (diff)
parent06c0fe8e3230c12a4369404c8fedca200faa2143 (diff)
Merge branch 'pkg-size' into 'master'HEADmaster
Add pkg-size script See merge request redox-os/redox!1430
-rwxr-xr-xscripts/pkg-size.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/pkg-size.sh b/scripts/pkg-size.sh
new file mode 100755
index 0000000..59b8167
--- /dev/null
+++ b/scripts/pkg-size.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+if [ $# = 0 ]
+then
+ find cookbook/recipes \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
+ exit 0
+fi
+
+for recipe in $@
+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 cookbook/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 \ No newline at end of file