diff options
-rwxr-xr-x | bin/emerge-webrsync | 3 | ||||
-rwxr-xr-x | bin/etc-update | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 8ee18f2a4..4edf2bc36 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -50,7 +50,8 @@ get_date_part() { local utc_time_in_secs="$1" local part="$2" - if [ "${USERLAND}" = "BSD" ]; then + if [[ ${USERLAND} == BSD ]] || \ + [[ ${USERLAND} == Darwin ]] ; then date -r ${utc_time_in_secs} -u +"${part}" else date -d @${utc_time_in_secs} -u +"${part}" diff --git a/bin/etc-update b/bin/etc-update index e8ba989c5..c597a50be 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -401,12 +401,13 @@ Please select from the menu above (-1 to exit, losing this merge): " my_input=$(read_int) case ${my_input} in 1) echo "Replacing ${ofile} with ${mfile}" - if [[ ${USERLAND:-GNU} == GNU ]]; then - chown --reference="${ofile}" "${mfile}" - chmod --reference="${ofile}" "${mfile}" - else + if [[ ${USERLAND} == BSD ]] || \ + [[ ${USERLAND} == Darwin ]] ; then chown "$(stat -f %Su:%Sg "${ofile}")" "${mfile}" chmod $(stat -f %Mp%Lp "${ofile}") "${mfile}" + else + chown --reference="${ofile}" "${mfile}" + chmod --reference="${ofile}" "${mfile}" fi mv ${mv_opts} "${mfile}" "${ofile}" rm ${rm_opts} "${file}" |