nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] [patch] undo of install-mh (Debian bug #551704)


From: markus schnalke
Subject: Re: [Nmh-workers] [patch] undo of install-mh (Debian bug #551704)
Date: Mon, 08 Nov 2010 22:11:19 +0100
User-agent: nmh 1.3

[2010-11-08 15:28] address@hidden
> On Mon, 08 Nov 2010 21:06:04 +0100, markus schnalke said:
> > [2010-11-05 22:34] markus schnalke <address@hidden>
> > >
> > > A second try for removing only what install-mh(1) installs:
> > > 
> > >     ctx="${MHCONTEXT:-`mhparam context`}"
> > >     case "$ctx" in
> > >     '/*') rm "$ctx" ;;
> > >     *)    rm "`mhpath +`/$ctx" ;;
> > >     esac
> > >     rmdir "`mhpath +`"
> > >     rm "$MH" || rm ~/.mh_profile
> > 
> > I discovered another mistake in this code. Install-mh(1) always stores
> > the context as ``context'' within the mail directory. This simplifies
> > the work:
> > 
> > rm "`mhpath +`/context"
> 
> That, my friends, is only safe if there's one context file.
> 
> Consider this:
> 
> export MHCONTEXT=~/Mail/.mhcontext-`tty|sed -e "s,.dev.,," -e "s,/,.,"`
> 
> to support a separate context for each xterm you have open....
> 
> Also, remember there can be a 'context' entry in .mh_profile,
> which would mean that 'mhparam context' would find it but your
> rm command would fail to find it.

I had a look at uip/install-mh.c and tested. Install-mh(1) does not
evaluate $MHCONTEXT. Also it contains this code:

    ctxpath = getcpy (m_maildir (context = "context"));

    /* Initialize current folder to default */
    context_replace (pfolder, defaultfolder);
    context_save ();

As far as I see, and my tests support that, always a context file
named ``context'' within the mail directory is created.

A system-wide profile template (/etc/mh.profile) might add a context
entry to the new created profile, but this does not change the
behavior. This can be seen as a bug.


> Bottom line - you *really* need to front-end an 'uninstall-mh' with some
> checks to verify that you're trying to clean up a virgin never-used MH
> environment.  If the user has been monkeying with its innards, it's
> really hard to do correctly.

Of course, the use case are only fresh installations, meaning, if you
had run install-mh(1) by accident.

I don't want to have this script, but I want to document it correctly
in the man page. The reason why I sent this additional mail was to
correct the script that appeared to be wrong.


meillo



reply via email to

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