From 69b4c507a0cb0059c4ff5da81c4bb49cde27131e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 29 Dec 2007 19:54:20 +0000 Subject: [PATCH] Fix USERLAND references to handle Darwin like BSD. svn path=/main/trunk/; revision=9117 --- bin/emerge-webrsync | 3 ++- 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}" -- 2.26.2