[Libosinfo] [PATCH osinfo-db] Use SOURCE_DATE_EPOCH to make build reproducible

Chris Lamb lamby at debian.org
Sat Apr 22 09:47:01 UTC 2017


using a fixed timestamp when the variable is set
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 48d2951..1846f7a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
 
 VPATH = .
 
-TODAY = $(shell date +"%Y%m%d")
+ifdef SOURCE_DATE_EPOCH
+    TODAY = $(shell date --utc --date="@$(SOURCE_DATE_EPOCH)" +"%Y%m%d")
+else
+    TODAY = $(shell date +"%Y%m%d")
+endif
 
 OSINFO_DB_EXPORT = osinfo-db-export
 OSINFO_DB_IMPORT = osinfo-db-import
-- 
2.11.0




More information about the Libosinfo mailing list