emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Honor 'SOURCE_DATE_EPOCH' when generating autoloads.


From: Ludovic Courtès
Subject: [PATCH] Honor 'SOURCE_DATE_EPOCH' when generating autoloads.
Date: Mon, 16 Nov 2015 18:03:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Support bit-for-bit reproducible generation of autoloads.
See <https://reproducible-builds.org/specs/source-date-epoch/>.
Submitted on behalf of Alex Kost.

* lisp/emacs-lisp/autoload.el (autoload-insert-section-header): Check
whether the 'SOURCE_DATE_EPOCH' environment variable is defined; use it
as the TIME part of the 'autoloads' sexp when it is.

--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -378,8 +378,12 @@
   "Insert the section-header line,
 which lists the file name and which functions are in it, etc."
   (insert generate-autoload-section-header)
-  (prin1 `(autoloads ,autoloads ,load-name ,file ,time)
-        outbuf)
+  (let* ((env  (getenv "SOURCE_DATE_EPOCH"))
+         (time (if env
+                   (seconds-to-time (string-to-number env))
+                 time)))
+    (prin1 `(autoloads ,autoloads ,load-name ,file ,time)
+           outbuf))
   (terpri outbuf)
   ;; Break that line at spaces, to avoid very long lines.
   ;; Make each sub-line into a comment.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]