Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RT-145462: cpan -g should use the same download mechanism as CPAN.pm #163

Open
briandfoy opened this issue Dec 7, 2022 · 2 comments
Open

Comments

@briandfoy
Copy link
Contributor

I'm transferring and splitting up some issues reported in App::Cpan many problems, multiple fixes.

The internal _download function uses LWP directly. I need to fix this to use CPAN.pm's mechanism.

Patch provided by "eponymous alias" [email protected] in the RT ticket
App.Cpan.patch.txt

@briandfoy briandfoy changed the title cpan -g should use the same download mechanism as CPAN.pm RT-145462: cpan -g should use the same download mechanism as CPAN.pm Dec 7, 2022
@briandfoy
Copy link
Contributor Author

I don't recall exactly why I made the decisions I did, but I recall having a lot of difficulty determining if the facilities that CPAN.pm provided let me know if the operation was successful and where the result ended up.

@briandfoy
Copy link
Contributor Author

There's another issue that I remember. Whatever downloads things needs to be able to handle https?, ftp, and file schemes. The last is important for MiniCPAN. LWP used to be able to do all of those. HTTP::Tiny, which CPAN::HTTP::Client uses, can't.

And, in general, the separation of concerns in CPAN.pm code is poor. There's not a way to simply grab a file without giving in to all sorts of other machinery. If I want to use the CPAN.pm code to download a file, I have to accept many other things that are a bit onerous to avoid.

File::Fetch might be a good option though. It has only been in core since v5.10, so that pushes out 5.008. It's an improvement though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant