Reverse Installing CPAN

  • 1,871 views
Uploaded on

My presentation from the first Polish Perl Workshop, on taking an existing Perl installation and making a CPAN-like repository from it.

My presentation from the first Polish Perl Workshop, on taking an existing Perl installation and making a CPAN-like repository from it.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,871
On Slideshare
0
From Embeds
0
Number of Embeds
12

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Reverse InstallingCPANbrian d foybrian.d.foy@gmail.comMay 26, 2013 • 1st Polish Perl Workshop
  • 2. MyCPANisArcheology
  • 3. Perl installation↓CPAN-like repo
  • 4. 104 files
  • 5. One time runto startbettercode management
  • 6. 95%9,500 of 10,000 files
  • 7. Indexing
  • 8. MyCPAN::Indexer.pm.yaml.yaml
  • 9. --- !!perl/hash:MyCPAN::App::DPAN::Indexerdist_info:dist_archive_type: tgzmodule_info:- bytesize: 3547file_mime_type: text/plainmd5: e23b82c35130ad2d56ce8bc2a13accc8mtime: 1197166594name: lib/SimpleLinkChecker.pmpackages:- HTTP::SimpleLinkCheckerprimary_package: HTTP::SimpleLinkCheckerversion_info:filename: lib/SimpleLinkChecker.pmidentifier:VERSIONline_number: 19sigil: $value: 1.15modules:- lib/SimpleLinkChecker.pmyaml
  • 10. Inspection
  • 11. warnings.pm|45e2642a40bb2d1b2517b6b0043f0702XSLoader.pm|82e9e9412227d8a8280d8ddad0a68d6dApp/Cpan.pm|4de7e0fe4c0f0e93265a41ae5092a7e2App/Prove/State.pm|2a21ed7a3cbb58df1f5516840c108703Archive/Extract.pm|c7af3f54ce42a74b7e728a6ee22a9f21Archive/Tar.pm|aaf9e4dcfa573dba6d29c88cfc7dd12cArchive/Tar/Constant.pm|ca973aae524b7017d672f5bc4a33d9b4HTTP/SimpleLinkChecker|e23b82c35130ad2d56ce8bc2a13accc8
  • 12. 45e2642a40bb2d1b2517b6b0043f070282e9e9412227d8a8280d8ddad0a68d6d4de7e0fe4c0f0e93265a41ae5092a7e22a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f21aaf9e4dcfa573dba6d29c88cfc7dd12cca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANad3e5f671b1a0d8a166b0c47c064c829d9d478b5bf17a084ece23dc89e846397b2bb5bc3b63895e7800e61e0af34f29771fec9527186458eb49908482ab0a0ac9a0370ce4b8ebad611812b1c6750f83cc59010149f1675b8132698dd5126db204d48c8f5c2ee07e53f6ac67e997cb5d66801455ffe35cf1eaef66bbd6c7169ab766f973c47980f59be94a266979b6fb879dd99ed0ec6db5e0b4f04c7ad00d052217ac40ea8f9e4becda8a13f8ef81933e23b82c35130ad2d56ce8bc2a13accc8e1dbfb093b8a91044c98cca07f47b608459aa989c0f46d5817496374597ee1ea6243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e3454918346910ca43bf49c8cd81b0f606d2093d767be71b51293cd07a1d7c7e118adc8a13040b42f0f2ef3b51828c3259d05116f6196baa5a27a351d51b60bb5c00cd55580e048957ca53b51e2e2c5d112fbb21f1baee56f162ef27e2dee9d039294d78df34112638334b169de2033f4b6e5efef11c
  • 13. Problem 0Bad Data
  • 14. MyCPAN::Indexerhas to keepupdating
  • 15. MyCPAN::Indexeris gettingbetter
  • 16. MyCPAN::Indexerhas toreindex
  • 17. -1%100 of 10,000 files
  • 18. Problem 1Some releaseshave thesame exact files
  • 19. 766f973c47980f59be94a266979b6fb8e1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.23.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Foo-Bar-1.34.tgz9a0370ce4b8ebad611812b1c6750f83cc59010149f1675b8132698dd5126db20e23b82c35130ad2d56ce8bc2a13accc86801455ffe35cf1eaef66bbd6c7169abFoo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc8Quack-0.01.tgz6243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469
  • 20. 766f973c47980f59be94a266979b6fb8e1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.23.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Foo-Bar-1.34.tgz9a0370ce4b8ebad611812b1c6750f83cc59010149f1675b8132698dd5126db20e23b82c35130ad2d56ce8bc2a13accc86801455ffe35cf1eaef66bbd6c7169abFoo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc8Quack-0.01.tgz6243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469
  • 21. 766f973c47980f59be94a266979b6fb8e1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.23.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Foo-Bar-1.34.tgz9a0370ce4b8ebad611812b1c6750f83cc59010149f1675b8132698dd5126db20e23b82c35130ad2d56ce8bc2a13accc86801455ffe35cf1eaef66bbd6c7169abFoo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc8Quack-0.01.tgz6243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469
  • 22. 766f973c47980f59be94a266979b6fb8e1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc8Quack-0.01.tgz6243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469
  • 23. 766f973c47980f59be94a266979b6fb8e1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc8Quack-0.01.tgz6243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469
  • 24. 766f973c47980f59be94a266979b6fb8e1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc8
  • 25. Foo-Bar-1.56.tgz766f973c47980f59be94a266979b6fb8c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8Baz-1.04.tgze1dbfb093b8a91044c98cca07f47b608e23b82c35130ad2d56ce8bc2a13accc82a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f21ca973aae524b7017d672f5bc4a33d9b4Local MyCPAN
  • 26. -2%200 of 10,000 files
  • 27. Problem 2Dual-lived modulesoverwritecore modules
  • 28. 766f973c47980f59be94a266979b6fb83c797302d2fc35fbc65df904eed812a7c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4a0da8cae6a473a9e87ddeb702509fc4dLocal MyCPANperl-5.12.1.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db207ba16d8692b651f52984605198231657a0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.14.2.tgz9a0370ce4b8ebad611812b1c6750f83c2698ecc95aa4f7887656c5930082f81bc59010149f1675b8132698dd5126db203c797302d2fc35fbc65df904eed812a7a0da8cae6a473a9e87ddeb702509fc4dperl-5.16.1.tgz4d48c8f5c2ee07e53f6ac67e997cb5d6c59010149f1675b8132698dd5126db20500c7513b048905fe3cf2b440da56d0aa0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.19.0.tgzee56f162ef27e2dee9d039294d78df34b2bb5bc3b63895e7800e61e0af34f2976243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469
  • 29. 766f973c47980f59be94a266979b6fb83c797302d2fc35fbc65df904eed812a7c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4a0da8cae6a473a9e87ddeb702509fc4dLocal MyCPANperl-5.12.1.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db207ba16d8692b651f52984605198231657a0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.14.2.tgz9a0370ce4b8ebad611812b1c6750f83c2698ecc95aa4f7887656c5930082f81bc59010149f1675b8132698dd5126db203c797302d2fc35fbc65df904eed812a7a0da8cae6a473a9e87ddeb702509fc4dperl-5.16.1.tgz4d48c8f5c2ee07e53f6ac67e997cb5d6c59010149f1675b8132698dd5126db20500c7513b048905fe3cf2b440da56d0aa0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.19.0.tgzee56f162ef27e2dee9d039294d78df34b2bb5bc3b63895e7800e61e0af34f2976243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e345491834699f37118ef2781c6ada6560757b348bf683695e488c53b573e8289b4e2837047da4534d41a113c7aad16c45b1182cfc74cce79ad826b0a29748b2c3e43706a8662ee005e8b18fcc9c0b711fe8678f559dAlready removed
  • 30. 766f973c47980f59be94a266979b6fb83c797302d2fc35fbc65df904eed812a7c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4a0da8cae6a473a9e87ddeb702509fc4dLocal MyCPANperl-5.12.1.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db207ba16d8692b651f52984605198231657a0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.14.2.tgzcpan/CPAN/lib/CPAN.pmcpan/CPAN/lib/App/Cpan.pmcpan/CPAN-Meta/lib/CPAN/Meta.pm3c797302d2fc35fbc65df904eed812a7a0da8cae6a473a9e87ddeb702509fc4dperl-5.16.1.tgz4d48c8f5c2ee07e53f6ac67e997cb5d6c59010149f1675b8132698dd5126db20500c7513b048905fe3cf2b440da56d0aa0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.19.0.tgzee56f162ef27e2dee9d039294d78df34b2bb5bc3b63895e7800e61e0af34f2976243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469lib/CPAN.pmlib/App/Cpan.pmlib/CPAN/Meta.pmcce79ad826b0a29748b2c3e43706a8662ee005e8b18fcc9c0b711fe8678f559dAlready removed
  • 31. 766f973c47980f59be94a266979b6fb83c797302d2fc35fbc65df904eed812a7c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4a0da8cae6a473a9e87ddeb702509fc4dLocal MyCPANperl-5.12.1.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db207ba16d8692b651f52984605198231657a0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.14.2.tgz3c797302d2fc35fbc65df904eed812a7a0da8cae6a473a9e87ddeb702509fc4dperl-5.16.1.tgz4d48c8f5c2ee07e53f6ac67e997cb5d6c59010149f1675b8132698dd5126db20500c7513b048905fe3cf2b440da56d0aa0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.19.0.tgzee56f162ef27e2dee9d039294d78df34b2bb5bc3b63895e7800e61e0af34f2976243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469cce79ad826b0a29748b2c3e43706a8662ee005e8b18fcc9c0b711fe8678f559dAlready removed
  • 32. 766f973c47980f59be94a266979b6fb83c797302d2fc35fbc65df904eed812a7c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4a0da8cae6a473a9e87ddeb702509fc4dLocal MyCPANperl-5.12.1.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db207ba16d8692b651f52984605198231657a0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.14.2.tgz3c797302d2fc35fbc65df904eed812a7a0da8cae6a473a9e87ddeb702509fc4dperl-5.16.1.tgz4d48c8f5c2ee07e53f6ac67e997cb5d6c59010149f1675b8132698dd5126db20500c7513b048905fe3cf2b440da56d0aa0da8cae6a473a9e87ddeb702509fc4d3c797302d2fc35fbc65df904eed812a7perl-5.19.0.tgzee56f162ef27e2dee9d039294d78df34b2bb5bc3b63895e7800e61e0af34f2976243b4ec546826e5723bb9e2c30b611f4441a9f2017ea3f804d1e34549183469cce79ad826b0a29748b2c3e43706a8662ee005e8b18fcc9c0b711fe8678f559dAlready removed
  • 33. 766f973c47980f59be94a266979b6fb83c797302d2fc35fbc65df904eed812a7c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4a0da8cae6a473a9e87ddeb702509fc4dLocal MyCPANperl-5.14.2.tgz3c797302d2fc35fbc65df904eed812a7a0da8cae6a473a9e87ddeb702509fc4dcce79ad826b0a29748b2c3e43706a8662ee005e8b18fcc9c0b711fe8678f559dAlready removed
  • 34. Cheating•Look for Config.pm•Look at path for version directories•Choose from invoking Perl
  • 35. -9%900 of 10,000 files
  • 36. Problem 3Local editsinterfere withmatching
  • 37. 112638334b169de2033f4b6e5efef11ce1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db202a21ed7a3cbb58df1f5516840c108703c7af3f54ce42a74b7e728a6ee22a9f216801455ffe35cf1eaef66bbd6c7169abca973aae524b7017d672f5bc4a33d9b4e23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.23.tgzad3e5f671b1a0d8a166b0c47c064c829c59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8
  • 38. lib/Foo/Bar.pme1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db20lib/Baz/Bar.pmlib/Quux/Bar.pm6801455ffe35cf1eaef66bbd6c7169ablib/Quack.pme23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.23.tgzlib/Foo/Bar.pmc59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8
  • 39. lib/Foo/Bar.pme1dbfb093b8a91044c98cca07f47b608c59010149f1675b8132698dd5126db20lib/Baz/Bar.pmlib/Quux/Bar.pm6801455ffe35cf1eaef66bbd6c7169ablib/Quack.pme23b82c35130ad2d56ce8bc2a13accc8Local MyCPANFoo-Bar-1.23.tgzlib/Foo/Bar.pmc59010149f1675b8132698dd5126db206801455ffe35cf1eaef66bbd6c7169abe23b82c35130ad2d56ce8bc2a13accc8
  • 40. $ diff ~perl/lib/Foo/Bar.pm~BackPAN/.../Foo-Bar-1.23/lib/Foo/Bar.pm
  • 41. Take thesmallestdiff
  • 42. Create adistroprefsfile
  • 43. -.1%10 of 10,000 files
  • 44. Problem 4Private modulesarentindexed
  • 45. UseMyCPAN::Indexerlocally
  • 46. -.1%10 of 10,000 files
  • 47. Problem 5Multiple releasescan existat the same time
  • 48. So Far...
  • 49. 87%8,700 of 10,000 files
  • 50. What you can do
  • 51. Try theStratoPAN.combeta
  • 52. Send meyourdigestshttps://gist.github.com/briandfoy/5651608
  • 53. References•MyCPAN::Indexer•MyCPAN::App::DPAN•BackPAN Archeology (http://yapc.tv/2008/ye/brian-backpan/)•http://www252.pair.com/comdog/