[PATCH] XMPSchemaAdapter.java: Use UTC timezone when SOURCE_DATE_EPOCH is set.
SOURCE_DATE_EPOCH specifies the timestamp, but needs to be rendered in UTC timezone to ensure reproducible builds. https://reproducible-builds.org/docs/source-date-epoch/ This is a follow-up to https://bugs.debian.org/978499 in apache fop, as there is no way for fop itself to pass the timezone information for some values. Gbp-Pq: Name 0001-XMPSchemaAdapter.java-Use-UTC-timezone-when-SOURCE_D.patch
This commit is contained in:
parent
92f7876cc1
commit
b91e2d083d
|
@ -157,6 +157,11 @@ public class XMPSchemaAdapter {
|
||||||
* @return the formatted date
|
* @return the formatted date
|
||||||
*/
|
*/
|
||||||
public static String formatISO8601Date(Date dt) {
|
public static String formatISO8601Date(Date dt) {
|
||||||
|
// https://reproducible-builds.org/docs/source-date-epoch/
|
||||||
|
String source_date_epoch = System.getenv("SOURCE_DATE_EPOCH");
|
||||||
|
if (source_date_epoch != null) {
|
||||||
|
return formatISO8601Date(dt, TimeZone.getTimeZone("Etc/UTC"));
|
||||||
|
}
|
||||||
return formatISO8601Date(dt, TimeZone.getDefault());
|
return formatISO8601Date(dt, TimeZone.getDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue