New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repart: respect SOURCE_DATE_EPOCH
on mkdir_p_root
#32502
Conversation
Important An -rc1 tag has been created and a release is being prepared, so please note that PRs introducing new features and APIs will be held back until the new version has been released. |
Please read https://systemd.io/CODING_STYLE/ first |
42cc9e5
to
3abe5a8
Compare
c4bc18d
to
949ca25
Compare
Apologies. I tried to familiarize with the guides, but let the one-line-ifs and the import slip through. Things should be in order with the style guide and contributing guidelines now. Regarding the function signature compatability, I wasn't sure to do this, since |
b2fdf2f
to
de3b55c
Compare
4c6eb7c
to
c1675e2
Compare
f0d086d
to
fdd0f40
Compare
fdd0f40
to
cee41f5
Compare
cee41f5
to
647a649
Compare
647a649
to
792b5e1
Compare
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`)
792b5e1
to
f43b9e9
Compare
This let's systemd-repart respect the
SOURCE_DATE_EPOCH
environment variable when creating directories in the local tree throughMakeDirectories
orCopyFiles
.To do this, it does two things:
mkdir_p_root
, it set's timestamps (mtime
andatime
) for the directory that's being created. Additionally, it will fixup themtime
for the directory things are copied into, ifSOURCE_DATE_EPOCH
is set. Otherwise, times are left untouched (UTIME_OMIT
). The fixup of the upper directory is necessary, as otherwise, when creating a directory in it, it'smtime
would change.mtime
of the upper directory if we copy a file into it.The changes can be verified with https://github.com/msanft/systemd-repart-repro-bug.
Fixes #32117.