]> arthur.barton.de Git - bup.git/commitdiff
test-ls.sh: take only the first 10 chars from ls -l's mode string.
authorRob Browning <rlb@defaultvalue.org>
Tue, 18 Feb 2014 18:30:31 +0000 (12:30 -0600)
committerRob Browning <rlb@defaultvalue.org>
Tue, 18 Feb 2014 18:30:31 +0000 (12:30 -0600)
Since ls -l's mode string may not be separated from the next field by
a space (i.e. when ACLs, etc. are involved), take only the first 10
characters for now when retrieving the symlink mode string (cf.
30d9027cc5444f038d38927219dc59e3b69fa219).

Thanks to Mark J Hewitt <mjh@idnet.com> for pointing out the problem
and testing the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test-ls.sh

index d91f1d32d6ecec67320aeeb50bfa2077924f4ac3..4a9e5b1a474642fe42dfef16cfcc222b68b13f96 100755 (executable)
@@ -121,7 +121,7 @@ d--------- ?/? 0 1970-01-01 00:00 .commit/
 d--------- ?/? 0 1970-01-01 00:00 .tag/
 d--------- ?/? 0 1970-01-01 00:00 src/"
 
-symlink_mode="$(WVPASS ls -l src/symlink | cut -d' ' -f 1)" || exit $?
+symlink_mode="$(WVPASS ls -l src/symlink | cut -b -10)" || exit $?
 
 symlink_size="$(WVPASS python -c "import os
 print os.lstat('src/symlink').st_size")" || exit $?