瀏覽代碼

FOP-2854: Allow to override CreationDate

Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
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.
pull/65/head
Bernhard M. Wiedemann 3 年之前
父節點
當前提交
0d3f0f9a47
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java

+ 3
- 1
fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java 查看文件

@@ -134,7 +134,9 @@ public class PDFMetadata extends PDFStream {

//Set creation date if not available, yet
if (info.getCreationDate() == null) {
Date d = new Date();
Date d = System.getenv("SOURCE_DATE_EPOCH") == null ?
new Date() :
new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
info.setCreationDate(d);
}


Loading…
取消
儲存