Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update archive-cpio.el #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions archive-cpio.el
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ARCHIVE-BUFFER is nil."
(uid (string-to-number (match-string 3) 16))
(gid (string-to-number (match-string 4) 16))
;; (nlink (string-to-number (match-string 5) 16))
;; (mtime (string-to-number (match-string 6) 16))
(mtime (string-to-number (match-string 6) 16))
(filesize (string-to-number (match-string 7) 16))
;; (devmajor (string-to-number (match-string 8) 16))
;; (devminor (string-to-number (match-string 9) 16))
Expand Down Expand Up @@ -155,14 +155,20 @@ ARCHIVE-BUFFER is nil."
(push (vector text (length text-a) (length text)) visual)
(push (vector name name nil mode filebeg) files))
(push (archive--file-summary text (length text-a) (length text)) visual)
(push (archive--file-desc name name mode filesize nil :pos filebeg) files))))
(push (archive--file-desc
name name mode filesize
(format-time-string "%c" mtime) :pos filebeg :uid uid :gid gid)
files))))
(goto-char next)))))
(with-current-buffer (or archive-buffer (current-buffer))
(goto-char (point-min))
(insert "M Filemode Length UID/GID File\n")
(insert "- ---------- -------- ---------- ---------- -----\n")
(archive-summarize-files (nreverse visual))
(apply #'vector (nreverse files)))))
(if (< emacs-major-version 28)
(apply #'vector (nreverse files))
(archive--summarize-descs (nreverse files)))
)))

(defun archive-cpio-extract (archive name)
"Open the CPIO file ARCHIVE and extract NAME into the current buffer.
Expand Down