branch: externals/cpio-mode commit 75891efd33e720208f4d353e892f8ed590f45d7d Author: Paul Eggert <egg...@cs.ucla.edu> Commit: Paul Eggert <egg...@cs.ucla.edu>
Don’t assume Emacs timestamp format * cpio-mode.el (cpio-set-mtime): On newer Emacs, convert the timestamp to list format since it may be in some other form. (cpio-create-entry-attrs, cpio-create-faux-directory-attrs): Use cpio-set-time to set mtime. --- cpio-mode.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpio-mode.el b/cpio-mode.el index 63be87e..2793486 100644 --- a/cpio-mode.el +++ b/cpio-mode.el @@ -927,6 +927,8 @@ MODE is either an integer or a string representing an integer." "Set the modification time in the PARSED-HEADER to MTIME. MTIME is an emacs time." (let ((fname "cpio-set-mtime")) + (if (fboundp 'time-convert) + (setq mtime (time-convert mtime 'list))) (aset parsed-header *cpio-mtime-parsed-idx* mtime))) (defun cpio-extract-all () @@ -1426,7 +1428,7 @@ Run more than one instance of emacs to avoid such collisions." (aset result *cpio-gid-parsed-idx* gid) (aset result *cpio-nlink-parsed-idx* nlink) - (aset result *cpio-mtime-parsed-idx* (seconds-to-time mtime)) + (cpio-set-mtime result mtime) (aset result *cpio-entry-size-parsed-idx* entry-size) (aset result *cpio-dev-maj-parsed-idx* dev-maj) @@ -1462,7 +1464,6 @@ many are simply invented." (nlink 1) (now (current-time)) - (mtime (list (nth 0 now) (nth 1 now))) (entry-size 0) (dev-maj 1) @@ -1478,6 +1479,7 @@ many are simply invented." (aset result *cpio-gid-parsed-idx* gid) (aset result *cpio-nlink-parsed-idx* nlink) + (cpio-set-mtime result now) (aset result *cpio-mtime-parsed-idx* mtime) (aset result *cpio-entry-size-parsed-idx* entry-size) (aset result *cpio-dev-maj-parsed-idx* dev-maj) @@ -1756,7 +1758,7 @@ or nil." ;; ;; EO temporary code for development ;; - + (let ((archive-buffer (current-buffer)) (cpio-dired-buffer)) ;; You really only need this for the binary archive formats,