Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Reverse Installing CPAN

2,961 views

Published on

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

Published in: Technology, Art & Photos
  • Be the first to comment

Reverse Installing CPAN

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

×