commit-mailutils
[Top][All Lists]
Advanced

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

[SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg-331-g9813be4
Date: Tue, 25 Aug 2009 19:04:51 +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=9813be458d631d21b05164e794a9ab335eb00c96

The branch, master has been updated
       via  9813be458d631d21b05164e794a9ab335eb00c96 (commit)
      from  2141acfb58732dab8cdb6ffff18550c0ebf016b5 (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 9813be458d631d21b05164e794a9ab335eb00c96
Author: Sergey Poznyakoff <address@hidden>
Date:   Tue Aug 25 20:44:24 2009 +0300

    Minor improvements in comsat and frm
    
    * comsat/action.c (action_exec): Remove `line' argument.
    Do not explicitly add locus to the messages.
    (run_user_action): Add locus to diagnostics mu_debug_t,
    so it is prepended to all diagnostic messages automatically.
    * comsat/comsat.c: Improve help output
    * frm/frm.c (attr_help): Remove unnecessary variable.

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

Summary of changes:
 comsat/action.c |   33 +++++++++++++++++++++------------
 comsat/comsat.c |    3 ++-
 frm/frm.c       |   17 ++++++++---------
 3 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/comsat/action.c b/comsat/action.c
index 74baf18..cea5473 100644
--- a/comsat/action.c
+++ b/comsat/action.c
@@ -18,6 +18,7 @@
    MA 02110-1301 USA */
 
 #include "comsat.h"
+#include <mailutils/io.h>
 #define obstack_chunk_alloc malloc
 #define obstack_chunk_free free
 #include <obstack.h>
@@ -287,35 +288,32 @@ action_echo (FILE *tty, const char *cr, int omit_newline,
 }
 
 static void
-action_exec (FILE *tty, int line, int argc, char **argv)
+action_exec (FILE *tty, int argc, char **argv)
 {
   pid_t pid;
   struct stat stb;
 
   if (argc == 0)
     {
-      mu_diag_output (MU_DIAG_ERROR, _("%s:.biffrc:%d: no arguments for 
exec"), username, line);
+      mu_diag_output (MU_DIAG_ERROR, _("no arguments for exec"));
       return;
     }
 
   if (argv[0][0] != '/')
     {
-      mu_diag_output (MU_DIAG_ERROR, _("%s:.biffrc:%d: not an absolute 
pathname"),
-             username, line);
+      mu_diag_output (MU_DIAG_ERROR, _("not an absolute pathname: %s"), 
argv[0]);
       return;
     }
 
   if (stat (argv[0], &stb))
     {
-      mu_diag_output (MU_DIAG_ERROR, _("%s:.biffrc:%d: cannot stat %s: %s"),
-             username, line, argv[0], strerror (errno));
+      mu_diag_funcall (MU_DIAG_ERROR, "stat", argv[0], errno);
       return;
     }
 
   if (stb.st_mode & (S_ISUID|S_ISGID))
     {
-      mu_diag_output (MU_DIAG_ERROR, _("%s:.biffrc:%d: will not execute 
set[ug]id programs"),
-             username, line);
+      mu_diag_output (MU_DIAG_ERROR, _("will not execute set[ug]id programs"));
       return;
     }
 
@@ -374,7 +372,15 @@ run_user_action (FILE *tty, const char *cr, mu_message_t 
msg)
   if (fp)
     {
       unsigned line = 1, n;
-
+      mu_debug_t debug;
+      char *cwd = mu_getcwd ();
+      char *rcname;
+
+      mu_asprintf (&rcname, "%s/%s", cwd, BIFF_RC);
+      free (cwd);
+      
+      mu_diag_get_debug (&debug);
+      
       while ((n = act_getline (fp, &stmt, &size)))
        {
          int argc;
@@ -384,6 +390,7 @@ run_user_action (FILE *tty, const char *cr, mu_message_t 
msg)
              && argc
              && argv[0][0] != '#')
            {
+             mu_debug_set_locus (debug, rcname, line);
              if (strcmp (argv[0], "beep") == 0)
                {
                  /* FIXME: excess arguments are ignored */
@@ -412,15 +419,15 @@ run_user_action (FILE *tty, const char *cr, mu_message_t 
msg)
                    }
                  else if (strcmp (argv[0], "exec") == 0)
                    {
-                     action_exec (tty, line, argc - 1, argv + 1);
+                     action_exec (tty, argc - 1, argv + 1);
                      nact++;
                    }
                  else
                    {
                      fprintf (tty, _(".biffrc:%d: unknown keyword"), line);
                      fprintf (tty, "\r\n");
-                     mu_diag_output (MU_DIAG_ERROR, _("%s:.biffrc:%d: unknown 
keyword %s"),
-                             username, line, argv[0]);
+                     mu_diag_output (MU_DIAG_ERROR, _("unknown keyword %s"),
+                                     argv[0]);
                      break;
                    }
                } 
@@ -429,6 +436,8 @@ run_user_action (FILE *tty, const char *cr, mu_message_t 
msg)
          line += n;
        }
       fclose (fp);
+      mu_debug_set_locus (debug, NULL, 0);
+      free (rcname);
     }
 
   if (nact == 0)
diff --git a/comsat/comsat.c b/comsat/comsat.c
index 725685f..66dd429 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -55,6 +55,7 @@ typedef struct utmp UTMP;
 
 const char *program_version = "comsatd (" PACKAGE_STRING ")";
 static char doc[] = "GNU comsatd";
+static char args_doc[] = N_("\n--test MBOX-URL MSG-QID");
 
 #define OPT_FOREGROUND 256
 
@@ -77,7 +78,7 @@ static error_t comsatd_parse_opt (int key, char *arg,
 static struct argp argp = {
   options,
   comsatd_parse_opt,
-  NULL, 
+  args_doc, 
   doc,
   NULL,
   NULL, NULL
diff --git a/frm/frm.c b/frm/frm.c
index 30483e8..a4dc096 100644
--- a/frm/frm.c
+++ b/frm/frm.c
@@ -46,13 +46,6 @@ static struct attr_tab {
   { NULL }
 };
 
-static char attr_help[] =
-/* TRANSLATORS: Please do *not* translate the words "new", "unread",
-   "old" and "read". They are keywords. */
-N_("select messages with the specific attribute: \
-new, unread, old (same as unread) or read (or any unambiguous \
-abbreviation of these)");
-
 
 /* Attribute table handling */
 
@@ -127,10 +120,16 @@ static struct argp_option options[] = {
   {"field",  'f', N_("NAME"), 0, N_("header field to display"), 0},
   {"to",     'l', NULL,   0, N_("include the To: information"), 0},
   {"number", 'n', NULL,   0, N_("display message numbers"), 0},
-  {"Quiet",  'Q', NULL,   0, N_("very quiet"), 0},
+  {"Quiet",  'Q', NULL,   0, N_("do not display headers"), 0},
   {"query",  'q', NULL,   0, N_("print a message if the mailbox contains some 
unread mail"), 0},
   {"summary",'S', NULL,   0, N_("print a summary of messages"), 0},
-  {"status", 's', N_("STATUS"), 0, attr_help, 0},
+  {"status", 's', N_("STATUS"), 0,
+   /* TRANSLATORS: Please do *not* translate the words "new", "unread",
+      "old" and "read". They are keywords. */
+   N_("select messages with the specific attribute:"
+      " new, unread, old (same as unread) or read (or any unambiguous"
+      " abbreviation of these)"),
+   0},
   {"align",  't', NULL,   0, N_("tidy mode: align subject lines"), 0},
   {0, 0, 0, 0}
 };


hooks/post-receive
-- 
GNU Mailutils




reply via email to

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