From eae535e1a322e244248bd31ed7e21ac95ecaa16d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 27 Jul 2009 17:08:02 +0200 Subject: cp -pP (and e.g., -a): preserve time stamps on symlinks, too * src/copy.c (utimensat_if_possible): New function. (copy_internal): Remove variable, "preserve_metadata". Replace with "dest_is_symlink". That covers all cases but one: the one in which cp --link has created hard links to non-directories. In that case, there is no need to update attributes of the links. Use utimensat_if_possible, to preserve timestamps of symlinks. * NEWS (New features): Mention this. * tests/Makefile.am (TESTS): Add cp/preserve-slink-time. * tests/cp/preserve-slink-time: New file. * m4/jm-macros.m4 (coreutils_MACROS): Test for utimensat. Reported in http://bugzilla.redhat.com/230866 --- m4/jm-macros.m4 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'm4/jm-macros.m4') diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4 index f862984cc..32a0954a7 100644 --- a/m4/jm-macros.m4 +++ b/m4/jm-macros.m4 @@ -89,6 +89,9 @@ AC_DEFUN([coreutils_MACROS], tcgetpgrp \ ) + # for cp.c + AC_CHECK_FUNCS_ONCE([utimensat]) + dnl This can't use AC_REQUIRE; I'm not quite sure why. cu_PREREQ_STAT_PROG -- cgit v1.2.3-54-g00ecf