SOURCES (DEVEL): mutt-rr.compressed.patch, mutt-cd.signatures_menu...
wrobell
wrobell at pld-linux.org
Mon Apr 17 18:17:42 CEST 2006
Author: wrobell Date: Mon Apr 17 16:17:42 2006 GMT
Module: SOURCES Tag: DEVEL
---- Log message:
- updated for mutt 1.5.11
---- Files affected:
SOURCES:
mutt-rr.compressed.patch (1.4.4.4 -> 1.4.4.5) , mutt-cd.signatures_menu.patch (1.1.4.1 -> 1.1.4.2) , mutt-manual.patch (1.1.4.2 -> 1.1.4.3)
---- Diffs:
================================================================
Index: SOURCES/mutt-rr.compressed.patch
diff -u SOURCES/mutt-rr.compressed.patch:1.4.4.4 SOURCES/mutt-rr.compressed.patch:1.4.4.5
--- SOURCES/mutt-rr.compressed.patch:1.4.4.4 Fri Oct 7 10:07:10 2005
+++ SOURCES/mutt-rr.compressed.patch Mon Apr 17 18:17:37 2006
@@ -1,1079 +1,498 @@
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/Makefile.am mutt-1.5.10/Makefile.am
---- mutt-1.5.10.orig/Makefile.am 2005-08-11 23:27:28.000000000 +0200
-+++ mutt-1.5.10/Makefile.am 2005-10-07 09:39:13.000000000 +0200
-@@ -18,7 +18,7 @@
- bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@
- mutt_SOURCES = $(BUILT_SOURCES) \
- addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \
-- crypt.c cryptglue.c \
-+ compress.c crypt.c cryptglue.c \
- commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
- edit.c enter.c flags.c init.c filter.c from.c getdomain.c \
- handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
-@@ -68,6 +68,7 @@
-
- EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
- configure account.h \
-+ compress.h \
- attach.h buffy.h charset.h copy.h crypthash.h dotlock.h functions.h gen_defs \
- globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
- mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/Makefile.in mutt-1.5.10/Makefile.in
---- mutt-1.5.10.orig/Makefile.in 2005-08-11 23:50:19.000000000 +0200
-+++ mutt-1.5.10/Makefile.in 2005-10-07 09:39:13.000000000 +0200
-@@ -14,6 +14,10 @@
-
- @SET_MAKE@
-
-+mutt_SOURCES += compress.c
-+EXTRA_DIST += compress.h
-+mutt_OBJECTS += compress.o
-+
-
- SOURCES = $(makedoc_SOURCES) $(mutt_SOURCES) $(EXTRA_mutt_SOURCES) $(mutt_dotlock_SOURCES) pgpewrap.c $(pgpring_SOURCES)
-
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/Muttrc.head mutt-1.5.10/Muttrc.head
---- mutt-1.5.10.orig/Muttrc.head 2005-08-11 23:49:51.000000000 +0200
-+++ mutt-1.5.10/Muttrc.head 2005-10-07 09:39:13.000000000 +0200
-@@ -19,6 +19,11 @@
- macro index <f1> "!less ${prefix}/doc/mutt/manual.txt\n" "Show Mutt documentation"
- macro pager <f1> "!less ${prefix}/doc/mutt/manual.txt\n" "Show Mutt documentation"
-
-+# Use folders which match on \\.gz$ as gzipped folders:
-+# open-hook \\.gz$ "gzip -cd %f > %t"
-+# close-hook \\.gz$ "gzip -c %t > %f"
-+# append-hook \\.gz$ "gzip -c %t >> %f"
-+
- # If Mutt is unable to determine your site's domain name correctly, you can
- # set the default here.
- #
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/PATCHES mutt-1.5.10/PATCHES
---- mutt-1.5.10.orig/PATCHES 2005-08-11 23:27:30.000000000 +0200
-+++ mutt-1.5.10/PATCHES 2005-10-07 09:39:13.000000000 +0200
-@@ -0,0 +1 @@
-+rr.compressed
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/config.h.in mutt-1.5.10/config.h.in
---- mutt-1.5.10.orig/config.h.in 2005-08-11 23:49:51.000000000 +0200
-+++ mutt-1.5.10/config.h.in 2005-10-07 09:39:13.000000000 +0200
-@@ -497,6 +497,9 @@
-
- /* Define to enable Sun mailtool attachments support. */
- #undef SUN_ATTACHMENT
-+
-+/* The compressed mailboxes support */
-+#undef USE_COMPRESSED
-
- /* Define to use dotlocking for mailboxes. */
- #undef USE_DOTLOCK
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/configure mutt-1.5.10/configure
---- mutt-1.5.10.orig/configure 2005-08-11 23:49:35.000000000 +0200
-+++ mutt-1.5.10/configure 2005-10-07 09:39:13.000000000 +0200
-@@ -867,6 +867,7 @@
- --enable-nfs-fix Work around an NFS with broken attributes caching
- --enable-buffy-size Use file size attribute instead of access time
- --enable-mailtool Enable Sun mailtool attachments support
-+ --enable-compressed Enable compressed folders support
- --enable-locales-fix The result of isprint() is unreliable
- --enable-exact-address Enable regeneration of email addresses
- --enable-hcache Enable header caching
-@@ -11235,6 +11236,18 @@
- fi
- fi
-
-+
-+# Check whether --enable-compressed or --disable-compressed was given.
-+if test "${enable_compressed+set}" = set; then
-+ enableval="$enable_compressed"
-+ if test x$enableval = xyes; then
-+ cat >> confdefs.h <<\EOF
-+#define USE_COMPRESSED 1
-+EOF
+diff -urN mutt-1.5.11/compress.c mutt-1.5.11-ro/compress.c
+--- mutt-1.5.11/compress.c 1970-01-01 01:00:00.000000000 +0100
++++ mutt-1.5.11-ro/compress.c 2005-09-27 13:26:58.000000000 +0200
+@@ -0,0 +1,487 @@
++/*
++ * Copyright (C) 1997 Alain Penders <Alain at Finale-Dev.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
+
-+ fi
-+fi
++#if HAVE_CONFIG_H
++# include "config.h"
++#endif
+
- if test $mutt_cv_regex = yes; then
-
- cat >>confdefs.h <<\_ACEOF
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/configure.in mutt-1.5.10/configure.in
---- mutt-1.5.10.orig/configure.in 2005-10-07 09:38:57.000000000 +0200
-+++ mutt-1.5.10/configure.in 2005-10-07 09:39:13.000000000 +0200
-@@ -746,6 +746,11 @@
- AC_DEFINE(SUN_ATTACHMENT,1,[ Define to enable Sun mailtool attachments support. ])
- fi])
-
-+AC_ARG_ENABLE(compressed, AC_HELP_STRING([--enable-compressed], [Enable compressed folders support]),
-+ [if test x$enableval = xyes; then
-+ AC_DEFINE(USE_COMPRESSED,1,[ Define to enable compressed folders support. ])
-+ fi])
++#include "mutt.h"
+
- AC_ARG_ENABLE(locales-fix, AC_HELP_STRING([--enable-locales-fix], [The result of isprint() is unreliable]),
- [if test x$enableval = xyes; then
- AC_DEFINE(LOCALES_HACK,1,[ Define if the result of isprint() is unreliable. ])
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/curs_main.c mutt-1.5.10/curs_main.c
---- mutt-1.5.10.orig/curs_main.c 2005-08-11 21:37:01.000000000 +0200
-+++ mutt-1.5.10/curs_main.c 2005-10-07 09:39:13.000000000 +0200
-@@ -1087,6 +1087,11 @@
- {
- int check;
-
+#ifdef USE_COMPRESSED
-+ if (Context->compressinfo && Context->realpath)
-+ mutt_str_replace (&LastFolder, Context->realpath);
-+ else
-+#endif
- mutt_str_replace (&LastFolder, Context->path);
- oldcount = Context ? Context->msgcount : 0;
-
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/doc/manual.sgml mutt-1.5.10/doc/manual.sgml
---- mutt-1.5.10.orig/doc/manual.sgml 2005-08-11 23:49:52.000000000 +0200
-+++ mutt-1.5.10/doc/manual.sgml 2005-10-07 09:39:13.000000000 +0200
-@@ -2576,6 +2576,168 @@
- macro pager \cb |urlview\n
- </verb></tscreen>
-
-+<sect1>Compressed folders Support (OPTIONAL)
-+<p>
-+
-+If Mutt was compiled with compressed folders support (by running the
-+<em/configure/ script with the <em/--enable-compressed/ flag), Mutt
-+can open folders stored in an arbitrary format, provided that the user
-+has a script to convert from/to this format to one of the accepted.
+
-+The most common use is to open compressed archived folders e.g. with
-+gzip.
++#include "mx.h"
++#include "mailbox.h"
++#include "mutt_curses.h"
+
-+In addition, the user can provide a script that gets a folder in an
-+accepted format and appends its context to the folder in the
-+user-defined format, which may be faster than converting the entire
-+folder to the accepted format, appending to it and converting back to
-+the user-defined format.
++#include <errno.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/stat.h>
+
-+There are three hooks defined (<ref id="open-hook" name="open-hook">,
-+<ref id="close-hook" name="close-hook"> and <ref id="append-hook"
-+name="append-hook">) which define commands to uncompress and compress
-+a folder and to append messages to an existing compressed folder
-+respectively.
++typedef struct
++{
++ const char *close; /* close-hook command */
++ const char *open; /* open-hook command */
++ const char *append; /* append-hook command */
++ off_t size; /* size of real folder */
++} COMPRESS_INFO;
+
-+For example:
+
-+<tscreen><verb>
-+open-hook \\.gz$ "gzip -cd %f > %t"
-+close-hook \\.gz$ "gzip -c %t > %f"
-+append-hook \\.gz$ "gzip -c %t >> %f"
-+</verb></tscreen>
-+
-+You do not have to specify all of the commands. If you omit <ref
-+id="append-hook" name="append-hook">, the folder will be open and
-+closed again each time you will add to it. If you omit <ref
-+id="close-hook" name="close-hook"> (or give empty command) , the
-+folder will be open in the mode. If you specify <ref
-+id="append-hook" name="append-hook"> though you'll be able to append
-+to the folder.
++/*
++ * ctx - context to lock
++ * excl - exclusive lock?
++ * retry - should retry if unable to lock?
++ */
++int mbox_lock_compressed (CONTEXT *ctx, FILE *fp, int excl, int retry)
++{
++ int r;
+
-+Note that Mutt will only try to use hooks if the file is not in one of
-+the accepted formats. In particular, if the file is empty, mutt
-+supposes it is not compressed. This is important because it allows the
-+use of programs that do not have well defined extensions. Just use
-+&dquot;.&dquot; as a regexp. But this may be surprising if your
-+compressing script produces empty files. In this situation, unset <ref
-+id="save_empty" name="$save_empty">, so that the compressed file
-+will be removed if you delete all of the messages.
-+
-+<sect2>Open a compressed mailbox for reading<label id="open-hook">
-+<p>
-+Usage: <tt/open-hook/ <em/regexp/ &dquot;<em/command/&dquot;
-+
-+The <em/command/ is the command that can be used for opening the
-+folders whose names match <em/regexp/.
-+
-+The <em/command/ string is the printf-like format string, and it
-+should accept two parameters: %f, which is replaced with the
-+(compressed) folder name, and %t which is replaced with the
-+name of the temporary folder to which to write.
++ if ((r = mx_lock_file (ctx->realpath, fileno (fp), excl, 1, retry)) == 0)
++ ctx->locked = 1;
++ else if (retry && !excl)
++ {
++ ctx->readonly = 1;
++ return 0;
++ }
+
-+%f and %t can be repeated any number of times in the
-+command string, and all of the entries are replaced with the
-+appropriate folder name. In addition, %% is replaced by
-+%, as in printf, and any other %anything is left as is.
++ return (r);
++}
+
-+The <em/command/ should <bf/not/ remove the original compressed file.
-+The <em/command/ should return non-zero exit status if it fails, so
-+mutt knows something's wrong.
++void mbox_unlock_compressed (CONTEXT *ctx, FILE *fp)
++{
++ if (ctx->locked)
++ {
++ fflush (fp);
+
-+Example:
++ mx_unlock_file (ctx->realpath, fileno (fp), 1);
++ ctx->locked = 0;
++ }
++}
+
-+<tscreen><verb>
-+open-hook \\.gz$ "gzip -cd %f > %t"
-+</verb></tscreen>
-+
-+If the <em/command/ is empty, this operation is disabled for this file
-+type.
-+
-+<sect2>Write a compressed mailbox<label id="close-hook">
-+<p>
-+Usage: <tt/close-hook/ <em/regexp/ &dquot;<em/command/&dquot;
-+
-+This is used to close the folder that was open with the <ref id="open-hook"
-+name="open-hook"> command after some changes were made to it.
-+
-+The <em/command/ string is the command that can be used for closing the
-+folders whose names match <em/regexp/. It has the same format as in
-+the <ref id="open-hook" name="open-hook"> command. Temporary folder
-+in this case is the folder previously produced by the <<ref id="open-hook"
-+name="open-hook"> command.
-+
-+The <em/command/ should <bf/not/ remove the decompressed file. The
-+<em/command/ should return non-zero exit status if it fails, so mutt
-+knows something's wrong.
++static int is_new (const char *path)
++{
++ return (access (path, W_OK) != 0 && errno == ENOENT) ? 1 : 0;
++}
+
-+Example:
++static const char* find_compress_hook (int type, const char *path)
++{
++ const char* c = mutt_find_hook (type, path);
++ return (!c || !*c) ? NULL : c;
++}
+
-+<tscreen><verb>
-+close-hook \\.gz$ "gzip -c %t > %f"
-+</verb></tscreen>
-+
-+If the <em/command/ is empty, this operation is disabled for this file
-+type, and the file can only be open in the readonly mode.
-+
-+<ref id="close-hook" name ="close-hook"> is not called when you exit
-+from the folder if the folder was not changed.
-+
-+<sect2>Append a message to a compressed mailbox<label id="append-hook">
-+<p>
-+Usage: <tt/append-hook/ <em/regexp/ &dquot;<em/command/&dquot;
-+
-+This command is used for saving to an existing compressed folder.
-+The <em/command/ is the command that can be used for appending to the
-+folders whose names match <em/regexp/. It has the same format as in
-+ the <ref id="open-hook" name="open-hook"> command.
-+The temporary folder in this case contains the messages that are being
-+appended.
-+
-+The <em/command/ should <bf/not/ remove the decompressed file. The
-+<em/command/ should return non-zero exit status if it fails, so mutt
-+knows something's wrong.
++int mutt_can_read_compressed (const char *path)
++{
++ return find_compress_hook (M_OPENHOOK, path) ? 1 : 0;
++}
+
-+Example:
++/*
++ * if the file is new, we really do not append, but create, and so use
++ * close-hook, and not append-hook
++ */
++static const char* get_append_command (const char *path, const CONTEXT* ctx)
++{
++ COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
++ return (is_new (path)) ? ci->close : ci->append;
++}
+
-+<tscreen><verb>
-+append-hook \\.gz$ "gzip -c %t >> %f"
-+</verb></tscreen>
-+
-+When <ref id="append-hook" name="append-hook"> is used, the folder is
-+not opened, which saves time, but this means that we can not find out
-+what the folder type is. Thus the default (<ref id="mbox_type"
-+name="$mbox_type">) type is always supposed (i.e.
-+this is the format used for the temporary folder).
-+
-+If the file does not exist when you save to it, <ref id="close-hook"
-+name="close-hook"> is called, and not <ref id="append-hook"
-+name="append-hook">. <ref id="append-hook" name="append-hook"> is only
-+for appending to existing folders.
-+
-+If the <em/command/ is empty, this operation is disabled for this file
-+type. In this case, the folder will be open and closed again (using
-+<ref id="open-hook" name="open-hook"> and <ref id="close-hook"
-+name="close-hook">respectively) each time you will add to it.
++int mutt_can_append_compressed (const char *path)
++{
++ int magic;
+
-+<sect2>Encrypted folders
-+<p>
-+The compressed folders support can also be used to handle encrypted
-+folders. If you want to encrypt a folder with PGP, you may want to use
-+the following hooks:
++ if (is_new (path))
++ return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0);
+
-+<tscreen><verb>
-+open-hook \\.pgp$ "pgp -f < %f > %t"
-+close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId < %t > %f"
-+</verb></tscreen>
++ magic = mx_get_magic (path);
+
-+Please note, that PGP does not support appending to an encrypted
-+folder, so there is no append-hook defined.
++ if (magic != 0 && magic != M_COMPRESSED)
++ return 0;
+
-+<bf/Note:/ the folder is temporary stored decrypted in the /tmp
-+directory, where it can be read by your system administrator. So think
-+about the security aspects of this.
-+
- <sect>Mutt's MIME Support
- <p>
- Quite a bit of effort has been made to make Mutt the premier text-mode
-@@ -3156,6 +3318,8 @@
- <item>
- <tt><ref id="alternative_order" name="unalternative_order"></tt> <em/mimetype/ [ <em/mimetype/ ... ]
- <item>
-+<tt><ref id="append-hook" name="append-hook"></tt> <em/regexp/ <em/command/
-+<item>
- <tt><ref id="auto_view" name="auto_view"></tt> <em/mimetype/ [ <em/mimetype/ ... ]
- <item>
- <tt><ref id="auto_view" name="unauto_view"></tt> <em/mimetype/ [ <em/mimetype/ ... ]
-@@ -3164,6 +3328,8 @@
- <item>
- <tt><ref id="charset-hook" name="charset-hook"></tt> <em/alias/ <em/charset/
- <item>
-+<tt><ref id="close-hook" name="close-hook"></tt> <em/regexp/ <em/command/
-+<item>
- <tt><ref id="color" name="color"></tt> <em/object/ <em/foreground/ <em/background/ [ <em/regexp/ ]
- <item>
- <tt><ref id="color" name="uncolor"></tt> <em/index/ <em/pattern/ [ <em/pattern/ ... ]
-@@ -3210,6 +3376,8 @@
- <item>
- <tt><ref id="my_hdr" name="unmy_hdr"></tt> <em/field/ [ <em/field/ ... ]
- <item>
-+<tt><ref id="open-hook" name="open-hook"></tt> <em/regexp/ <em/command/
-+<item>
- <tt><ref id="crypt-hook" name="crypt-hook"></tt> <em/pattern/ <em/key-id/
- <item>
- <tt><ref id="push" name="push"></tt> <em/string/
-diff -dur -x '*~' -x '*.orig' mutt-1.5.10.orig/doc/manual.sgml.head mutt-1.5.10/doc/manual.sgml.head
---- mutt-1.5.10.orig/doc/manual.sgml.head 2005-08-11 21:37:02.000000000 +0200
-+++ mutt-1.5.10/doc/manual.sgml.head 2005-10-07 09:39:13.000000000 +0200
-@@ -2576,6 +2576,168 @@
- macro pager \cb |urlview\n
- </verb></tscreen>
-
-+<sect1>Compressed folders Support (OPTIONAL)
-+<p>
++ return (find_compress_hook (M_APPENDHOOK, path)
++ || (find_compress_hook (M_OPENHOOK, path)
++ && find_compress_hook (M_CLOSEHOOK, path))) ? 1 : 0;
++}
+
-+If Mutt was compiled with compressed folders support (by running the
-+<em/configure/ script with the <em/--enable-compressed/ flag), Mutt
-+can open folders stored in an arbitrary format, provided that the user
-+has a script to convert from/to this format to one of the accepted.
++/* open a compressed mailbox */
++static COMPRESS_INFO *set_compress_info (CONTEXT *ctx)
++{
++ COMPRESS_INFO *ci;
+
-+The most common use is to open compressed archived folders e.g. with
-+gzip.
++ /* Now lets uncompress this thing */
++ ci = safe_malloc (sizeof (COMPRESS_INFO));
++ ctx->compressinfo = (void*) ci;
++ ci->append = find_compress_hook (M_APPENDHOOK, ctx->path);
++ ci->open = find_compress_hook (M_OPENHOOK, ctx->path);
++ ci->close = find_compress_hook (M_CLOSEHOOK, ctx->path);
++ return ci;
++}
+
-+In addition, the user can provide a script that gets a folder in an
-+accepted format and appends its context to the folder in the
-+user-defined format, which may be faster than converting the entire
-+folder to the accepted format, appending to it and converting back to
-+the user-defined format.
++static void set_path (CONTEXT* ctx)
++{
++ char tmppath[_POSIX_PATH_MAX];
+
-+There are three hooks defined (<ref id="open-hook" name="open-hook">,
-+<ref id="close-hook" name="close-hook"> and <ref id="append-hook"
-+name="append-hook">) which define commands to uncompress and compress
-+a folder and to append messages to an existing compressed folder
-+respectively.
++ /* Setup the right paths */
++ ctx->realpath = ctx->path;
+
-+For example:
++ /* Uncompress to /tmp */
++ mutt_mktemp (tmppath);
++ ctx->path = safe_malloc (strlen (tmppath) + 1);
++ strcpy (ctx->path, tmppath);
++}
+
-+<tscreen><verb>
-+open-hook \\.gz$ "gzip -cd %f > %t"
-+close-hook \\.gz$ "gzip -c %t > %f"
-+append-hook \\.gz$ "gzip -c %t >> %f"
-+</verb></tscreen>
-+
-+You do not have to specify all of the commands. If you omit <ref
-+id="append-hook" name="append-hook">, the folder will be open and
-+closed again each time you will add to it. If you omit <ref
-+id="close-hook" name="close-hook"> (or give empty command) , the
-+folder will be open in the mode. If you specify <ref
-+id="append-hook" name="append-hook"> though you'll be able to append
-+to the folder.
++static int get_size (const char* path)
++{
++ struct stat sb;
++ if (stat (path, &sb) != 0)
++ return 0;
++ return (sb.st_size);
++}
+
-+Note that Mutt will only try to use hooks if the file is not in one of
-+the accepted formats. In particular, if the file is empty, mutt
-+supposes it is not compressed. This is important because it allows the
-+use of programs that do not have well defined extensions. Just use
-+&dquot;.&dquot; as a regexp. But this may be surprising if your
-+compressing script produces empty files. In this situation, unset <ref
-+id="save_empty" name="$save_empty">, so that the compressed file
-+will be removed if you delete all of the messages.
-+
-+<sect2>Open a compressed mailbox for reading<label id="open-hook">
-+<p>
-+Usage: <tt/open-hook/ <em/regexp/ &dquot;<em/command/&dquot;
-+
-+The <em/command/ is the command that can be used for opening the
-+folders whose names match <em/regexp/.
-+
-+The <em/command/ string is the printf-like format string, and it
-+should accept two parameters: %f, which is replaced with the
-+(compressed) folder name, and %t which is replaced with the
-+name of the temporary folder to which to write.
++static void store_size (CONTEXT* ctx)
++{
++ COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
++ ci->size = get_size (ctx->realpath);
++}
+
-+%f and %t can be repeated any number of times in the
-+command string, and all of the entries are replaced with the
-+appropriate folder name. In addition, %% is replaced by
-+%, as in printf, and any other %anything is left as is.
++static const char *
++compresshook_format_str (char *dest, size_t destlen, char op, const char *src,
++ const char *fmt, const char *ifstring,
++ const char *elsestring, unsigned long data,
++ format_flag flags)
++{
++ char tmp[SHORT_STRING];
+
-+The <em/command/ should <bf/not/ remove the original compressed file.
-+The <em/command/ should return non-zero exit status if it fails, so
-+mutt knows something's wrong.
++ CONTEXT *ctx = (CONTEXT *) data;
++ switch (op)
++ {
++ case 'f':
++ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
++ snprintf (dest, destlen, tmp, ctx->realpath);
++ break;
++ case 't':
++ snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
++ snprintf (dest, destlen, tmp, ctx->path);
++ break;
++ }
++ return (src);
++}
+
-+Example:
++/*
++ * check that the command has both %f and %t
++ * 0 means OK, -1 means error
++ */
++int mutt_test_compress_command (const char* cmd)
++{
++ return (strstr (cmd, "%f") && strstr (cmd, "%t")) ? 0 : -1;
++}
+
-+<tscreen><verb>
-+open-hook \\.gz$ "gzip -cd %f > %t"
-+</verb></tscreen>
-+
-+If the <em/command/ is empty, this operation is disabled for this file
-+type.
-+
-+<sect2>Write a compressed mailbox<label id="close-hook">
-+<p>
-+Usage: <tt/close-hook/ <em/regexp/ &dquot;<em/command/&dquot;
-+
-+This is used to close the folder that was open with the <ref id="open-hook"
-+name="open-hook"> command after some changes were made to it.
-+
-+The <em/command/ string is the command that can be used for closing the
-+folders whose names match <em/regexp/. It has the same format as in
-+the <ref id="open-hook" name="open-hook"> command. Temporary folder
-+in this case is the folder previously produced by the <<ref id="open-hook"
-+name="open-hook"> command.
-+
-+The <em/command/ should <bf/not/ remove the decompressed file. The
-+<em/command/ should return non-zero exit status if it fails, so mutt
-+knows something's wrong.
++static char *get_compression_cmd (const char* cmd, const CONTEXT* ctx)
++{
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/mutt-rr.compressed.patch?r1=1.4.4.4&r2=1.4.4.5&f=u
http://cvs.pld-linux.org/SOURCES/mutt-cd.signatures_menu.patch?r1=1.1.4.1&r2=1.1.4.2&f=u
http://cvs.pld-linux.org/SOURCES/mutt-manual.patch?r1=1.1.4.2&r2=1.1.4.3&f=u
More information about the pld-cvs-commit
mailing list