unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5540: 23.1.92; failed to access zip inside zip when not using tramp
@ 2010-02-07 17:01 Juri Linkov
  2010-02-09 21:16 ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2010-02-07 17:01 UTC (permalink / raw)
  To: 5540

The fix revno#98570 for bug#4929 (with the subject "failed to access file
inside zip archive when using tramp") broke the ability to visit a file
in an archive inside another archive.

The problem is in the following lines in `archive-extract':

	    ;; Just in case an archive occurs inside another archive.
	    (when (derived-mode-p 'archive-mode)
              (setq archive-remote t)

This means that nested archives are treated as remote files.

An example of a patch that fixes this bug for nested archives:

=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el	2010-02-04 18:54:46 +0000
+++ lisp/arc-mode.el	2010-02-07 17:01:18 +0000
@@ -842,7 +842,7 @@ (defun archive-unique-fname (fname dir)
 	      "am"
 	    "arc-mode.")
 	  dir)))
-    (if (or alien (file-exists-p fullname))
+    (if (or alien (not (file-exists-p fullname)))
 	(progn
 	  ;; Maked sure all the leading directories in
 	  ;; archive-local-name exist under archive-tmpdir, so that

But this patch should NOT be installed, because it causes the original
remote archive to be overwritten!  This is just a demonstration of the
logic for nested archives.

I currently don't understand the decision to use archive-remote=t
for nested archives (this is an old decision), but perhaps they
should be distinguished from remote archives with a new variable
or a new value of `archive-remote'?

-- 
Juri Linkov
http://www.jurta.org/emacs/







^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5540: 23.1.92; failed to access zip inside zip when not using tramp
  2010-02-07 17:01 bug#5540: 23.1.92; failed to access zip inside zip when not using tramp Juri Linkov
@ 2010-02-09 21:16 ` Juri Linkov
  2010-02-12 19:45   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2010-02-09 21:16 UTC (permalink / raw)
  To: 5540

> I currently don't understand the decision to use archive-remote=t
> for nested archives (this is an old decision), but perhaps they
> should be distinguished from remote archives with a new variable
> or a new value of `archive-remote'?

Actually for remote archives `archive-remote' is 0 and for nested
archives `archive-remote' is t.  But this difference doesn't matter.

The following patch creates the directories for nested archives:

=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el	2010-02-04 19:54:46 +0000
+++ lisp/arc-mode.el	2010-02-09 21:12:51 +0000
@@ -850,6 +850,11 @@ (defun archive-unique-fname (fname dir)
 	  ;; reconstructed in the temporary directory.
 	  (make-directory (file-name-directory tmpfile) t)
 	  (make-temp-file tmpfile))
+      ;; Maked sure all the leading directories in `fullname' exist
+      ;; under archive-tmpdir.  This is necessary for nested archives
+      ;; (`archive-extract' sets `archive-remote' to t in case
+      ;; an archive occurs inside another archive).
+      (make-directory (file-name-directory fullname) t)
       fullname)))
 
 (defun archive-maybe-copy (archive)

-- 
Juri Linkov
http://www.jurta.org/emacs/






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#5540: 23.1.92; failed to access zip inside zip when not using tramp
  2010-02-09 21:16 ` Juri Linkov
@ 2010-02-12 19:45   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2010-02-12 19:45 UTC (permalink / raw)
  To: 5540-done

> The following patch creates the directories for nested archives:
>
> === modified file 'lisp/arc-mode.el'
> --- lisp/arc-mode.el	2010-02-04 19:54:46 +0000
> +++ lisp/arc-mode.el	2010-02-09 21:12:51 +0000
> @@ -850,6 +850,11 @@ (defun archive-unique-fname (fname dir)
>  	  ;; reconstructed in the temporary directory.
>  	  (make-directory (file-name-directory tmpfile) t)
>  	  (make-temp-file tmpfile))
> +      ;; Maked sure all the leading directories in `fullname' exist
> +      ;; under archive-tmpdir.  This is necessary for nested archives
> +      ;; (`archive-extract' sets `archive-remote' to t in case
> +      ;; an archive occurs inside another archive).
> +      (make-directory (file-name-directory fullname) t)
>        fullname)))
>  
>  (defun archive-maybe-copy (archive)

Installed.

-- 
Juri Linkov
http://www.jurta.org/emacs/






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-12 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-07 17:01 bug#5540: 23.1.92; failed to access zip inside zip when not using tramp Juri Linkov
2010-02-09 21:16 ` Juri Linkov
2010-02-12 19:45   ` Juri Linkov

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).