diff --git a/TODO b/TODO index 5f0a0004ad..947274ea19 100644 --- a/TODO +++ b/TODO @@ -511,9 +511,6 @@ Features: * support projid-based quota in machinectl for containers -* maybe use SOURCE_DATE_EPOCH (i.e. the env var the reproducible builds folks - introduced) as the RTC epoch, instead of the mtime of NEWS. - * add a way to lock down cgroup migration: a boolean, which when set for a unit makes sure the processes in it can never migrate out of it diff --git a/meson.build b/meson.build index 580d5126fa..e9eb7f9569 100644 --- a/meson.build +++ b/meson.build @@ -669,8 +669,13 @@ conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme) time_epoch = get_option('time-epoch') if time_epoch == -1 - NEWS = files('NEWS') - time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout().to_int() + source_date_epoch = run_command('sh', ['-c', 'echo "$SOURCE_DATE_EPOCH"']).stdout().strip() + if source_date_epoch != '' + time_epoch = source_date_epoch.to_int() + else + NEWS = files('NEWS') + time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout().to_int() + endif endif conf.set('TIME_EPOCH', time_epoch)