release-tools/do-copyright-year: Modify files with more care
authorRichard Levitte <levitte@openssl.org>
Fri, 26 May 2023 11:06:08 +0000 (13:06 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 26 May 2023 11:06:08 +0000 (13:06 +0200)
commite7fe5ab5f660a7b965947fc097896d540f5f8de8
tree30b3993c26201298dd069c5eb7827baebd1da3d0
parent418c18ec466fff3e894277d887f18f87aa9927a6
release-tools/do-copyright-year: Modify files with more care

Files were modified by running a simple in-place sed (i.e. 'sed -i').
This turns out to update the modification time on every file, even those
that remain unmodified.

The effect is that time stamps in a source directory become unreliable,
causing configdata.pm to be "mysteriously" older than (unmodified) files it
depends on, which causes a spurious reconfiguration when running 'make'
again.

To mediate, the loop is modified to take copies of the original files, run
an in-place sed on those, and only move them back to the original files if
there were any actual modifications.  That should leave time stamps alone on
unmodified files.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/tools/pull/151)
release-tools/do-copyright-year