in reply to Re: Mirroring CPAN by inclusion declaration rather than by exclusion
in thread Mirroring CPAN by inclusion declaration rather than by exclusion

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

  • Comment on Re^2: Mirroring CPAN by inclusion declaration rather than by exclusion
  • Download Code