[mh] CPAN modules in MH
Brian M <[email protected]>
| Newsgroups | gmane.comp.misc.misterhouse.user |
|---|---|
| Message-ID | <[email protected]> |
I have a change I'd like to submit to the MH development team, but it
might have implications I'm not aware of or be controversial. I thought
I'd start a discussion here first, so I could get the input of the
development team and others before simply submitting a pull request.
MisterHouse comes with some CPAN modules prepackaged into it. The
reasons for this have been discussed before, and I don't really want to
reopen that topic here. We can open a separate thread for that if we
want to reconsider that decision. Sufficient for now to say that there
are CPAN modules embedded in the code tree, and that in some cases
they're quite behind the current versions available via CPAN or what the
O/S distros offer.
The problem is that as MisterHouse is currently structured, the system
administrator or system owner is unable to cleanly updating the CPAN
modules with newer versions, assuming the individual even knows they're
there. The modules live in the lib/site directory tree, and on start-up
MisterHouse inserts that and other directories at the front of @INC, so
that any system-supplied versions are ignored. MisterHouse is saying in
effect if not intent: "I know better than you do what versions you
should run." The individual can certainly go into the folder and replace
the modules by hand, but at this point they're modifying the distributed
code, creating a permanent maintenance hassle for themselves whenever
they update MisterHouse.
In my case, I spent many hours trying to figure out why my code to talk
to my new thermostat would work outside of MisterHouse, but not inside
it. I eventually discovered that MH has a copy of LWP::UserAgent that
is too old to support SSL connections.
My proposed solution is pretty simple:
1. We create a new directory under lib, as a peer to lib/site. I'm open
to suggestions for the names, but for now I'll call it lib/fallback.
2. We move the MH-supplied versions of the CPAN modules into lib/fallback.
3. We add one line of code to the mh main program that adds
lib/fallback to the *end* of @INC.
The result would be that if the system owner/administrator provided a
version of a module elsewhere in the normal PERL search path, MH would
use it. If no such module exists, MH will use the version in fallback.
That way, MH would be assured to find a copy of the module, and if the
local administrator wanted a newer version they could install one
without changing MisterHouse's distributed code.
I've tried it on my own installation and it seems to be working well.
I'd be willing to code up the change and submit it, if the community
doesn't have any objections.
I look forward to people's thoughts about this.
-Brian M
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users