diff options
1 files changed, 8 insertions, 3 deletions
diff --git a/dh-elpa.el b/dh-elpa.el
index 5ffa6f5..cd28770 100644
--- a/dh-elpa.el
+++ b/dh-elpa.el
@@ -29,12 +29,17 @@
;; Originally package-unpack from package.el in Emacs 24.5
(defun dhelpa-unpack (pkg-desc destdir &optional epoch-time)
"Install the contents of the current buffer into DESTDIR as a package.
-Optional argument EPOCH-TIME specifies time to use in autoload
-files; if unspecifed or nil the current time is used."
+Optional argument EPOCH-TIME specifies time (as a string or
+number) to use in autoload files; if unspecifed or nil the
+current time is used."
(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)))
+ (pkg-time (if epoch-time (seconds-to-time
+ (if (stringp epoch-time)
+ (string-to-number epoch-time)
+ epoch-time))
+ (current-time)))
(backup-inhibited t))
(make-directory pkg-dir t)
(pcase (package-desc-kind pkg-desc)