commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-102-g36656d1


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-102-g36656d1
Date: Sat, 25 Sep 2010 09:33:47 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=36656d1f5af44810ca63fe3c97c7a56c0bc19173

The branch, master has been updated
       via  36656d1f5af44810ca63fe3c97c7a56c0bc19173 (commit)
       via  c42bddb0b814375bf68db9ee17fb77b888befaaa (commit)
      from  3c21c6583253be9edfd9e4c1e1fc6c07726be499 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 36656d1f5af44810ca63fe3c97c7a56c0bc19173
Author: Sergey Poznyakoff <address@hidden>
Date:   Sat Sep 25 12:09:17 2010 +0300

    Fix hex (%XX) expansion in URLs.
    
    * mailbox/url.c (url_parse0): Take three arguments.  Return in the
    third one a boolean indicating whether to expand %XX notations in
    the URL.  Do not decode absolute file names and pipes.
    (mu_url_parse): Use this value to decide.
    * movemail/movemail.c (main): In emacs mode: force UNIX mbox
    format as a default.  Send debugging output to stderr.
    * libmailutils/tests/url.at: Add new tests.

commit c42bddb0b814375bf68db9ee17fb77b888befaaa
Author: Sergey Poznyakoff <address@hidden>
Date:   Sat Sep 25 12:05:53 2010 +0300

    Minor changes.
    
    * am/debug.m4 (MU_DEBUG_MODE): Rewrite. Use -Wdeclaration-after-statement
    if supported.
    * comsat/oldcfg.c: Remove.
    * comsat/Makefile.am (comsatd_SOURCES): Remove oldcfg.c.
    * comsat/comsat.c: Remove the obsolete --config and --convert-config 
options.
    * comsat/comsat.h (convert_config): Remove.

-----------------------------------------------------------------------

Summary of changes:
 am/debug.m4               |   39 +++++++++------
 comsat/Makefile.am        |    2 +-
 comsat/comsat.c           |   30 ------------
 comsat/comsat.h           |    1 -
 comsat/oldcfg.c           |  112 ---------------------------------------------
 libmailutils/tests/url.at |   38 +++++++++++++++-
 libmailutils/url.c        |   35 ++++++++------
 movemail/movemail.c       |    8 +++
 8 files changed, 89 insertions(+), 176 deletions(-)
 delete mode 100644 comsat/oldcfg.c

diff --git a/am/debug.m4 b/am/debug.m4
index 8e13b52..ff64ba8 100644
--- a/am/debug.m4
+++ b/am/debug.m4
@@ -16,19 +16,26 @@ dnl
 AC_DEFUN([MU_DEBUG_MODE],
   [AC_ARG_ENABLE(debug,                     
     AC_HELP_STRING([--enable-debug], [enable debugging mode]),
-    [if test x"$enableval" = xyes; then
-       if test x"$GCC" = xyes; then
-        AC_MSG_CHECKING([whether gcc accepts -ggdb])
-         save_CFLAGS=$CFLAGS
-         CFLAGS="-ggdb -Wall"
-         AC_TRY_COMPILE([],void f(){},
-           AC_MSG_RESULT(yes),
-           [if test x"$ac_cv_prog_cc_g" = xyes; then
-              CFLAGS="-g -Wall"
-            else
-              CFLAGS=
-            fi
-            AC_MSG_RESULT(no)])
-         CFLAGS="`echo $save_CFLAGS | sed 's/-O[[0-9]]//g'` $CFLAGS"
-       fi
-     fi])])
+    [mu_debug_mode=$enableval],
+    [mu_debug_mode=maybe])
+    
+   save_CC=$CC
+   CC="$CC -Wall"
+   AC_TRY_COMPILE([],[void main(){}],
+                  [CFLAGS="$CFLAGS -Wall"])
+                 
+   CC="$CC -Wdeclaration-after-statement"
+   AC_TRY_COMPILE([],[void main(){}],
+                  [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
+   
+   if test "$mu_debug_mode" != no; then
+     CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//g'`
+     AC_MSG_CHECKING([whether cc accepts -ggdb])
+     CC="$CC -ggdb"
+     AC_TRY_COMPILE([],[void main(){}],
+                    [AC_MSG_RESULT(yes)
+                    CFLAGS="$CFLAGS -ggdb"],
+                   [AC_MSG_RESULT(no)
+                    CFLAGS="$CFLAGS -g"])
+   fi
+   CC=$save_CC])
diff --git a/comsat/Makefile.am b/comsat/Makefile.am
index bd00831..e218e65 100644
--- a/comsat/Makefile.am
+++ b/comsat/Makefile.am
@@ -22,7 +22,7 @@ INCLUDES = @MU_APP_COMMON_INCLUDES@
 
 sbin_PROGRAMS = comsatd
 
