summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Torres <santiago@archlinux.org>2019-03-12 03:24:35 +0100
committerAllan McRae <allan@archlinux.org>2019-03-19 02:54:50 +0100
commitf26cb61cb6a16c8ce85f33e6090763aced0118c3 (patch)
tree9878739833dfa51049fb2be149b24fa5dcf819aa
parentc61cd050f9b6475ea128a1da02e88b284ac509b5 (diff)
downloadpacman-f26cb61cb6a16c8ce85f33e6090763aced0118c3.tar.gz
pacman-f26cb61cb6a16c8ce85f33e6090763aced0118c3.tar.xz
Make makepkg compute sizes properly
Makepkg used to use du --apparent-size to compute the size of the package. Unfortunately, this would result in different sizes depending on the filesystem used (e.g., btrfs vs ext4), which would affect reproducible builds. Use a wc-based approach to compute sizes Signed-off-by: Santiago Torres <santiago@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in3
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e12826af..4f096a36 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -588,8 +588,7 @@ write_kv_pair() {
}
write_pkginfo() {
- local size="$(@DUPATH@ @DUFLAGS@)"
- size="$(( ${size%%[^0-9]*} * 1024 ))"
+ local size="$(find . -type f -exec cat {} + 2>/dev/null | wc -c)"
merge_arch_attrs