Dan Sully schrieb:
I'm trying to exclude modules based on a wildcard such as:

pp -X URI::* ...

But that's not working.. Is there an equivalent that I've overlooked?

Me again. :)

In case you just want to exclude all core modules and those in the slimserver distribution, you can use the attached script to generate a list of modules to exclude and write that to a file with prepended -X's:

$ ./generate_excludelist.pl my_slimserver_dir > excludelist

Writes to ./excludelist:
-X Algorithm::C3
-X AnyDBM_File
-X Attribute::Handlers
...
-X warnings
-X warnings::register
-X xPL

Now, you can ship such a list with slimserver and use pp to package new plugins:

pp @exludelist -M Plugins::Foo -o Plugins-Foo.par -e 1

Note that the script takes the list of modules that are contained in the base distribution of the currently running perl. Naturally, you should use the *minimum* version of perl which you support slimserver on.

Cheers,
Steffen

#!/usr/bin/perl
use strict;
use warnings;

use Module::CoreList;
use File::Spec;
use File::Find ();

my $usage = <<HERE;
Usage: $0 Slimserver-Directory
HERE

my $slimdir = shift;
die $usage if not -d $slimdir;

my @coremod = keys %{$Module::CoreList::version{$]}};

my @slimdirs = qw(
    Slim
    Plugins
    lib
    CPAN
);

my @slimmod;
foreach my $incdir (map {File::Spec->catdir($slimdir, $_)} @slimdirs) {
    File::Find::find({
        wanted => sub {
            my $file = $File::Find::name;
            return unless -f $file and $file =~ /\.pm/i;
            $file =~ s/^\Q$incdir\E(?:\\|\/)?//;
            $file =~ s/(?:\\|\/)/::/g;
            $file =~ s/\.[^.]+$//;
            push @slimmod, $file;
        },
        no_chdir => 1,
        }, $incdir
    );
}

my %mod = (map {$_ => undef} @slimmod, @coremod);

print map {"-X $_\n"} sort keys %mod;

Reply via email to