From: Ronan Pigott <[email protected]>

---
 scripts/makepkg.sh.in | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 997c8668..0725f582 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -584,7 +584,15 @@ write_kv_pair() {
 }
 
 write_pkginfo() {
-       local size="$(find . -type f -exec cat {} + 2>/dev/null | wc -c)"
+       local inode size=0
+       declare -A files
+       while read -rd $'\0' file; do
+               inode=$( @INODECMD@ "$file" )
+               if [[ -z "${files[$inode]}" ]]; then
+                       files[$inode]=$(wc -c < "$file")
+                       size=$((size + ${files[$inode]}))
+               fi
+       done < <(find . -type f -print0)
 
        merge_arch_attrs
 
-- 
2.23.0

Reply via email to