summaryrefslogtreecommitdiff
path: root/dh-elpa.el
diff options
context:
space:
mode:
Diffstat (limited to 'dh-elpa.el')
-rw-r--r--dh-elpa.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/dh-elpa.el b/dh-elpa.el
index a0385c9..0d31a99 100644
--- a/dh-elpa.el
+++ b/dh-elpa.el
@@ -27,11 +27,12 @@
(require 'package)
;; Originally package-unpack from package.el in Emacs 24.5
-(defun dhelpa-unpack (pkg-desc destdir)
+(defun dhelpa-unpack (pkg-desc destdir &optional epoch-time)
"Install the contents of the current buffer as a package."
(let* ((name (package-desc-name pkg-desc))
(dirname (package-desc-full-name pkg-desc))
(pkg-dir (expand-file-name dirname destdir))
+ (pkg-time (if epoch-time (seconds-to-time epoch-time) (current-time)))
(backup-inhibited t))
(make-directory pkg-dir t)
(pcase (package-desc-kind pkg-desc)
@@ -42,7 +43,13 @@
(let ((el-file (expand-file-name (format "%s.el" name) pkg-dir)))
(package--write-file-no-coding el-file)))
(kind (error "Unknown package kind: %S" kind)))
+ (defun dhelpa-autoload-insert-section-header (real-fun outbuf autoloads load-name file time)
+ (funcall real-fun outbuf autoloads load-name file pkg-time))
+ (advice-add #'autoload-insert-section-header
+ :around #'dhelpa-autoload-insert-section-header)
(package--make-autoloads-and-stuff pkg-desc pkg-dir)
+ (advice-remove #'autoload-insert-section-header
+ #'dhelpa-autoload-insert-section-header)
pkg-dir))
;; Write out (partial) package description in a form easily parsed by