Skip to content
Browse files

Explicitly select the "du" block size in t/test.sh.

Since du's default output can be affected by several environment
variables (DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE), be explicit about
what we want via -B 1024.

Thanks to Michael Ekstrand <michael@elehack.net> for the original
report, and help with the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
  • Loading branch information...
1 parent c97891c commit e35148129b969ab2cc2ad56f9d7db5539752cd09 @rlbdv rlbdv committed Jan 22, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 t/test.sh
View
4 t/test.sh
@@ -473,7 +473,7 @@ WVPASS bup save -n compression -0 --strip $TOP/Documentation
# is harmless there.)
WVPASSEQ "$(bup ls compression/latest/ | sort)" \
"$(ls $TOP/Documentation | grep -v '^\.' | sort)"
-COMPRESSION_0_SIZE=$(du -s $D | cut -f1)
+COMPRESSION_0_SIZE=$(du -B 1024 -s $D | cut -f1)
D=compression9.tmp
export BUP_DIR="$TOP/$D/.bup"
@@ -483,7 +483,7 @@ WVPASS bup init
WVPASS bup index $TOP/Documentation
WVPASS bup save -n compression -9 --strip $TOP/Documentation
WVPASSEQ "$(bup ls compression/latest/ | sort)" "$(ls $TOP/Documentation | sort)"
-COMPRESSION_9_SIZE=$(du -s $D | cut -f1)
+COMPRESSION_9_SIZE=$(du -B 1024 -s $D | cut -f1)
WVPASS [ "$COMPRESSION_9_SIZE" -lt "$COMPRESSION_0_SIZE" ]

0 comments on commit e351481

Please sign in to comment.
Something went wrong with that request. Please try again.