瀏覽代碼

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 <[email protected]>
Paul Spooren 1 年之前
父節點
當前提交
49e8f53298
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/ipkg-build

+ 1 - 1
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