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 <tk@giga.or.at> for reporting the problem
and to him and Greg Troxel <gdt@ir.bbn.com> for helping craft the
solution.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
|| 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