From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#1862: 23.0.60; tar-mode on posix ustar Date: Mon, 12 Jan 2009 11:37:11 +1100 Message-ID: <87vdsltl54.fsf@blah.blah> Reply-To: Kevin Ryde , 1862@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1231722242 20635 80.91.229.12 (12 Jan 2009 01:04:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Jan 2009 01:04:02 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 12 02:05:13 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LMBEa-0000ex-LY for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Jan 2009 02:04:53 +0100 Original-Received: from localhost ([127.0.0.1]:44114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LMBDK-00064M-JL for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Jan 2009 20:03:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LMBDF-000647-MI for bug-gnu-emacs@gnu.org; Sun, 11 Jan 2009 20:03:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LMBDE-00063m-Ib for bug-gnu-emacs@gnu.org; Sun, 11 Jan 2009 20:03:29 -0500 Original-Received: from [199.232.76.173] (port=44754 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LMBDE-00063j-Fb for bug-gnu-emacs@gnu.org; Sun, 11 Jan 2009 20:03:28 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41729) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LMBDD-00046n-RB for bug-gnu-emacs@gnu.org; Sun, 11 Jan 2009 20:03:28 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0C13PBP028057; Sun, 11 Jan 2009 17:03:26 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0C0j3As023416; Sun, 11 Jan 2009 16:45:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 12 Jan 2009 00:45:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 1862 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123172066222025 (code B ref -1); Mon, 12 Jan 2009 00:45:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 12 Jan 2009 00:37:42 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0C0bbc6022012 for ; Sun, 11 Jan 2009 16:37:39 -0800 Original-Received: from mail.gnu.org ([199.232.76.166]:54593 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LMAmx-0002E9-2t for emacs-pretest-bug@gnu.org; Sun, 11 Jan 2009 19:36:19 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LMAo7-0007wx-Hc for emacs-pretest-bug@gnu.org; Sun, 11 Jan 2009 19:37:34 -0500 Original-Received: from mailout2-5.pacific.net.au ([61.8.2.228]:58090 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LMAo6-0007wL-Lq for emacs-pretest-bug@gnu.org; Sun, 11 Jan 2009 19:37:31 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 3C16011D3BA for ; Mon, 12 Jan 2009 11:37:25 +1100 (EST) Original-Received: from blah.blah (ppp2990.dyn.pacific.net.au [61.8.41.144]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 488728C26 for ; Mon, 12 Jan 2009 11:37:24 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LMAnn-0002FF-T2 for emacs-pretest-bug@gnu.org; Mon, 12 Jan 2009 11:37:11 +1100 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 11 Jan 2009 20:03:29 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24007 gmane.emacs.pretest.bugs:23674 Archived-At: --=-=-= 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 * 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=tar-mode.el.posix-ustar.diff *** 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 --=-=-=--