Add --download command #118

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
7 participants

--download command is used for downloading tarballs only, without
building/installing. Internally, it sets --save-dists=$CWD if --save-dists is
not specified.

Add --download command
--download command is used for downloading tarballs only, without
building/installing. Internally, it sets --save-dists=$CWD if --save-dists is
not specified.
Contributor

vti commented Sep 30, 2011

If we can vote here, I vote +1.

Owner

miyagawa commented Apr 4, 2012

@masaki if we merge this patch I guess Carton's bundle command doesn't need to install deps?

Contributor

masaki commented Apr 4, 2012

@miyagawa this logic returns before build_stuff() which contains "scandeps", so I guess cpanm cannot fetch dependency modules and Carton cannot bundle completely.

Owner

miyagawa commented Apr 4, 2012

right, so we need to download while scanning deps, which I think needs to install into a temporary path anyway.

yanick commented Feb 5, 2013

Just want to add my voice to the +1 crowd. This option would be quite useful for quick module retrieval...

Contributor

zebardy commented May 23, 2014

👍 +1 from me as well :). This would allow for miyagawa/carton#168 to be implemented. What is the status of this? Any changes/discussions needed to help push this issue forward?

I'd love to see this, too

perlancar and others added some commits Sep 30, 2016

Only use URI from mirror where we found the module and not from all m…
…irrors.

When multiple --mirrors are used, cpan_dist() will construct URIs from all
mirrors, regardless or whether this mirror contains the module or not. This can
cause a lot of noise warnings of failing to fetch files from the mirrors,
particularly when darkpan(s) are involved. For example:

    % cpanm --mirror http://darkpan1/ --mirror http://darkpan2/ \
        --mirror http://darkpan3/ --mirror http://cpan/ --mirror-only \
        A-CPAN-Module-1.23.tar.gz
    ! Finding A::CPAN::Module () on mirror http://darkpan1/ failed.
    ! Finding A::CPAN::Module () on mirror http://darkpan2/ failed.
    ! Finding A::CPAN::Module () on mirror http://darkpan3/ failed.
    --> Working on A::CPAN::Module
    Fetching http://darkpan1/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz ... FAIL
    ! Download http://darkpan1/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    ! Download http://darkpan1/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    ! Download http://darkpan1/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    Fetching http://darkpan2/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz ... FAIL
    ! Download http://darkpan2/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    ! Download http://darkpan2/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    ! Download http://darkpan2/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    Fetching http://darkpan3/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz ... FAIL
    ! Download http://darkpan3/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    ! Download http://darkpan3/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    ! Download http://darkpan3/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz failed. Retrying ...
    Fetching http://cpan/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz ... OK
    ...

With this small commit, the distribution A-CPAN-Module will only get the
http://cpan/ URL as that is where the associated module is found. So, the noise
is much reduced:

    % cpanm --mirror http://darkpan1/ --mirror http://darkpan2/ \
        --mirror http://darkpan3/ --mirror http://cpan/ --mirror-only \
        A-CPAN-Module-1.23.tar.gz
    ! Finding A::CPAN::Module () on mirror http://darkpan1/ failed.
    ! Finding A::CPAN::Module () on mirror http://darkpan2/ failed.
    ! Finding A::CPAN::Module () on mirror http://darkpan3/ failed.
    --> Working on A::CPAN::Module
    Fetching http://cpan/authors/id/P/PA/PAUSEID/A-CPAN-Module-1.23.tar.gz ... OK
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment