]> git.ipfire.org Git - thirdparty/systemd.git/commit
repart: respect `SOURCE_DATE_EPOCH` on `mkdir_p_root`
authorMoritz Sanft <58110325+msanft@users.noreply.github.com>
Mon, 29 Apr 2024 11:03:40 +0000 (13:03 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 7 May 2024 07:29:58 +0000 (09:29 +0200)
commit34c3d574742e867ef97e79509e4051a82f1b7d9b
treef616b7e579c95efa9c10b06dd23700e0e8245261
parent4dc1be99d6f36a3ad96f04a01b956efa2e5f2124
repart: respect `SOURCE_DATE_EPOCH` on `mkdir_p_root`

This let's systemd-repart respect the `SOURCE_DATE_EPOCH` environment
variable when creating directories in the local tree through `CopyFiles`
or `MakeDirectories`.

To do this, we pass a timestamp `ts` to `mkdir_p_root`, which it will
use to fix up `mtime` and `atime` of the directory it creates as
well as the `mtime` of the directory it creates the other directory *in*,
as the `mtime` of the latter is modified when creating a directory in it.

For the same reason, it also needs to fixup the `mtime` of the upper
directory when copying a file into it through `CopyFiles`.

If `SOURCE_DATE_EPOCH`, times are left as is. (`UTIME_OMIT`)
src/basic/mkdir.c
src/basic/mkdir.h
src/partition/repart.c
src/shared/dissect-image.c
src/test/test-conf-parser.c
src/test/test-mkdir.c