SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Making My Own
    CPAN
         brian d foy
Stonehenge Consulting Services
     September 20, 2007
CPAN
• http://www.cpan.org
• Comprehensive Perl Archive Network
• Best, most powerful feature of Perl
• quot;Grokking CPANquot; by Elaine Ashton
 http://backpan.perl.org/authors/id/H/
 HF/HFB/grok-cpan-1.01.pdf
Goals

• Make my own version of CPAN
 (MyCPAN)

• Freeze MyCPAN
• Make a CPAN for something else
History of CPAN
• Proposed in 1993 as a store for
 everything

• Created in 1995
• PAUSE created to upload
 modules

• Mirrors added (ongoing)
How CPAN works
• Mirrors content (MIRRORED.FROM)
• Master server in Finland
• Primary ring of mirrors
• Secondary ring of mirrors
• Tools work with basic structure
PAUSE
• http://pause.perl.org
• Perl Authors Upload SErver (PAUSE)
• Gateway for adding modules to CPAN
• CPAN Master mirror PAUSE
 • modules/
 • authors/
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
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
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
03modlist.data.gz
[
'Fcntl',
'S',
'd',
'c',
'f',
'?',
'Defines fcntl() constants (see File::Lock)',
'JHI',
'4'
],
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
Tool chain
• quot;Third Partyquot; projects
• CPAN Search
• CPAN.pm
• CPANPLUS
• AnnoCPAN
CPAN.pm
• Uses index files to find distro
• Looks for path on mirror
 • http://mirror/...
 • .../authors/
 • .../B/BD/BDFOY/Foo-1.23.tar.gz
Installing a module

 • Get from first mirror that has it
 • Unpack, run Makefile.PL or Build.PL
 • Discover dependencies
 • Find, get, install dependencies
MiniCPAN
• A local CPAN mirror
• Only has latest versions, indices
• Point CPAN.pm at local mirror
• Update from network
• Install without network
CPAN::Mini

• The module behind minicpan
• by Ricardo SIGNES
• Configurable
• Programmable
Configure MiniCPAN

 • Edit ~/.minicpanrc
  local:     /MINICPAN

  remote:    http://path/to_mirror

  skip_perl: 1
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
CPAN::Mini filters


• Don’t mirror files you don’t need
• Skip files you want to override
MicroCPAN
  CPAN::Mini->update_mirror(

...,

path_filters     => [


sub { !( $_[0] =~ /BDFOY/ ) }


],

module_filters     => [


qr/Test/,


],

);
Configuring CPAN.pm

  • Edit CPAN/MyConfig.pm directly
   • probably not in library path
   • location set on first use
  • Start CPAN.pm shell
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'
MyCPAN

• Only the modules I want
• Only the versions I want
• Extra, private modules
• Public modules with local patches
• Internal server or removable media
Private modules

• Local modules for internal use
• Want to install with same tools
• Want to replicate
• Want to distribute internally
CPAN::Mini::Inject

• Creates a parallel archive
• Update MiniCPAN first
• Inject parallel archive into
  MiniCPAN

• Update PAUSE index files locally
Command line

$ mcpani --add --module Foo::Bar 

 --authorid BDFOY --modversion 0.01 

 --file ./Foo-Bar-0.01.tar.gz
~/.mcpani/config

   local: /MyCPAN
 remote: ftp:///MINICPAN
 repository: /AddThesePrivateModules
 passive: yes
 dirmode: 0755
Replacing public distros


• Sometimes I want local patches
 • absent author
 • truculent author
• Don’t want the latest distro
Three steps

• Inject distros into parallel dir
• Update MiniCPAN
• Inject distros into MiniCPAN
BackPAN

• http://backpan.cpan.org
• All modules ever uploaded to PAUSE
• Not integrated with CPAN tool chain
• Which distro has module version?
Finding old distros


• It's all on BackPAN
• Brute force, right now
• Unpack a distro and check
• Repeat until you find it
MyCPAN on a CD
• I have all the bits to carry around
  MyCPAN

 • MiniCPAN
 • Private modules
 • Configure CPAN.pm
• Need to discover MyCPAN location
Dynamic config
 use CPAN;

 CPAN::Config->load(

 
   be_silent     => 1,

 
   write_report => 0,

 
   );

 CPAN::Shell->o(

 
   qw( conf urllist unshift ),

 
   $where_i_found_cpan,

 
   );
Future work
• Index all of BackPAN
• Make that searchable
• Easier injecting
• Integrate with CPAN tools
• Perhaps another CPAN Search

Weitere ähnliche Inhalte

Was ist angesagt?

Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applications
railsconf
 
Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014
th0masr
 
Productivity 101: Making a Easily Re-deployable Dev Environment with Subversion
Productivity 101: Making a Easily Re-deployable Dev Environment with SubversionProductivity 101: Making a Easily Re-deployable Dev Environment with Subversion
Productivity 101: Making a Easily Re-deployable Dev Environment with Subversion
ryanduff
 

Was ist angesagt? (19)

meet.php #11 - Huston, we have an airbrake
meet.php #11 - Huston, we have an airbrakemeet.php #11 - Huston, we have an airbrake
meet.php #11 - Huston, we have an airbrake
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applications
 
Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
 
perlcc made easy or, how to make a CGI Moose app
perlcc made easy or, how to make a CGI Moose appperlcc made easy or, how to make a CGI Moose app
perlcc made easy or, how to make a CGI Moose app
 
Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014Sonata Block Bundle - sfPot March 2014
Sonata Block Bundle - sfPot March 2014
 
Deploying Drupal using Capistrano
Deploying Drupal using CapistranoDeploying Drupal using Capistrano
Deploying Drupal using Capistrano
 
An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Vagrant up-and-running
Vagrant up-and-runningVagrant up-and-running
Vagrant up-and-running
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Perl
PerlPerl
Perl
 
Rembug Presentation
Rembug PresentationRembug Presentation
Rembug Presentation
 
OSDC 2008 talk: An open source "YouTube"
OSDC 2008 talk:  An open source "YouTube"OSDC 2008 talk:  An open source "YouTube"
OSDC 2008 talk: An open source "YouTube"
 
Setting advanced PHP development environment
Setting advanced PHP development environmentSetting advanced PHP development environment
Setting advanced PHP development environment
 
Why I Love CPAN
Why I Love CPANWhy I Love CPAN
Why I Love CPAN
 
Productivity 101: Making a Easily Re-deployable Dev Environment with Subversion
Productivity 101: Making a Easily Re-deployable Dev Environment with SubversionProductivity 101: Making a Easily Re-deployable Dev Environment with Subversion
Productivity 101: Making a Easily Re-deployable Dev Environment with Subversion
 
Magento 2 Capistrano Deploy
Magento 2 Capistrano DeployMagento 2 Capistrano Deploy
Magento 2 Capistrano Deploy
 
Dev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with VagrantDev/Stage/Prod Parity with Vagrant
Dev/Stage/Prod Parity with Vagrant
 
“Bootify your app - from zero to hero
“Bootify  your app - from zero to hero“Bootify  your app - from zero to hero
“Bootify your app - from zero to hero
 

Andere mochten auch (7)

Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011
 
6 more things about Perl 6
6 more things about Perl 66 more things about Perl 6
6 more things about Perl 6
 
The Surprisingly Tense History of the Schwartzian Transform
The Surprisingly Tense History of the Schwartzian TransformThe Surprisingly Tense History of the Schwartzian Transform
The Surprisingly Tense History of the Schwartzian Transform
 
Perl Power Tools - Saint Perl 6
Perl Power Tools - Saint Perl 6Perl Power Tools - Saint Perl 6
Perl Power Tools - Saint Perl 6
 
6 things about perl 6
6 things about perl 66 things about perl 6
6 things about perl 6
 
Perl 5.28 new features
Perl 5.28 new featuresPerl 5.28 new features
Perl 5.28 new features
 
No te rindas
No te rindasNo te rindas
No te rindas
 

Ähnlich wie MyCPAN ( LA.pm, September 2007 )

CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packager
techmemo
 
Modern Commandline Tool
Modern Commandline ToolModern Commandline Tool
Modern Commandline Tool
Yuji Shimada
 

Ähnlich wie MyCPAN ( LA.pm, September 2007 ) (20)

CPAN Training
CPAN TrainingCPAN Training
CPAN Training
 
CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packager
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
 
Perl: Setting Up An Internal Darkpan
Perl: Setting Up An Internal DarkpanPerl: Setting Up An Internal Darkpan
Perl: Setting Up An Internal Darkpan
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Modern Commandline Tool
Modern Commandline ToolModern Commandline Tool
Modern Commandline Tool
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package manager
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
 
CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packager
 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
 
Capistrano
CapistranoCapistrano
Capistrano
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Developing MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack RoutersDeveloping MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack Routers
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e Jenkins
 
Deep dive into Verdaccio - NodeTLV 2022 - Israel
Deep dive into Verdaccio - NodeTLV 2022 - IsraelDeep dive into Verdaccio - NodeTLV 2022 - Israel
Deep dive into Verdaccio - NodeTLV 2022 - Israel
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 

Mehr von brian d foy

The Whitespace in the Perl Community
The Whitespace in the Perl CommunityThe Whitespace in the Perl Community
The Whitespace in the Perl Community
brian d foy
 
Advanced modulinos
Advanced modulinosAdvanced modulinos
Advanced modulinos
brian d foy
 

Mehr von brian d foy (20)

Conferences for Beginners presentation
Conferences for Beginners presentationConferences for Beginners presentation
Conferences for Beginners presentation
 
20 years in Perl
20 years in Perl20 years in Perl
20 years in Perl
 
PrettyDump Perl 6 (London.pm)
PrettyDump Perl 6 (London.pm)PrettyDump Perl 6 (London.pm)
PrettyDump Perl 6 (London.pm)
 
Dumping Perl 6 (French Perl Workshop)
Dumping Perl 6 (French Perl Workshop)Dumping Perl 6 (French Perl Workshop)
Dumping Perl 6 (French Perl Workshop)
 
Perl v5.26 Features (AmsterdamX.pm)
Perl v5.26 Features (AmsterdamX.pm)Perl v5.26 Features (AmsterdamX.pm)
Perl v5.26 Features (AmsterdamX.pm)
 
Dumping Perl 6 (AmsterdamX.pm)
Dumping Perl 6 (AmsterdamX.pm)Dumping Perl 6 (AmsterdamX.pm)
Dumping Perl 6 (AmsterdamX.pm)
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
 
The Whitespace in the Perl Community
The Whitespace in the Perl CommunityThe Whitespace in the Perl Community
The Whitespace in the Perl Community
 
CPAN Workshop, Chicago 2014
CPAN Workshop, Chicago 2014CPAN Workshop, Chicago 2014
CPAN Workshop, Chicago 2014
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
Advanced modulinos
Advanced modulinosAdvanced modulinos
Advanced modulinos
 
Advanced modulinos trial
Advanced modulinos trialAdvanced modulinos trial
Advanced modulinos trial
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
I ❤ CPAN
I ❤ CPANI ❤ CPAN
I ❤ CPAN
 
Tour of the Perl docs
Tour of the Perl docsTour of the Perl docs
Tour of the Perl docs
 
Create and upload your first Perl module to CPAN
Create and upload your first Perl module to CPANCreate and upload your first Perl module to CPAN
Create and upload your first Perl module to CPAN
 
Perl Conferences for Beginners
Perl Conferences for BeginnersPerl Conferences for Beginners
Perl Conferences for Beginners
 
Backward to DPAN
Backward to DPANBackward to DPAN
Backward to DPAN
 
Perl docs {sux|rulez}
Perl docs {sux|rulez}Perl docs {sux|rulez}
Perl docs {sux|rulez}
 
What's wrong with the perldocs
What's wrong with the perldocsWhat's wrong with the perldocs
What's wrong with the perldocs
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

MyCPAN ( LA.pm, September 2007 )