Make etc-update copy owner and group bits when it merges config files. (trunk r7636)
authorZac Medico <zmedico@gentoo.org>
Thu, 16 Aug 2007 21:56:51 +0000 (21:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 16 Aug 2007 21:56:51 +0000 (21:56 -0000)
svn path=/main/branches/2.1.2/; revision=7637

bin/etc-update

index a6378a1427f815a2a009072c997483b4191384f9..27d7bca35e754812930720c5c20d2ec6a2e990b0 100755 (executable)
@@ -387,9 +387,11 @@ 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 ]]; then
+                                  if [[ ${USERLAND:-GNU} == GNU ]]; then
+                                      chown --reference="${ofile}" "${mfile}"
                                       chmod --reference="${ofile}" "${mfile}"
                                   else
+                                      chown "$(stat -f %Su:%Sg "${ofile}")" "${mfile}"
                                       chmod $(stat -f %Mp%Lp "${ofile}") "${mfile}"
                                   fi
                                   mv ${mv_opts} ${mfile} ${ofile}