summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2024-01-06 18:10:29 +0100
committerPaul Spooren <mail@aparcar.org>2024-01-08 14:08:06 +0100
commit49e8f532989c342fff44c1c558f8182585673833 (patch)
tree7b98e4742a4cfcc73b79028742bb807690474634 /scripts
parente32edf712b7c43e25b4bec40fedfd948a0ed5bd6 (diff)
downloadopenwrt-49e8f532989c342fff44c1c558f8182585673833.tar.gz
openwrt-49e8f532989c342fff44c1c558f8182585673833.tar.bz2
openwrt-49e8f532989c342fff44c1c558f8182585673833.zip
scripts: fix installed-size calculation
Previously the script would calculate the size of the compressed archive which isn't the size installed in the overlayfs. This commit uses zcat in combination with wc to calculate the umcompressed size. Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ipkg-build2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 122cca2cb4..6abcc58832 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -181,7 +181,7 @@ for file_mode in $file_modes; do
done
$TAR -X "$tmp_dir"/tarX --format=gnu --numeric-owner --sort=name -cpf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/data.tar.gz
-installed_size=$(stat -c "%s" "$tmp_dir"/data.tar.gz)
+installed_size=$(zcat < "$tmp_dir"/data.tar.gz | wc -c)
sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
"$pkg_dir"/$CONTROL/control