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: Fri, 05 Nov 2010 22:34:22 +0100
User-agent: nmh 1.3

[2010-11-05 20:46] Peter Maydell <address@hidden>
> markus schnalke wrote:
> >the attached patch tries to fix Debian bug #551704 [0].
> >
> >[0] http://bugs.debian.org/551704
> >
> >Knowing that a uninstall-mh command is surely impossible to create, I
> >extended the man page instead. I also fixed the CONTEXT section there.
> 
> Well, you could undo the effects:
>  * if there's no profile file, we're not installed anyway
>  * if there is, then it will tell us where the Mail
>    directory is

That's the point I missed.

>  * so rm -rf Mail (with a big fat warning!)
>  * and delete the profile file
> 
> In fact (modulo the warning and checking we were installed in
> the first place!) it's a shell one-liner:
>    rm -rf "${MH:-~/.mh-profile}" "$(mhpath +)"

(The tilde does not get expanded this way.)

This assumes that $MH and $MHCONTEXT are still the same. Seems as if
we always need to assume this.

But yes, you are right that it's not as impossible as I thought. Also
I didn't realize that it is very clever to use nmh's own tools as
helpers.  *shame*


> I'm not totally sure we want to provide an easy way for
> the user to blow away their mail, though :-)

We should at least not remove any mail.


> However, if you're going to document in the manpage
> how to clean things up you should document the
> correct way that doesn't rely on assumptions about
> the directory name and so on. 

Right.

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

Or do you think we should only provide prose text?


meillo



reply via email to

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