summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-10-20 18:06:14 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-10-20 18:09:10 +0200
commit66285586e32da9d0354c5923d05fa69a2102e497 (patch)
tree9a052010f4ebb7cb41ed63f1cb3ad55788f768fa /scripts
parentc899007cbf234253f3f7c5d75d7c514344e09201 (diff)
downloadptxdist-66285586e32da9d0354c5923d05fa69a2102e497.tar.gz
ptxdist-66285586e32da9d0354c5923d05fa69a2102e497.tar.xz
ptxd_make_xpkg_finish: use tar to determine the installed size
The result of 'du' is not stable and may change between two builds, even if the individual file sizes remain the same. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_make_xpkg_finish.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_finish.sh b/scripts/lib/ptxd_make_xpkg_finish.sh
index d327faa97..8d6a2f92e 100644
--- a/scripts/lib/ptxd_make_xpkg_finish.sh
+++ b/scripts/lib/ptxd_make_xpkg_finish.sh
@@ -13,13 +13,14 @@
# the actual opkg package creation, will run in fakeroot
#
ptxd_make_xpkg_finish_impl() {
+ local size
chown -R 0:0 "${pkg_xpkg_tmp}" "${pkg_xpkg_dbg_tmp}" &&
ptxd_make_xpkg_pkg "${pkg_xpkg_tmp}" "${pkg_xpkg_dbg_tmp}" "${pkg_xpkg_cmds}" "${pkg_xpkg_perms}" &&
- set -- $(du --apparent-size --bytes --summarize --exclude=CONTROL "${pkg_xpkg_tmp}") &&
- sed -i -e "s,@INSTALLED_SIZE@,${1}," "${pkg_xpkg_control}" &&
- set -- $(du --apparent-size --bytes --summarize --exclude=CONTROL "${pkg_xpkg_dbg_tmp}") &&
- sed -i -e "s,@INSTALLED_SIZE@,${1}," "${pkg_xpkg_dbg_control}" &&
+ size="$(tar -C "${pkg_xpkg_tmp}" --exclude=CONTROL -c . | tar -tv | awk '{ sum += $3; } END { print sum; }')"
+ sed -i -e "s,@INSTALLED_SIZE@,${size}," "${pkg_xpkg_control}" &&
+ size="$(tar -C "${pkg_xpkg_dbg_tmp}" --exclude=CONTROL -c . | tar -tv | awk '{ sum += $3; } END { print sum; }')"
+ sed -i -e "s,@INSTALLED_SIZE@,${size}," "${pkg_xpkg_dbg_control}" &&
opkg-build ${ptx_xpkg_extra_args} "${pkg_xpkg_tmp}" "${ptx_pkg_dir}" &&
if [ "$(find "${pkg_xpkg_dbg_tmp}" -type f | wc -l)" -gt 1 ]; then