* bug#1862: 23.0.60; tar-mode on posix ustar
@ 2009-01-12 0:37 ` Kevin Ryde
2009-01-12 3:45 ` bug#1862: marked as done (23.0.60; tar-mode on posix ustar) Emacs bug Tracking System
[not found] ` <handler.1862.D1862.12317315262970.notifdone@emacsbugs.donarmstrong.com>
0 siblings, 2 replies; 4+ messages in thread
From: Kevin Ryde @ 2009-01-12 0:37 UTC (permalink / raw
To: emacs-pretest-bug
[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]
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@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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tar-mode.el.posix-ustar.diff --]
[-- Type: text/x-diff, Size: 2055 bytes --]
*** tar-mode.el 12 Jan 2009 11:33:35 +1100 1.135
--- tar-mode.el 12 Jan 2009 11:33:59 +1100
***************
*** 240,246 ****
(link-p (aref string tar-linkp-offset))
(magic-str (substring string tar-magic-offset
(1- tar-uname-offset)))
! (uname-valid-p (car (member magic-str '("ustar " "ustar\0\0"))))
name linkname
(nulsexp "[^\000]*\000"))
(when (string-match nulsexp string tar-name-offset)
--- 240,249 ----
(link-p (aref string tar-linkp-offset))
(magic-str (substring string tar-magic-offset
(1- tar-uname-offset)))
! (uname-valid-p (car (member magic-str
! '("ustar " ;; "OLDGNU"
! "ustar\0\0" ;; per tar-rename-entry
! "ustar\0\060")))) ;; POSIX
name linkname
(nulsexp "[^\000]*\000"))
(when (string-match nulsexp string tar-name-offset)
***************
*** 256,262 ****
nil
(- link-p ?0)))
(setq linkname (substring string tar-link-offset link-end))
! (when (and (equal uname-valid-p "ustar\0\0")
(string-match nulsexp string tar-prefix-offset)
(> (match-end 0) (1+ tar-prefix-offset)))
(setq name (concat (substring string tar-prefix-offset
--- 259,266 ----
nil
(- link-p ?0)))
(setq linkname (substring string tar-link-offset link-end))
! (when (and (member uname-valid-p '("ustar\0\0" ;; tar-rename-entry
! "ustar\0\060")) ;; POSIX
(string-match nulsexp string tar-prefix-offset)
(> (match-end 0) (1+ tar-prefix-offset)))
(setq name (concat (substring string tar-prefix-offset
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#1862: marked as done (23.0.60; tar-mode on posix ustar)
2009-01-12 0:37 ` bug#1862: 23.0.60; tar-mode on posix ustar Kevin Ryde
@ 2009-01-12 3:45 ` Emacs bug Tracking System
[not found] ` <handler.1862.D1862.12317315262970.notifdone@emacsbugs.donarmstrong.com>
1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-01-12 3:45 UTC (permalink / raw
To: Stefan Monnier
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
Your message dated Sun, 11 Jan 2009 22:38:24 -0500
with message-id <jwvy6xh9oug.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#1862: 23.0.60; tar-mode on posix ustar
has caused the Emacs bug report #1862,
regarding 23.0.60; tar-mode on posix ustar
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)
--
1862: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1862
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 6318 bytes --]
[-- Attachment #2.1.1: Type: text/plain, Size: 1754 bytes --]
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@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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.1.2: tar-mode.el.posix-ustar.diff --]
[-- Type: text/x-diff, Size: 2055 bytes --]
*** tar-mode.el 12 Jan 2009 11:33:35 +1100 1.135
--- tar-mode.el 12 Jan 2009 11:33:59 +1100
***************
*** 240,246 ****
(link-p (aref string tar-linkp-offset))
(magic-str (substring string tar-magic-offset
(1- tar-uname-offset)))
! (uname-valid-p (car (member magic-str '("ustar " "ustar\0\0"))))
name linkname
(nulsexp "[^\000]*\000"))
(when (string-match nulsexp string tar-name-offset)
--- 240,249 ----
(link-p (aref string tar-linkp-offset))
(magic-str (substring string tar-magic-offset
(1- tar-uname-offset)))
! (uname-valid-p (car (member magic-str
! '("ustar " ;; "OLDGNU"
! "ustar\0\0" ;; per tar-rename-entry
! "ustar\0\060")))) ;; POSIX
name linkname
(nulsexp "[^\000]*\000"))
(when (string-match nulsexp string tar-name-offset)
***************
*** 256,262 ****
nil
(- link-p ?0)))
(setq linkname (substring string tar-link-offset link-end))
! (when (and (equal uname-valid-p "ustar\0\0")
(string-match nulsexp string tar-prefix-offset)
(> (match-end 0) (1+ tar-prefix-offset)))
(setq name (concat (substring string tar-prefix-offset
--- 259,266 ----
nil
(- link-p ?0)))
(setq linkname (substring string tar-link-offset link-end))
! (when (and (member uname-valid-p '("ustar\0\0" ;; tar-rename-entry
! "ustar\0\060")) ;; POSIX
(string-match nulsexp string tar-prefix-offset)
(> (match-end 0) (1+ tar-prefix-offset)))
(setq name (concat (substring string tar-prefix-offset
[-- Attachment #3: Type: message/rfc822, Size: 2090 bytes --]
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: 1862-done@emacsbugs.donarmstrong.com
Subject: Re: bug#1862: 23.0.60; tar-mode on posix ustar
Date: Sun, 11 Jan 2009 22:38:24 -0500
Message-ID: <jwvy6xh9oug.fsf-monnier+emacsbugreports@gnu.org>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#1862: 23.0.60; tar-mode on posix ustar
[not found] ` <handler.1862.D1862.12317315262970.notifdone@emacsbugs.donarmstrong.com>
@ 2009-01-16 0:18 ` Kevin Ryde
2009-01-16 2:39 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2009-01-16 0:18 UTC (permalink / raw
To: Stefan Monnier; +Cc: 1862
[-- Attachment #1: Type: text/plain, Size: 506 bytes --]
Stefan Monnier <monnier@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 ... :-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tar-mode.el.rename-ustar.diff --]
[-- Type: text/x-diff, Size: 981 bytes --]
*** 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))))
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#1862: 23.0.60; tar-mode on posix ustar
2009-01-16 0:18 ` bug#1862: 23.0.60; tar-mode on posix ustar Kevin Ryde
@ 2009-01-16 2:39 ` Stefan Monnier
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2009-01-16 2:39 UTC (permalink / raw
To: Kevin Ryde; +Cc: 1862
>> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-16 2:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <jwvy6xh9oug.fsf-monnier+emacsbugreports@gnu.org>
2009-01-12 0:37 ` bug#1862: 23.0.60; tar-mode on posix ustar Kevin Ryde
2009-01-12 3:45 ` bug#1862: marked as done (23.0.60; tar-mode on posix ustar) Emacs bug Tracking System
[not found] ` <handler.1862.D1862.12317315262970.notifdone@emacsbugs.donarmstrong.com>
2009-01-16 0:18 ` bug#1862: 23.0.60; tar-mode on posix ustar Kevin Ryde
2009-01-16 2:39 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).