From 7f258619c6c0e9f441aacbabfc1a2f5980c5cb9b Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 27 Mar 2012 23:43:46 -0400 Subject: 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 Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2d672a37..1faf591f 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -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 ))" -- cgit v1.2.3-24-g4f1b From 3c5d5a19b36c5ea3638de263cb7cd1be6289cb44 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 7 Apr 2012 11:54:02 -0400 Subject: Revert "parseopts: normalize options into an array" This was really only half a fix for FS#28445, as it still doesn't correctly handle the case of filenames with spaces. In the short term, there is no obvious fix for this. In the long term, I believe the correct decision is to rewrite the options parser to be more in line with GNU getopt_long. This reverts commits: ca4142714137b16feabac09c4cda86b0a75036f8. 969dcddbdf9d5dbd91aa414cdd193f3fb26b644b. --- scripts/makepkg.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 1faf591f..eeb7ede1 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1918,11 +1918,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 -- cgit v1.2.3-24-g4f1b