Add SOURCE_DATE_EPOCH support for reproducible builds

Implement support for the SOURCE_DATE_EPOCH environment variable as
specified by reproducible-builds.org. When set, this variable overrides
the current timestamp in the Release file's Date and Valid-Until fields,
enabling reproducible filesystem publishes.

- Read SOURCE_DATE_EPOCH environment variable in Publish()
- Use the epoch timestamp for both Date and Valid-Until fields
- Gracefully fallback to current time if unset or invalid
- Add comprehensive tests for valid and invalid SOURCE_DATE_EPOCH values
This commit is contained in:
Tim Foerster
2026-02-20 06:01:53 +00:00
parent a65f79eb79
commit 49f342878a
8 changed files with 119 additions and 3 deletions
+5
View File
@@ -533,6 +533,11 @@ For example, default aptly display format could be presented with the following
If environment variable `HTTP_PROXY` is set `aptly` would use its value
to proxy all HTTP requests.
If environment variable `SOURCE_DATE_EPOCH` is set to a Unix timestamp,
`aptly` would use that timestamp for the `Date` and `Valid-Until` fields
in the `Release` file when publishing. This enables reproducible builds
as specified by https://reproducible-builds.org/specs/source-date-epoch/.
## RETURN VALUES
`aptly` exists with: