[__git] Fix bug introduced in explorers.
I was using explorers in the explorers >,< which is not supported and would be awkward. While at it, symlinked group to owner and unified that code.
This commit is contained in:
parent
e13b44bd5d
commit
db68b04420
2 changed files with 18 additions and 18 deletions
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
destination="/$__object_id/.git"
|
|
||||||
|
|
||||||
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
|
|
1
cdist/conf/type/__git/explorer/group
Symbolic link
1
cdist/conf/type/__git/explorer/group
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
owner
|
|
@ -2,14 +2,28 @@
|
||||||
|
|
||||||
destination="/$__object_id/.git"
|
destination="/$__object_id/.git"
|
||||||
|
|
||||||
os="$(cat "$__global/explorer/os")"
|
action="$(basename "${0}")"
|
||||||
|
|
||||||
|
case $action in
|
||||||
|
owner)
|
||||||
|
bsd_fmt="%Su"
|
||||||
|
linux_fmt="%U"
|
||||||
|
;;
|
||||||
|
group)
|
||||||
|
bsd_fmt="%Sg"
|
||||||
|
linux_fmt="%G"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
os="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||||
|
|
||||||
case $os in
|
case $os in
|
||||||
*bsd)
|
*bsd)
|
||||||
# Checked on OpenBSD, FreeBSD and NetBSD
|
# Checked on OpenBSD, FreeBSD and NetBSD
|
||||||
stat -f "%Su" "${destination}" 2>/dev/null || exit 0
|
stat -f "${bsd_fmt}" "${destination}" 2>/dev/null || exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
stat --print "%U" "${destination}" 2>/dev/null || exit 0
|
stat --print "${linux_fmt}" "${destination}" 2>/dev/null || exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue