[__git]: Fix explorers on *BSD
stat's implementation differs between BSD and GNU/Linux Operating Systems. Tested on FreeBSD, manual-compatibility was asserted for OpenBSD and NetBSD.
This commit is contained in:
parent
a6543a72ad
commit
d59e2c6440
2 changed files with 22 additions and 2 deletions
12
cdist/conf/type/__git/explorer/group
Normal file → Executable file
12
cdist/conf/type/__git/explorer/group
Normal file → Executable file
|
@ -2,4 +2,14 @@
|
|||
|
||||
destination="/$__object_id/.git"
|
||||
|
||||
stat --print "%G" "${destination}" 2>/dev/null || exit 0
|
||||
os="$(cat "$__global/explorer/os")"
|
||||
|
||||
case $os in
|
||||
*bsd)
|
||||
# Checked on OpenBSD, FreeBSD and NetBSD
|
||||
stat -f "%Sg" "${destination}" 2>/dev/null || exit 0
|
||||
;;
|
||||
*)
|
||||
stat --print "%G" "${destination}" 2>/dev/null || exit 0
|
||||
;;
|
||||
esac
|
||||
|
|
12
cdist/conf/type/__git/explorer/owner
Normal file → Executable file
12
cdist/conf/type/__git/explorer/owner
Normal file → Executable file
|
@ -2,4 +2,14 @@
|
|||
|
||||
destination="/$__object_id/.git"
|
||||
|
||||
stat --print "%U" "${destination}" 2>/dev/null || exit 0
|
||||
os="$(cat "$__global/explorer/os")"
|
||||
|
||||
case $os in
|
||||
*bsd)
|
||||
# Checked on OpenBSD, FreeBSD and NetBSD
|
||||
stat -f "%Su" "${destination}" 2>/dev/null || exit 0
|
||||
;;
|
||||
*)
|
||||
stat --print "%U" "${destination}" 2>/dev/null || exit 0
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in a new issue