From 7ad76808399d91955111a53033d708be7c41e529 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sat, 22 Mar 2014 10:25:32 -0500 Subject: [PATCH] test-ls.sh: get the group and gid from the filesystem. Get the expected gid from the filesystem, not "id", because on some platforms (BSDs, etc.) a new path's gid is taken from the parent directory, not the effective gid. Thanks to Thomas Klausner for reporting the problem and to him and Greg Troxel for helping craft the solution. Signed-off-by: Rob Browning --- t/test-ls.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/test-ls.sh b/t/test-ls.sh index 4a9e5b1..c4f4a1a 100755 --- a/t/test-ls.sh +++ b/t/test-ls.sh @@ -132,9 +132,10 @@ symlink_date="$(WVPASS echo "$symlink_date" \ || exit $? uid="$(id -u)" || exit $? -gid="$(id -g)" || exit $? +gid="$(python -c 'import os; print os.stat("src").st_gid')" || exit $? user="$(id -un)" || exit $? -group="$(id -gn)" || exit $? +group="$(python -c 'import grp, os; +print grp.getgrgid(os.stat("src").st_gid)[0]')" || exit $? WVPASSEQ "$(bup ls -l src/latest"$tmpdir"/src | tr -s ' ' ' ')" \ "-rwx------ $user/$group 0 1969-07-20 20:18 executable -- 2.39.2