MyCPAN ( LA.pm, September 2007 )

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Groups

    MyCPAN ( LA.pm, September 2007 ) - Presentation Transcript

    1. Making My Own CPAN brian d foy Stonehenge Consulting Services September 20, 2007
    2. CPAN • http://www.cpan.org • Comprehensive Perl Archive Network • Best, most powerful feature of Perl • \"Grokking CPAN\" by Elaine Ashton http://backpan.perl.org/authors/id/H/ HF/HFB/grok-cpan-1.01.pdf
    3. Goals • Make my own version of CPAN (MyCPAN) • Freeze MyCPAN • Make a CPAN for something else
    4. History of CPAN • Proposed in 1993 as a store for everything • Created in 1995 • PAUSE created to upload modules • Mirrors added (ongoing)
    5. How CPAN works • Mirrors content (MIRRORED.FROM) • Master server in Finland • Primary ring of mirrors • Secondary ring of mirrors • Tools work with basic structure
    6. PAUSE • http://pause.perl.org • Perl Authors Upload SErver (PAUSE) • Gateway for adding modules to CPAN • CPAN Master mirror PAUSE • modules/ • authors/
    7. PAUSE modules • PAUSE puts modules into authors/ • Breaks down by PAUSE ID • authors/B/BD/BDFOY/Foo-1.23.tar.gz • Path doesn’t really matter
    8. PAUSE index files • PAUSE indexes modules • Creates index files for CPAN tool chain • modules/02packages.details.txt.gz • modules/03modlist.data.gz • modules/06perms.txt.gz
    9. 02packages.details.txt Date::Span 1.123 R/RJ/RJBS/Date-Span-1.123.tar.gz Date::Tie 0.17 F/FG/FGLOCK/Date-Tie-0.17.tar.gz Date::Tiny 0.02 A/AD/ADAMK/Date-Tiny-0.02.tar.gz
    10. 03modlist.data.gz [ 'Fcntl', 'S', 'd', 'c', 'f', '?', 'Defines fcntl() constants (see File::Lock)', 'JHI', '4' ],
    11. 06perms.txt WWW::MySpaceBot,KIRSLE,m WWW::Myspace,GRANTG,m WWW::Myspace,OALDERS,c WWW::Myspace::Comment,GRANTG,f WWW::Myspace::Data,GRANTG,f WWW::Myspace::Data,OALDERS,c WWW::Myspace::FriendAdder,GRANTG,f
    12. Tool chain • \"Third Party\" projects • CPAN Search • CPAN.pm • CPANPLUS • AnnoCPAN
    13. CPAN.pm • Uses index files to find distro • Looks for path on mirror • http://mirror/... • .../authors/ • .../B/BD/BDFOY/Foo-1.23.tar.gz
    14. Installing a module • Get from first mirror that has it • Unpack, run Makefile.PL or Build.PL • Discover dependencies • Find, get, install dependencies
    15. MiniCPAN • A local CPAN mirror • Only has latest versions, indices • Point CPAN.pm at local mirror • Update from network • Install without network
    16. CPAN::Mini • The module behind minicpan • by Ricardo SIGNES • Configurable • Programmable
    17. Configure MiniCPAN • Edit ~/.minicpanrc local: /MINICPAN remote: http://path/to_mirror skip_perl: 1
    18. Updating MiniCPAN $ minicpan authors/01mailrc.txt.gz ... updated modules/02packages.details.txt.gz ... updated modules/03modlist.data.gz ... updated authors/id/J/JW/JWACH/Apache- FastForward-1.1.tar.gz ... updated
    19. CPAN::Mini filters • Don’t mirror files you don’t need • Skip files you want to override
    20. MicroCPAN CPAN::Mini->update_mirror( ..., path_filters => [ sub { !( $_[0] =~ /BDFOY/ ) } ], module_filters => [ qr/Test/, ], );
    21. Configuring CPAN.pm • Edit CPAN/MyConfig.pm directly • probably not in library path • location set on first use • Start CPAN.pm shell
    22. Add MiniCPAN $ cpan cpan shell -- CPAN exploration and modules installation (v1.9102) cpan[2]> o conf urllist unshift file:///MINICPAN cpan[3]> o conf commit commit: wrote '/Users/brian/Library/Application Support/.cpan/CPAN/MyConfig.pm'
    23. MyCPAN • Only the modules I want • Only the versions I want • Extra, private modules • Public modules with local patches • Internal server or removable media
    24. Private modules • Local modules for internal use • Want to install with same tools • Want to replicate • Want to distribute internally
    25. CPAN::Mini::Inject • Creates a parallel archive • Update MiniCPAN first • Inject parallel archive into MiniCPAN • Update PAUSE index files locally
    26. Command line $ mcpani --add --module Foo::Bar \\ --authorid BDFOY --modversion 0.01 \\ --file ./Foo-Bar-0.01.tar.gz
    27. ~/.mcpani/config local: /MyCPAN remote: ftp:///MINICPAN repository: /AddThesePrivateModules passive: yes dirmode: 0755
    28. Replacing public distros • Sometimes I want local patches • absent author • truculent author • Don’t want the latest distro
    29. Three steps • Inject distros into parallel dir • Update MiniCPAN • Inject distros into MiniCPAN
    30. BackPAN • http://backpan.cpan.org • All modules ever uploaded to PAUSE • Not integrated with CPAN tool chain • Which distro has module version?
    31. Finding old distros • It's all on BackPAN • Brute force, right now • Unpack a distro and check • Repeat until you find it
    32. MyCPAN on a CD • I have all the bits to carry around MyCPAN • MiniCPAN • Private modules • Configure CPAN.pm • Need to discover MyCPAN location
    33. Dynamic config use CPAN; CPAN::Config->load( be_silent => 1, write_report => 0, ); CPAN::Shell->o( qw( conf urllist unshift ), $where_i_found_cpan, );
    34. Future work • Index all of BackPAN • Make that searchable • Easier injecting • Integrate with CPAN tools • Perhaps another CPAN Search

    + _brian d _foy_brian d _foy, 2 years ago

    custom

    2580 views, 0 favs, 0 embeds more stats

    How CPAN works, how to create a minicpan and microc more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 2580
      • 2580 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories