CPAN에서 배포 tarball을 가져옵니다.

5168 단어 cpanperl
이것은 또 다른 "CPAN utils"게시물(일종의)이지만 이번에는 tarball을 해결하고 가져오는 것입니다 😃
  • cpan -g
  • sourcepan
  • cpan-get
  • MetaCPAN::Client + HTTP::Simple

  • cpan -g

    First let's start by using the venerable CPAN :

    $ cpan -g Parser::MGC 
    Checking Parser::MGC
    Reading '/home/tduponchelle/.local/share/.cpan/Metadata'
      Database was generated on Sat, 15 May 2021 16:41:03 GMT
    CPAN: LWP::UserAgent loaded ok (v6.53)
    Fetching with LWP:
    http://www.cpan.org/authors/01mailrc.txt.gz
    CPAN: YAML loaded ok (v1.30)
    Reading '/home/tduponchelle/.local/share/.cpan/sources/authors/01mailrc.txt.gz'
    CPAN: Compress::Zlib loaded ok (v2.102)
    ............................................................................DONE
    Fetching with LWP:
    http://www.cpan.org/modules/02packages.details.txt.gz
    Reading '/home/tduponchelle/.local/share/.cpan/sources/modules/02packages.details.txt.gz'
      Database was generated on Tue, 18 May 2021 12:29:03 GMT
    ............................................................................DONE
    Debug(CPAN,CPAN.pm,703,[Index,Index.pm,483,all_objects]): mgr[CPAN=HASH(0x563dc712a9e8)] class[CPAN::Module]
    Debug(CPAN,CPAN.pm,703,[Index,Index.pm,483,all_objects]): mgr[CPAN=HASH(0x563dc712a9e8)] class[CPAN::Bundle]
    Debug(CPAN,CPAN.pm,703,[Index,Index.pm,483,all_objects]): mgr[CPAN=HASH(0x563dc712a9e8)] class[CPAN::Distribution]
    Fetching with LWP:
    http://www.cpan.org/modules/03modlist.data.gz
    Reading '/home/tduponchelle/.local/share/.cpan/sources/modules/03modlist.data.gz'
    DONE
    Writing /home/tduponchelle/.local/share/.cpan/Metadata
    Use of uninitialized value in concatenation (.) or string at /usr/share/perl/5.26/App/Cpan.pm line 1186.
    Downloaded [Parser::MGC] to []
    


    소스팬

    Then look at the more developer oriented sourcepan :

    $ sourcepan Acme::LSD
    Reading '/home/tduponchelle/.local/share/.cpan/Metadata'
      Database was generated on Tue, 18 May 2021 12:29:03 GMT
    CONTRA/Acme-LSD-0.04.tar.gz => Acme-LSD-0.04.tar.gz
    

    sourcepan --git 당신을 위해 저장소를 초기화 할 수도 있습니다 ...

    cpan-get

    Continue with the newborn cpan-get :

    $ cpan-get Test::More
    'http://cpan.metacpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302183.tar.gz' was downloaded.
    


    MetaCPAN::클라이언트 + HTTP::단순

    And finish by a mixed MetaCPAN API client + HTTP client (오류 처리가 전혀 없음 💀):

    # Init MetaCPAN client
    use MetaCPAN::Client;
    my $mcpan = MetaCPAN::Client->new();
    
    # Resolve url
    my $download_url = $mcpan->download_url('ExtUtils::MakeMaker');
    
    # Download
    use HTTP::Simple;
    getstore($download_url->{data}->{download_url}, "EUMM.tgz");
    


    (MetaCPAN::Client로 가져오기가 가능해야 합니다. 방법을 아시는 분은 댓글 부탁드립니다.)

    좋은 웹페이지 즐겨찾기