Subject: bug#8968: closed (Re: bug#8968: arc-mode 7z writing support)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 08 Jul 2011 00:12:02 +0000

Your bug report

#8968: arc-mode 7z writing support

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
8968: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8968
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#8968: arc-mode 7z writing support
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Fri, 08 Jul 2011 03:09:51 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Some users prefer using 7z even for operations on zip archives.
>
> This patch provides the right default values for them in case
> 7z is installed on the system instead of zip/unzip.
>
> For searching the available programs it uses exactly the same logic
> as already is implemented in `archive-zip-extract' (i.e. first try
> to find zip/unzip, then 7z, and finally pkzip/pkunzip):

This is installed as well.

As reported in http://thread.gmane.org/gmane.emacs.devel/136578/focus=136670
on cygwin the program name is "p7zip".  But I can't confirm this fact,
so I'm closing this feature request at its current state with the
program name "7z".

Subject: arc-mode 7z writing support
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Fri, 01 Jul 2011 00:47:05 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

I'd like to install a patch that implements update/delete operations
for 7z archives in arc-mode.el:

=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el	2011-04-19 13:44:55 +0000
+++ lisp/arc-mode.el	2011-06-30 21:39:45 +0000
@@ -55,9 +55,9 @@
 ;;			--------------------------------------------
 ;; View listing		Intern	Intern	Intern	Intern	Y	Y
 ;; Extract member	Y	Y	Y	Y	Y	Y
-;; Save changed member	Y	Y	Y	Y	N	N
+;; Save changed member	Y	Y	Y	Y	N	Y
 ;; Add new member	N	N	N	N	N	N
-;; Delete member	Y	Y	Y	Y	N	N
+;; Delete member	Y	Y	Y	Y	N	Y
 ;; Rename member	Y	Y	N	N	N	N
 ;; Chmod		-	Y	Y	-	N	N
 ;; Chown		-	Y	-	-	N	N
@@ -328,6 +328,27 @@ (defcustom archive-7z-extract
 			(string :format "%v")))
   :group 'archive-7z)
 
+(defcustom archive-7z-expunge
+  '("7z" "d")
+  "Program and its options to run in order to delete 7z file members.
+Archive and member names will be added."
+  :type '(list (string :tag "Program")
+	       (repeat :tag "Options"
+		       :inline t
+		       (string :format "%v")))
+  :group 'archive-7z)
+
+(defcustom archive-7z-update
+  '("7z" "u")
+  "Program and its options to run in order to update a 7z file member.
+Options should ensure that specified directory will be put into the 7z
+file.  Archive and member name will be added."
+  :type '(list (string :tag "Program")
+	       (repeat :tag "Options"
+		       :inline t
+		       (string :format "%v")))
+  :group 'archive-7z)
+
 ;; -------------------------------------------------------------------------
 ;;; Section: Variables
 
@@ -2037,7 +2058,9 @@ (defun archive-7z-summarize ()
     (with-temp-buffer
       (call-process "7z" nil t nil "l" "-slt" file)
       (goto-char (point-min))
-      (re-search-forward "^-+\n")
+      ;; Four dashes start the meta info section that should be skipped.
+      ;; Archive members start with more than four dashes.
+      (re-search-forward "^-----+\n")
       (while (re-search-forward "^Path = \\(.*\\)\n" nil t)
         (goto-char (match-end 0))
         (let ((name (match-string 1))
@@ -2084,6 +2107,12 @@ (defun archive-7z-extract (archive name)
 	  (message "%s" (buffer-string)))
 	(delete-file tmpfile)))))
 
+(defun archive-7z-write-file-member (archive descr)
+  (archive-*-write-file-member
+   archive
+   descr
+   archive-7z-update))
+
 ;; -------------------------------------------------------------------------
 ;;; Section `ar' archives.