nmh-commits
[Top][All Lists]
Advanced

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

[Nmh-commits] CVS: nmh/man install-mh.man,1.5,1.6 nmh.man,1.5,1.6


From: Jon Steinhart <address@hidden>
Subject: [Nmh-commits] CVS: nmh/man install-mh.man,1.5,1.6 nmh.man,1.5,1.6
Date: Mon, 18 Nov 2002 13:25:10 -0500

Update of /cvsroot/nmh/nmh/man
In directory subversions:/tmp/cvs-serv2504/man

Modified Files:
        install-mh.man nmh.man 
Log Message:


The file README-ATTACHMENTS was removed - it has been moved to the docs
subdirectory.  I thought that this had already been done but I guess not.
It's unrelated to the rest of these changes.

The remainder of these changes affect the way that nmh is installed.  Nmh
has historically prompted the user for installation when any nmh command
is invoked if it doesn't think that it's installed.  This is a problem for
programs that want to, for example, interact with nmh programs via pipes.

These changes alter this behavior.  Now, when an nmh program thinks that
nmh isn't installed, it tells the user to run install-mh to install it.
A -check option has been added to install-mh that allows the existence of
an installation to be silently checked and indicated via the exit status.

The bulk of this change is in sbr/read_context.c.  In the process of making
these changes, I noticed a fair amount of useless code that I removed.  In
particular:

1.      The program started with a test for whether or not defpath had already
        been set.  This could only happen if context_read() was called more
        than once, which it isn't.  This check also existed and was removed
        from the following places:
                sbr/context_del.c
                sbr/context_find.c
                sbr/context_replace.c
                sbr/seq_read.c
                sbr/seq_save.c
                uip/flist.c
                uip/folder.c
                uip/rmf.c

2.      A similar test for mypath was removed.  No need to test it since it
        doesn't happen.  I'm just not a believer that

                a = 1;

                if (a != 1)
                        error();
        
        is a good way to write code!

3.      I removed the code makes a copy of the $HOME environment variable as
        returned by getenv().  It's never changed, so it doesn't need copying.

4.      I removed code that copied the pw_dir member of the passwd structure
        returned by getpwuid() if $HOME isn't set.  Yes, the returned structure
        is static, but since the function is never called again the returned
        values stay valid and don't need copying.

5.      I removed the test for a NULL pw_dir member in the passwd structure
        returned by getpwuid() since that never happens.

6.      I removed code that removed a trailing / from mypath if mypath is more
        than one character long.  Unnecessary as // is interpreted as / anyway.
        mypath never shows up in an error message, so nobody will ever see it.
        Besides, this code didn't handle the case of multiple trailing slashes.

7.      I removed code that replaced the MH environment variable contents with
        an absolute path if it was a relative one.  I'm a bit nervous about this
        one, only testing will tell.  Any nmh program that's invoked will use
        the same context_read() code to convert a relative path to an absolute
        one anyway.  And there's no guarantee (or discussion) of this feature
        in any of the documentation.

8.      Althout context_read() tested the MH environment variable, install-mh
        didn't.  This means that the behavior was not consistent between
        install-mh and all other nmh programs.  I changed install-mh to be
        consistent with context_read().

9.      install-mh has been installed in the lib directory, not bin.  So a
        user would be unlikely to find it when prompted to run it.  The
        installation has been changed to add a link from bin to lib.


Index: install-mh.man
===================================================================
RCS file: /cvsroot/nmh/nmh/man/install-mh.man,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** install-mh.man      25 Jan 2001 21:15:54 -0000      1.5
--- install-mh.man      18 Nov 2002 18:25:01 -0000      1.6
***************
*** 11,14 ****
--- 11,21 ----
  .B %libdir%/install\-mh
  .RB [ \-auto ]
+ .RB [ \-check ]
+ .RB [ \-version ]
+ .RB [ \-help ]
+ .HP 5
+ .B install\-mh
+ .RB [ \-auto ]
+ .RB [ \-check ]
  .RB [ \-version ]
  .RB [ \-help ]
***************
*** 21,35 ****
  for a first\-time
  .B nmh
! user.  It is typically invoked by other
! .B nmh
! commands, and should NOT be directly invoked by the user.
  .PP
! When a user runs any
! .B nmh
! program for the first time, the program will invoke
! .B install\-mh
! (with the `\-auto' switch) to query the user for the initial
! .B nmh
! environment.  The user is asked
  for the name of the directory that will be designated as the user's
  .B nmh
--- 28,39 ----
  for a first\-time
  .B nmh
! user.
! .B Install\-mh
! lives in two places for historical reasons.
  .PP
! The \fB\-auto\fP option does things as automatically as possible and
! makes \fBinstall\-mh\fP less chatty.
! .PP
! The user is asked
  for the name of the directory that will be designated as the user's
  .B nmh
***************
*** 37,48 ****
  asked if it should be created.  Normally, this directory should be
  under the user's home directory, and has the default name of
! .RI \*(lq Mail/ \*(rq.
! After
! .B install\-mh
! has written the initial
  .I \&.mh\(ruprofile
! for the user, control returns to the original
! .B nmh
! program.
  .PP
  As with all
--- 41,49 ----
  asked if it should be created.  Normally, this directory should be
  under the user's home directory, and has the default name of
! \fI``Mail''\fP.
! .B Install\-mh
! writes an initial
  .I \&.mh\(ruprofile
! for the user.
  .PP
  As with all
***************
*** 50,56 ****
  commands,
  .B install\-mh
! first consults the
  .B $HOME
! environment variable to determine the user's home directory.
  If
  .B $HOME
--- 51,59 ----
  commands,
  .B install\-mh
! first checks for the existence of the \fB$MH\fP environment variable
! since that gives the profile path if set.
! If it isn't set, the
  .B $HOME
! environment variable is consulted to determine the user's home directory.
  If
  .B $HOME
***************
*** 66,69 ****
--- 69,77 ----
  If found, this will be used to initialize the new
  .IR \&.mh\(ruprofile .
+ .PP
+ The \fB\-check\fP option can be used to check whether or not nmh has
+ been installed.
+ This can be used by other programs to determine whether or not nmh has
+ been installed without their having to know the internals of nmh.
  
  .SH FILES

Index: nmh.man
===================================================================
RCS file: /cvsroot/nmh/nmh/man/nmh.man,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** nmh.man     25 Jan 2001 21:15:57 -0000      1.5
--- nmh.man     18 Nov 2002 18:25:01 -0000      1.6
***************
*** 45,48 ****
--- 45,49 ----
  .IR \&.profile ,
  .IR \&.login ,
+ .IR \&.bashrc ,
  or
  .I \&.cshrc
***************
*** 50,54 ****
  manual entry for the shell you use, in case you don't know how to
  do this.)  Run the
! .B inc
  command.  If you've never used
  .B nmh
--- 51,55 ----
  manual entry for the shell you use, in case you don't know how to
  do this.)  Run the
! .B install-mh
  command.  If you've never used
  .B nmh





reply via email to

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