Add NetBSD and SunOS support to cp_permissions.
Note that this likely won't work on Solaris without Coreutils as Solaris lacks stat(1). SmartOS has stat from Coreutils in base and the chmod(1) from it's OpenSolaris heritage. Using the chmod from either Coreutils or Solaris will work the same (in this case) on SmartOS.
This commit is contained in:
@@ -433,10 +433,13 @@ function cp_permissions() {
|
||||
Darwin )
|
||||
chmod $( stat -f '%p' "$1" ) "${@:2}"
|
||||
;;
|
||||
FreeBSD )
|
||||
FreeBSD | NetBSD )
|
||||
chmod $( stat -f '%p' "$1" | sed -e "s/^100//" ) "${@:2}"
|
||||
;;
|
||||
Linux | CYGWIN* | MINGW* )
|
||||
SunOS )
|
||||
chmod $( stat -c '%a' "$1" ) "${@:2}"
|
||||
;;
|
||||
Linux | CYGWIN* | MINGW* | SunOS )
|
||||
if [[ -e /etc/alpine-release ]]; then
|
||||
chmod $( stat -c '%a' "$1" ) "${@:2}"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user