in reply to Mirroring CPAN by inclusion declaration rather than by exclusion

> Minicpan provides for exclusion of modules matching a regex

Please show us the syntax, it's possible to write a regex matching everything except ExtUtils::

(Hint: negative look-ahead)

Edit

If you were referring to path_filters , please read the doc again, regex is only one of the possibilities, you can also provide a sub as filter. Should be straightforward...

Furthermore does this SO discussion:

List Pinto as alternative for cpanmini

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Mirroring CPAN by inclusion declaration rather than by exclusion
by Intrepid (Curate) on Nov 12, 2024 at 00:31 UTC

    Rolf wrote:

    If you were referring to path_filters , please read the doc again, regex is only one of the possibilities, you can also provide a sub as filter. Should be straightforward...

    You got me, I indeed only skimmed the docs and then forgot about the option to use a sub. That's embarrassing but helpful.

    Edit

    My code is now doing what I want and in case someone is interested, here it is: (my code was NOT doing what I wanted; it was repeating packages for reasons I do not yet grasp. This code now fixes that.)

    EDIT

    second EDIT

    - messed up posting code by preprocessing it with Text::Textile. Obviously, this was unnecessary with Perlmonk's special processing of code blocks.

    #!/usr/bin/env perl # Last modified: Thu Nov 14 2024 06:16:33 PM -05:00 [EST] use strict; use v5.18; use utf8; use warnings; use CPAN::Mini; my %seen; CPAN::Mini->update_mirror( remote => "http://www.cpan.org", local => "/cygdrive/c/Users/somia/AppData/Roaming/minicpan", skip_perl => 1, log_level => 'info', dirmode => 0761, path_filters =>[ sub { exists $seen{$_[0]} and return 1; $seen{$_[0]} = 1; $_[0] =~ qr%/(ExtUtils-.+)% and do { print STDERR '-'x 76 , qq[\ +n], $1 , qq[\n]; return 0; } or return 1; } ], );
    Nov 30, 2024 at 19:51 UTC

    The open palm of desire
    Wants everything, it wants everything
    It wants soil as soft as summer
    And the strength to push like spring
    Paul Simon -> Further to Fly