On Mon, 08 Nov 2010 21:06:04 +0100, markus schnalke said: > [2010-11-05 22:34] markus schnalke <[email protected]> > > > > 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. 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.
pgp8kfZaINEWP.pgp
Description: PGP signature
_______________________________________________ Nmh-workers mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/nmh-workers
