[FreeBSD] Fix use of chmod (#180)

LGTM

Thanks for the fix!
This commit is contained in:
Tino Breddin
2017-01-20 23:12:57 +01:00
committed by Tom Limoncelli
parent d7ed89da4c
commit 653cfb618e

View File

@@ -425,9 +425,12 @@ function md5sum_file() {
function cp_permissions() { function cp_permissions() {
# Copy the perms of $1 onto $2 .. end. # Copy the perms of $1 onto $2 .. end.
case $(uname -s) in case $(uname -s) in
Darwin | FreeBSD ) Darwin )
chmod $( stat -f '%p' "$1" ) "${@:2}" chmod $( stat -f '%p' "$1" ) "${@:2}"
;; ;;
FreeBSD )
chmod $( stat -f '%p' "$1" | sed -e "s/^100//" ) "${@:2}"
;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* )
chmod --reference "$1" "${@:2}" chmod --reference "$1" "${@:2}"
;; ;;