mrw wrote: 
> I don't see much alternative to the element of duplication in the tree,
> because in reality you are providing several alternative trees. You
> should be able to de-duplicate the pure perl and Autoloader bits by
> placing immediately under the perl version directory. That said, I don't
> really remember what LMS puts into @INC.
> That resolved, perhaps a simple approach might be something like the
> following in 'initPlugin', in place of 'use Crypt::OpenSSL::RSA' and
> seeding '$rsa' in the main body.
> Good luck !

Thanks - At the risk of shocking others :), I think I'll do the
following in initPlugin (and reverting it in shutdownPlugin)

  eval {require Crypt::OpenSSL::RSA};
  if ($@) {
                my $lib = 
                move(catdir($lib, "_Crypt"), catdir($lib, "Crypt"));
                $log->warn("cannot find system OpenSSL::RSA, trying local 
                require Crypt::OpenSSL::RSA;
                Crypt::OpenSSL::RSA->new_private_key( $airport_pem )
                || do { $log->error( "RSA private key import failed" ); return; 

Probably not pretty, but it avoid the duplication in all versions and
all archs because I'm afraid that duplication under Perl version only
will not suffice: if for a version I have provided build for at least
one arch, but not the one the current ont and the system
Crypt::OpenSSL::RSA is installed, then it will still try to use my .pm
version instead of the system one and will fail. 

I think that this hack guarantees that mine will only be used if system

LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos
PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000,
ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi
B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010,
AppleTV 4, Airport Express, GGMM E5
philippe_44's Profile:
View this thread:

plugins mailing list

Reply via email to