mirror of
https://github.com/systemd/systemd
synced 2024-09-06 08:46:19 +00:00
Get SOURCE_EPOCH from the latest git tag instead of NEWS
Currently, each change to NEWS triggers a meson reconfigure that changes SOURCE_EPOCH which causes a full rebuild. Since NEWS changes relatively often, we have a full rebuild each time we pull from master even if we pull semi-regularly. This is further compounded when using branches since NEWS has a relatively high chance to differ between branches which causes git to update the modification time, leading to a full rebuild when switching between branches. We fix this by using the creation time of the latest git tag instead.
This commit is contained in:
parent
00b868e857
commit
bd190899bb
|
@ -679,6 +679,10 @@ if time_epoch == -1
|
||||||
source_date_epoch = run_command('sh', ['-c', 'echo "$SOURCE_DATE_EPOCH"']).stdout().strip()
|
source_date_epoch = run_command('sh', ['-c', 'echo "$SOURCE_DATE_EPOCH"']).stdout().strip()
|
||||||
if source_date_epoch != ''
|
if source_date_epoch != ''
|
||||||
time_epoch = source_date_epoch.to_int()
|
time_epoch = source_date_epoch.to_int()
|
||||||
|
elif git.found() and run_command('test', '-e', '.git').returncode() == 0
|
||||||
|
# If we're in a git repository, use the creation time of the latest git tag.
|
||||||
|
latest_tag = run_command('git', 'describe', '--abbrev=0', '--tags').stdout().strip()
|
||||||
|
time_epoch = run_command('git', 'log', '-1', '--format=%at', latest_tag).stdout().to_int()
|
||||||
else
|
else
|
||||||
NEWS = files('NEWS')
|
NEWS = files('NEWS')
|
||||||
time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout().to_int()
|
time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout().to_int()
|
||||||
|
|
Loading…
Reference in a new issue