-comsatd_SOURCES = action.c comsat.c comsat.h oldcfg.c
+comsatd_SOURCES = action.c comsat.c comsat.h 
 AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\"
 
 comsatd_LDADD = \
diff --git a/comsat/comsat.c b/comsat/comsat.c
index ca11efe..4ec589b 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -63,9 +63,6 @@ static char args_doc[] = N_("\n--test MBOX-URL MSG-QID");
 
 static struct argp_option options[] = 
 {
-  { "config", 'c', N_("FILE"), OPTION_HIDDEN, "", 0 },
-  { "convert-config", 'C', N_("FILE"), 0,
-    N_("convert the configuration FILE to new format"), 0 },
   { "test", 't', NULL, 0, N_("run in test mode"), 0 },
   { "foreground", OPT_FOREGROUND, 0, 0, N_("remain in foreground"), 0},
   { "inetd",  'i', 0, 0, N_("run in inetd mode"), 0 },
@@ -151,33 +148,6 @@ comsatd_parse_opt (int key, char *arg, struct argp_state 
*state)
 
   switch (key)
     {
-    case 'c':
-      {
-       char *cfg;
-       int fd;
-       FILE *fp;
-
-       mu_diag_output (MU_DIAG_WARNING,
-_("The old configuration file format and the --config command\n"
-  "line option are deprecated and will be removed in the future\n"
-  "release. Please use --convert-config option to convert your\n"
-  "settings to the new format."));
-       /* FIXME: Refer to the docs */
-       
-       fd = mu_tempfile (NULL, &cfg);
-       fp = fdopen (fd, "w");
-       convert_config (arg, fp);
-       fclose (fp);
-       mu_get_config (cfg, mu_program_name, comsat_cfg_param, 0, NULL);
-       unlink (cfg);
-       free (cfg);
-      }
-      break;
-      
-    case 'C':
-      convert_config (arg, stdout);
-      exit (0);
-
     case 'd':
       mu_argp_node_list_new (lst, "mode", "daemon");
       if (arg)
diff --git a/comsat/comsat.h b/comsat/comsat.h
index d2a932c..b9e9a0b 100644
--- a/comsat/comsat.h
+++ b/comsat/comsat.h
@@ -79,5 +79,4 @@ extern char hostname[];
 extern struct daemon_param daemon_param;
 
 void run_user_action (FILE *tty, const char *cr, mu_message_t msg);
-void convert_config (const char *config_file, FILE *outfile);
 
diff --git a/comsat/oldcfg.c b/comsat/oldcfg.c
deleted file mode 100644
index c46cf3a..0000000
--- a/comsat/oldcfg.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* This file is part of GNU Mailutils.
-   Copyright (C) 1998, 2001, 2002, 2005, 2007, 2009, 2010 Free Software
-   Foundation, Inc.
-
-   GNU Mailutils 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 3, or (at your option)
-   any later version.
-
-   GNU Mailutils is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR 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 GNU Mailutils; see the file COPYING.  If not, write
-   to the Free Software Foundation, Inc., 51 Franklin Street,
-   Fifth Floor, Boston, MA 02110-1301 USA. */
-
-#include "comsat.h"
-
-static int
-print_and_free_acl (void *item, void *data)
-{
-  FILE *outfile = data;
-  char **argv = item;
-  
-  fprintf (outfile, "  %s from %s;\n", argv[1], argv[2]);
-  mu_argv_free (argv);
-  return 0;
-}
-    
-void
-convert_config (const char *config_file, FILE *outfile)
-{
-  FILE *fp;
-  int line;
-  char buf[128];
-  char *ptr;
-  mu_list_t aclist = NULL;
-  
-  if (!config_file)
-    return;
-
-  fp = fopen (config_file, "r");
-  if (!fp)
-    {
-      mu_error (_("cannot open config file %s: %s"), config_file,
-               mu_strerror (errno));
-      return;
-    }
-
-  fprintf (outfile,
-          "# Configuration file for GNU comsatd, converted from %s\n",
-          config_file);
-  fprintf (outfile,
-          "# Copy it to the comsatd configuration file\n");
-  fprintf (outfile,
-          "# or to %s/mailutils.rc, in section `program %s'\n\n",
-          SYSCONFDIR, mu_program_name);
-
-  line = 0;
-  while ((ptr = fgets (buf, sizeof buf, fp)))
-    {
-      int len;
-      int argc;
-      char **argv;
-
-      line++;
-      len = strlen (ptr);
-      if (len > 0 && ptr[len-1] == '\n')
-       ptr[--len] = 0;
-
-      while (*ptr && mu_isblank (*ptr))
-       ptr++;
-      if (!*ptr || *ptr == '#')
-       {
-         fprintf (outfile, "%s\n", ptr);
-         continue;
-       }
-
-      mu_argcv_get (ptr, "", NULL, &argc, &argv);
-      if (argc < 2)
-       {
-         mu_error (_("%s:%d: too few fields"), config_file, line);
-         mu_argcv_free (argc, argv);
-         continue;
-       }
-
-      if (strcmp (argv[0], "acl") == 0)
-       {
-         if (!aclist)
-           mu_list_create (&aclist);
-         mu_list_append (aclist, argv);
-       }
-      else
-       {
-         mu_argcv_free (argc, argv);
-         fprintf (outfile, "%s;\n", ptr);
-       }
-    }
-  fclose (fp);
-
-  if (aclist)
-    {
-      fprintf (outfile, "acl {\n");
-      mu_list_do (aclist, print_and_free_acl, outfile);
-      fprintf (outfile, "};\n");
-      mu_list_destroy (&aclist);
-    }
-}
-
diff --git a/libmailutils/tests/url.at b/libmailutils/tests/url.at
index f942c81..c22d998 100644
--- a/libmailutils/tests/url.at
+++ b/libmailutils/tests/url.at
@@ -24,7 +24,7 @@ m4_pushdef([TESTURL],[
 m4_pushdef([MU_TEST_GROUP],[Url])
 m4_pushdef([MU_TEST_KEYWORDS],[url])
 m4_pushdef([MU_TEST_COMMAND],[url-parse])
-MU_GENERIC_TEST([$1],[$2],[$3],[],[$4],[$5])
+MU_GENERIC_TEST([$1],[$2 url-m4_translit($3,[ ],[_])],[$3],[],[$4],[$5])
 m4_popdef([MU_TEST_COMMAND])
 m4_popdef([MU_TEST_KEYWORDS])
 m4_popdef([MU_TEST_GROUP])
@@ -774,4 +774,40 @@ query[1] <arg 1>
 query[2] <arg 2>
 ]])
 
+TESTURL([],[],
+[/usr/sbin/sendmail],
+[scheme <file>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </usr/sbin/sendmail>
+])
+
+TESTURL([],[],
+[/var/spool/mail/gray%40gnu.org],
+[scheme <file>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </var/spool/mail/gray%40gnu.org>
+])
+
+TESTURL([],[],
+[| /bin/mailman request list%40dom],
+[[scheme <prog>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </bin/mailman>
+query[0] </bin/mailman>
+query[1] <request>
+query[2] <list%40dom>
+]])
+
 m4_popdef([TESTURL])
diff --git a/libmailutils/url.c b/libmailutils/url.c
index 5f7379d..d635157 100644
--- a/libmailutils/url.c
+++ b/libmailutils/url.c
@@ -40,7 +40,7 @@
 #define AC2(a,b) a ## b
 #define AC4(a,b,c,d) a ## b ## c ## d
 
-static int url_parse0 (mu_url_t, char *, size_t *poff);
+static int url_parse0 (mu_url_t, char *, size_t *poff, int *decode);
 
 static int
 parse_query (const char *query,
@@ -286,7 +286,8 @@ mu_url_parse (mu_url_t url)
   struct _mu_url u;
   size_t pstart;
   mu_secret_t newsec;
-
+  int want_decode;
+  
   if (!url || !url->name)
     return EINVAL;
 
@@ -301,7 +302,7 @@ mu_url_parse (mu_url_t url)
   if (!n)
     return ENOMEM;
 
-  err = url_parse0 (&u, n, &pstart);
+  err = url_parse0 (&u, n, &pstart, &want_decode);
 
   if (!err)
     {
@@ -331,17 +332,18 @@ mu_url_parse (mu_url_t url)
         though.
        */
 
-#define UALLOC(X)                                          \
-  if (u.X && u.X[0] && (url->X = mu_url_decode(u.X)) == 0) \
-    {                                                      \
-       err = ENOMEM;                                       \
-       goto CLEANUP;                                       \
-    }                                                      \
-  else                                                     \
-    {                                                      \
-       /* Set zero-length strings to NULL. */              \
-       u.X = NULL; \
-    }
+#define UALLOC(X)                                                      \
+      if (u.X && u.X[0] &&                                             \
+         !(url->X = (want_decode ? mu_url_decode (u.X) : strdup (u.X)))) \
+       {                                                               \
+         err = ENOMEM;                                                 \
+         goto CLEANUP;                                                 \
+       }                                                               \
+      else                                                             \
+       {                                                               \
+         /* Set zero-length strings to NULL. */                        \
+         u.X = NULL;                                                   \
+       }
 
       UALLOC (scheme);
       UALLOC (user);
@@ -420,7 +422,7 @@ Is this required to be % quoted, though? I hope so!
 */
 
 static int
-url_parse0 (mu_url_t u, char *name, size_t *poff)
+url_parse0 (mu_url_t u, char *name, size_t *poff, int *decode)
 {
   char *start = name;
   char *p;                     /* pointer into name */
@@ -432,11 +434,13 @@ url_parse0 (mu_url_t u, char *name, size_t *poff)
   if (name[0] == '/')
     {
       u->scheme = "file";
+      *decode = 0;
     }
   else if (name[0] == '|')
     {
       int rc;
       u->scheme = "prog";
+      *decode = 0;
       rc = mu_argcv_get (name + 1, NULL, NULL, &u->qargc, &u->qargv);
       if (rc == 0)
        {
@@ -448,6 +452,7 @@ url_parse0 (mu_url_t u, char *name, size_t *poff)
     }
   else
     {
+      *decode = 1;
       /* Parse out the SCHEME. */
       p = strchr (name, ':');
       if (p == NULL)
diff --git a/movemail/movemail.c b/movemail/movemail.c
index 985242f..ddbeb14 100644
--- a/movemail/movemail.c
+++ b/movemail/movemail.c
@@ -759,6 +759,14 @@ main (int argc, char **argv)
       return 1;
     }
 
+  if (emacs_mode)
+    {
+      /* Undo the effect of configuration options that may affect
+        the interaction with Emacs. */
+      mu_registrar_set_default_record (mu_mbox_record);
+      mu_debug_default_printer = mu_debug_stderr_printer;
+    }
+  
   atexit (close_mailboxes);
   
   source_name = argv[0];


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]