summaryrefslogtreecommitdiffstats
path: root/scripts/size_compare.sh
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-01-31 15:58:08 +0100
committerPaul Spooren <mail@aparcar.org>2023-02-03 21:22:49 +0100
commit19988b66d07f44be757c4a0e41be899dbf8c72dd (patch)
tree89d907873a3c48a2225cfa43df5954a6402eb3b8 /scripts/size_compare.sh
parent21242451c265f3b2fb47e710a5fabc74dc59efce (diff)
downloadopenwrt-19988b66d07f44be757c4a0e41be899dbf8c72dd.tar.gz
openwrt-19988b66d07f44be757c4a0e41be899dbf8c72dd.tar.bz2
openwrt-19988b66d07f44be757c4a0e41be899dbf8c72dd.zip
scripts: size_compare: print a grand total
Usefull to check the impact of treewide changes: Change Local Remote Package +281 6191 5910 ubus -547 56166 56713 procd -13294 91544 104838 ubi-utils ~~~~~~~ total change -13560 Signed-off-by: Andre Heider <a.heider@gmail.com>
Diffstat (limited to 'scripts/size_compare.sh')
-rwxr-xr-xscripts/size_compare.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh
index 617004e72b..8417d25ff2 100755
--- a/scripts/size_compare.sh
+++ b/scripts/size_compare.sh
@@ -75,6 +75,7 @@ package_size () {
}
compare_sizes () {
+ TOTAL_DIFF="0"
for PACKAGE in $PACKAGES; do
if [ "$PACKAGE" = "libc" ]; then
continue
@@ -92,7 +93,8 @@ compare_sizes () {
SIZE_LOCAL=$(tar tzvf "$PACKAGE_FILE" ./data.tar.gz | awk '{ print $3 }')
fi
SIZE_UPSTREAM=$(package_size "$TMP_INDEX" "$PACKAGE")
- SIZE_DIFF="$((SIZE_LOCAL-SIZE_UPSTREAM))"
+ SIZE_DIFF="$((SIZE_LOCAL - SIZE_UPSTREAM))"
+ TOTAL_DIFF="$((TOTAL_DIFF + SIZE_DIFF))"
if [ "$SIZE_DIFF" -gt 0 ]; then
SIZE_DIFF="+$SIZE_DIFF"
fi
@@ -102,6 +104,7 @@ compare_sizes () {
echo "$PACKAGE is missing upstream"
fi
done
+ echo "~~~~~~~ total change ${TOTAL_DIFF}"
}
if [ "$1" = "-h" ]; then