diff options
author | David Bremner <bremner@debian.org> | 2015-12-19 14:12:51 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2015-12-19 14:12:51 -0400 |
commit | f0d844d13bf4890089237785da499e8e7707cbb4 (patch) | |
tree | 342973f65d4156b9133542a48178ac9fe7230f41 /dh-elpa.el | |
parent | 97993eabb761c12dbe3448c17bce28a8f6c84e8b (diff) |
allow a string for epoch time
This makes it easier to take command line arguments
Diffstat (limited to 'dh-elpa.el')
-rw-r--r-- | dh-elpa.el | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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) |