mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
makepkg: avoid reporting bogus install size on btrfs
delayed allocation hoses us here and causes erroenous install sizes to be reported. Add a short sleep to allow the transaction to be committed to the filesystem and the stat buffers to be updated. This is apparently a "feature", as per to some of the denizens of #btrfs on freenode. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
be0e044404
commit
7f258619c6
@ -1120,6 +1120,12 @@ write_pkginfo() {
|
||||
else
|
||||
local packager="Unknown Packager"
|
||||
fi
|
||||
|
||||
# btrfs's delayed allocation causes the stat buffers from the kernel to "lie"
|
||||
# to us momentarily and report 0 blocks allocated (which is how du calculates
|
||||
# size). Sleeping for a second here is about the dirtiest thing possible,
|
||||
# but avoids reporting entirely bogus install sizes.
|
||||
sleep 1
|
||||
local size="$(@DUPATH@ -sk)"
|
||||
size="$(( ${size%%[^0-9]*} * 1024 ))"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user