And what about 'touch -r ref'? I checked man pages of the systems listed on the Postfix home page, and the option '-r' is everywhere. I'm attaching a new patch.
Ondra ----- Original Message ----- From: "Wietse Venema" <wie...@porcupine.org> To: "Postfix users" <postfix-users@postfix.org> Sent: Sunday, August 28, 2016 3:19:20 AM Subject: Re: [PATCH] Preserve timestamps during 'make install' Michael Orlitzky: > On 08/27/2016 07:42 PM, Wietse Venema wrote: > >> > >> Thanks. The "cp -p" feature was not portable in the days that this script > >> was written, but it should be safe to use now. > > > > Unfortunately, I have to roll back this change, because it may > > install files with non-root ownership. > > > > Those who built postfix-3.2-2060827 should do "postfix set-permissions" > > or install postfix-3.2-2060828 which I will upload in a few minutes > > time to ftp.porcupine.org. > > The "-p" flag (at least in GNU coreutils) is a shortcut for, > > --preserve=mode,ownership,timestamps > > Unfortunately, the behavior of "--preserve" is not sufficiently > standard. Perhaps "tar --no-same-owner" can be used as a poor man's cp, > since it preserves modification times by default? Sorry, Postfix needs to work on systems other than Gnu Linux. Many systems come with an install command, but could not use it when I published Postfix, because every system had different syntax. I just checked with Linux, BSD, and Solaris, and it is still a mess. They don't even agree on how to atomically replace a file. Wietse
From b39786e433ba01b2aca9e2aa7e85d5d13dec8c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olyso...@redhat.com> Date: Sun, 4 Sep 2016 10:16:12 +0200 Subject: [PATCH] Preserve timestamps during 'make install' --- postfix-install | 1 + 1 file changed, 1 insertion(+) diff --git a/postfix-install b/postfix-install index 922402b..852f9d6 100644 --- a/postfix-install +++ b/postfix-install @@ -305,6 +305,7 @@ compare_or_replace() { echo Updating $dst... rm -f $tempdir/junk || exit 1 cp $src $tempdir/junk || exit 1 + touch -r $src $tempdir/junk || exit 1 mv -f $tempdir/junk $dst || exit 1 test -z "$owner" || chown $owner $dst || exit 1 test -z "$group" || chgrp $group $dst || exit 1 -- 2.7.4