From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: EOL conversion of files in .tar archives Date: Wed, 23 May 2007 21:43:07 +0300 Message-ID: References: <85bqgeg3jt.fsf@lola.goethe.zz> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1179945803 3938 80.91.229.12 (23 May 2007 18:43:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 May 2007 18:43:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 23 20:43:13 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hqvnk-0000sd-S1 for ged-emacs-devel@m.gmane.org; Wed, 23 May 2007 20:43:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hqvnm-0001Ul-QR for ged-emacs-devel@m.gmane.org; Wed, 23 May 2007 14:43:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hqvnk-0001Uf-6o for emacs-devel@gnu.org; Wed, 23 May 2007 14:43:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hqvng-0001UL-Qh for emacs-devel@gnu.org; Wed, 23 May 2007 14:43:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hqvng-0001UI-Kl for emacs-devel@gnu.org; Wed, 23 May 2007 14:43:08 -0400 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hqvne-0004ej-54; Wed, 23 May 2007 14:43:06 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-39-23.inter.net.il [80.230.39.23]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id HXC73580 (AUTH halo1); Wed, 23 May 2007 21:43:02 +0300 (IDT) In-reply-to: (message from Richard Stallman on Tue, 22 May 2007 04:30:45 -0400) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:71666 Archived-At: > From: Richard Stallman > CC: handa@m17n.org, eliz@gnu.org, emacs-devel@gnu.org > Date: Tue, 22 May 2007 04:30:45 -0400 > > Apropos: take the tar.gz file in > > (it will be available only a week or so). > > Move cursor down to .gitignore and press RET. Instead you'll get > Makefile, the file one line lower. In general, on every line you'll > get the file one line lower. > > It would appear that this is packed with some version of tar that GNU > tar can perfectly well unpack, but with output confusing tar-mode. My > tar version is tar (GNU tar) 1.16. > > Would someone please debug this and fix it in the trunk? > Please ack when it is done. Fixed on the trunk with the patch below. Additional info about the tarball that causes this can be found here: http://lkml.org/lkml/2005/6/18/5 Note that the fix I checked in is not a perfect one: the extended pax header is still shown as a special entry (unlike GNU Tar, which doesn't show it at all). But at least the bug reported by David is gone, and tar-mode now says correctly that this is a special entry, not a real file, and does not allow to visit it, as it does with directories and other special entries. I used the uppercase `H' to flag this special entry in the tarball summary, but if someone has a better suggestion, I won't object to changing the letter. 2007-05-23 Eli Zaretskii * tar-mode.el (tar-header-block-summarize, tar-summarize-buffer) (tar-get-descriptor): Handle type 55, an extended pax header. Index: lisp/tar-mode.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/tar-mode.el,v retrieving revision 1.109 diff -u -r1.109 tar-mode.el --- lisp/tar-mode.el 23 May 2007 12:38:35 -0000 1.109 +++ lisp/tar-mode.el 23 May 2007 18:29:24 -0000 @@ -363,6 +363,7 @@ ((eq type 29) ?M) ; multivolume continuation ((eq type 35) ?S) ; sparse ((eq type 38) ?V) ; volume header + ((eq type 55) ?H) ; extended pax header (t ?\s) ) (tar-grind-file-mode mode) @@ -421,7 +422,7 @@ (buffer-substring pos (+ pos 512))))))) (setq pos (+ pos 512)) (progress-reporter-update progress-reporter pos) - (if (eq (tar-header-link-type tokens) 20) + (if (memq (tar-header-link-type tokens) '(20 55)) ;; Foo. There's an extra empty block after these. (setq pos (+ pos 512))) (let ((size (tar-header-size tokens))) @@ -657,13 +658,14 @@ (size (tar-header-size tokens)) (link-p (tar-header-link-type tokens))) (if link-p - (error "This is a %s, not a real file" - (cond ((eq link-p 5) "directory") - ((eq link-p 20) "tar directory header") - ((eq link-p 28) "next has longname") - ((eq link-p 29) "multivolume-continuation") - ((eq link-p 35) "sparse entry") - ((eq link-p 38) "volume header") + (error "This is a%s, not a real file" + (cond ((eq link-p 5) " directory") + ((eq link-p 20) " tar directory header") + ((eq link-p 28) " next has longname") + ((eq link-p 29) " multivolume-continuation") + ((eq link-p 35) " sparse entry") + ((eq link-p 38) " volume header") + ((eq link-p 55) "n extended pax header") (t "link")))) (if (zerop size) (error "This is a zero-length file")) descriptor))