summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-07 18:23:55 +0200
committerDan McGee <dan@archlinux.org>2012-04-07 18:23:55 +0200
commit4ca6590af58177964910588a6d0406f0d009bd0e (patch)
tree3ff2d0d07aa5bd38f13e9456c5f831bdef06b8e2 /scripts/makepkg.sh.in
parent3f1ea8b62f46a915c94a5b46e21ad39ea2628f65 (diff)
parentb752561a52a88f8e9cc3bcc9c2079eb685245110 (diff)
downloadpacman-4ca6590af58177964910588a6d0406f0d009bd0e.tar.gz
pacman-4ca6590af58177964910588a6d0406f0d009bd0e.tar.xz
Merge branch 'maint'
Conflicts: lib/libalpm/signing.c lib/libalpm/sync.c
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