Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 12cda8ce..93c94e1c 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1156,6 +1156,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 ))"
@@ -1933,11 +1939,11 @@ OPT_LONG+=",version,config:"
# Pacman Options
OPT_LONG+=",noconfirm,noprogressbar"
-if ! parse_options $OPT_SHORT $OPT_LONG "$@"; then
+if ! OPT_TEMP="$(parse_options $OPT_SHORT $OPT_LONG "$@")"; then
echo; usage; exit 1 # E_INVALID_OPTION;
fi
-set -- "${OPTRET[@]}"
-unset OPT_SHORT OPT_LONG OPTRET
+eval set -- "$OPT_TEMP"
+unset OPT_SHORT OPT_LONG OPT_TEMP
while true; do
case "$1" in