From 0272fca993718460bf7ecb7fdc3ca7dad1c7e6cd Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 27 Oct 2019 03:41:46 -0400 Subject: makepkg: do not count hard links multiple times when calculating pkg size Exclude files with hardlinks when cat'ing all the files, and do a second run to look at each file with hardlinks, keep track of the ones we've already operated on, and only cat each inode once. Then use "wc -c" to get the size of all (deduplicated) files the same way we were already doing. Original-patch-by: Ronan Pigott Signed-off-by: Eli Schwartz Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 947a30c5..d217d0a4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -584,7 +584,7 @@ write_kv_pair() { } write_pkginfo() { - local size="$(find . -type f -exec cat {} + 2>/dev/null | wc -c)" + local size=$(dirsize) merge_arch_attrs -- cgit v1.2.3-54-g00ecf