Skip to content

Commit

Permalink
Allow to override build date
Browse files Browse the repository at this point in the history
in builds from a release tarball, there is no git commit
to take a date from, so the current date was inserted there.

See https://reproducible-builds.org/ for why this matters
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

This patch was done while working on reproducible builds for openSUSE.
  • Loading branch information
bmwiedemann committed Feb 11, 2024
1 parent 2672e90 commit 5e79cc3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/mkhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,12 @@ def to_title(name):
is_addon=True if addon_path else False,
)
if git_commit["commit"] == "unknown":
date_tag = "Accessed: {date}".format(date=git_commit["date"])
sde = int(os.environ.get('SOURCE_DATE_EPOCH', 0))
if sde:
build_date = datetime.utcfromtimestamp(sde)
else:
build_date = git_commit["date"]
date_tag = "Accessed: {date}".format(date=build_date)
else:
date_tag = "Latest change: {date} in commit: {commit}".format(
date=git_commit["date"], commit=git_commit["commit"]
Expand Down

0 comments on commit 5e79cc3

Please sign in to comment.