CPAN-Mini
CPAN-Mini copied to clipboard
Wishlist: allow more control over mirror process
Hi!
I wrote a GUI front-end for CPAN::Mini (see https://github.com/asb-capfan/MiniCPAN ).
At the moment, I call update_mirror to create a local CPAN mirror.
However, I would like to do some additional stuff for each module, like checking checksum or verifying that there is always enough disk space (yes, I really want to have an option to check it every single time before a module gets downloaded).
But, there is "only" the methods update_mirror, which performs the mirror at once or mirror_file which requires me to calculate the list of modules myself. I could of course simply use the _get_mirror_list method but it's a private method. Plus: fiddling with _get_mirror_list might disallow the use of extensions that change the behavior.
So, as I don't want to use private methods and as I don't want to duplicate code, I would like to ask if it would be possible to add a hook before an after a module has been downloaded. Maybe at the start and at the end of mirror_file or within the loop at line 185 ( https://metacpan.org/source/RJBS/CPAN-Mini-1.111016/lib/CPAN/Mini.pm ).
Best regards, Alex