GNU bug report logs - #1862
23.0.60; tar-mode on posix ustar

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42 <at> zip.com.au>

Date: Mon, 12 Jan 2009 00:45:03 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1862 in the body.
You can then email your comments to 1862 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1862; Package emacs. (Mon, 12 Jan 2009 00:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kevin Ryde <user42 <at> zip.com.au>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 12 Jan 2009 00:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kevin Ryde <user42 <at> zip.com.au>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; tar-mode on posix ustar
Date: Mon, 12 Jan 2009 11:37:11 +1100
[Message part 1 (text/plain, inline)]
Running

   emacs -Q File-Corresponding-0.003.tar.gz

on that file from

   http://search.cpan.org/CPAN/authors/id/J/JO/JOHANL/File-Corresponding-0.003.tar.gz

(about 14 kbytes) produces a buffer like

   drwxrwxrwx       0/0             0 File-Corresponding-0.003
   -r--r--r--       0/0          1274 Build.PL
   -r--r--r--       0/0           382 Changes
   -r--r--r--       0/0          1272 Makefile.PL
   ...

where I hoped it would show the directory part of each name, the same as
shown by "tar tvf" (GNU tar 1.20),

   File-Corresponding-0.003
   File-Corresponding-0.003/Build.PL
   File-Corresponding-0.003/Changes
   File-Corresponding-0.003/Makefile.PL
   ...

Such a file is generated by the perl Archive::Tar module.  It uses the
posix style magic "ustar\0", with digits "00" in the `version' field.
But I think tar-header-block-tokenize only recognises a nul "\000" in
that version field (in addition to ``OLDGNU'' style which is a space).

I get some joy from the change below.  Are those two places the only
ones wanting to match the extra form?

2009-01-10  Kevin Ryde  <user42 <at> zip.com.au>

	* tar-mode.el (tar-header-block-tokenize): Recognise posix
	"ustar\0\060" magic for long filenames.





In GNU Emacs 23.0.60.12 (i586-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2009-01-07 on blah.blah
configured using `configure  'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t


[tar-mode.el.posix-ustar.diff (text/x-diff, attachment)]

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Mon, 12 Jan 2009 03:45:03 GMT) Full text and rfc822 format available.

Notification sent to Kevin Ryde <user42 <at> zip.com.au>:
bug acknowledged by developer. (Mon, 12 Jan 2009 03:45:03 GMT) Full text and rfc822 format available.

Message #10 received at 1862-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 1862-done <at> debbugs.gnu.org
Subject: Re: bug#1862: 23.0.60; tar-mode on posix ustar
Date: Sun, 11 Jan 2009 22:38:24 -0500
> Such a file is generated by the perl Archive::Tar module.  It uses the
> posix style magic "ustar\0", with digits "00" in the `version' field.
> But I think tar-header-block-tokenize only recognises a nul "\000" in
> that version field (in addition to ``OLDGNU'' style which is a space).

Indeed, the code didn't pay attention to the version field, but
incorrectly clipped it out.  I've installed a similar fix to yours, just
a bit simpler.


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1862; Package emacs. (Fri, 16 Jan 2009 00:25:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kevin Ryde <user42 <at> zip.com.au>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 16 Jan 2009 00:25:08 GMT) Full text and rfc822 format available.

Message #15 received at 1862 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kevin Ryde <user42 <at> zip.com.au>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 1862 <at> debbugs.gnu.org
Subject: Re: bug#1862: 23.0.60; tar-mode on posix ustar
Date: Fri, 16 Jan 2009 11:18:45 +1100
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
> Indeed, the code didn't pay attention to the version field, but
> incorrectly clipped it out.  I've installed a similar fix to yours, just
> a bit simpler.

Does tar-rename-entry have to notice the shorter magic-str now too?
Maybe something like the following, with the happy side effect of no
longer writing a \0 in the version field, rather digits 00 per posix.

Note totally untested!, as my build is in a rather broken state at the
moment ... :-)

[tar-mode.el.rename-ustar.diff (text/x-diff, inline)]
*** tar-mode.el	14 Jan 2009 07:53:50 +1100	1.136
--- tar-mode.el	16 Jan 2009 11:10:21 +1100	
***************
*** 1053,1060 ****
                 (string-match "/" encoded-new-name
  			     (- (length encoded-new-name) 99))
  	       (< (match-beginning 0) 155))
!       (unless (equal (tar-header-magic descriptor) "ustar\0\0")
!         (tar-alter-one-field tar-magic-offset "ustar\0\0"))
        (setq prefix (substring encoded-new-name 0 (match-beginning 0)))
        (setq encoded-new-name (substring encoded-new-name (match-end 0))))
  
--- 1053,1060 ----
                 (string-match "/" encoded-new-name
  			     (- (length encoded-new-name) 99))
  	       (< (match-beginning 0) 155))
!       (unless (equal (tar-header-magic descriptor) "ustar\0")
!         (tar-alter-one-field tar-magic-offset "ustar\0\060\060"))
        (setq prefix (substring encoded-new-name 0 (match-beginning 0)))
        (setq encoded-new-name (substring encoded-new-name (match-end 0))))
  

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1862; Package emacs. (Fri, 16 Jan 2009 02:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 16 Jan 2009 02:45:03 GMT) Full text and rfc822 format available.

Message #20 received at 1862 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Kevin Ryde <user42 <at> zip.com.au>
Cc: 1862 <at> debbugs.gnu.org
Subject: Re: bug#1862: 23.0.60; tar-mode on posix ustar
Date: Thu, 15 Jan 2009 21:39:18 -0500
>> Indeed, the code didn't pay attention to the version field, but
>> incorrectly clipped it out.  I've installed a similar fix to yours, just
>> a bit simpler.

> Does tar-rename-entry have to notice the shorter magic-str now too?
> Maybe something like the following, with the happy side effect of no
> longer writing a \0 in the version field, rather digits 00 per posix.

Thanks, installed,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Fri, 13 Feb 2009 15:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.