How to use a CPANPLUS autobundle to update a new version of Perl?

。_饼干妹妹 提交于 2019-12-04 01:49:25

A bundle file is a CPAN special-cased thing that - to my surprise - does not happen to also work in CPANPLUS. That's why no one talks of CPANPLUS bundles and you couldn't find anything. So employ CPAN. First find out where your CPAN root is, by default it's ~/.cpan or ~/.local/share/.cpan on a Free Desktop XDG-compliant system. Alter the instructions accordingly.

mkdir -p ~/.cpan/Bundle
mv ~/.cpanplus/5.13.4/dist/autobundle/Snapshot_2011_05_18_00.pm ~/.cpan/Bundle
cpan Bundle::Snapshot_2011_05_18_00   # DTRT

As you were talking about recompile, CPAN has that command and you can issue it from either the CPAN shell or as API call from the command-line, but it's useful only if you have modules at a fixed location across versions of Perl.

BergBrains

CPANPLUS autobundles work fine as of now. Just be sure to reference the bundle with 'file://' prefixed to the full path of the bundle.

There will certainly be some diddlin' that you'll have to do with some modules, but for the most part it should be completely doable.

Some extra information that may save other people some hair-tearing.

  1. If you have a snapshot file $HOME/Snapshot_2013_12_23_00.pm, you can run:

    cpanp -i file://$HOME/Snapshot_2013_12_23_00.pm
    

    and the install will start.

  2. When you do this, Perl will create a file such as:

    $HOME/cpan/authors/id/UNKNOWN-ORIGIN/Snapshot_2013_12_23_00.pm
    

    (The exact location will depend on where you've configured your CPANPLUS repository; mine goes into $HOME/cpan.)

    If you need to hack the snapshot file (because some module won't compile), you can edit and specify the filename on the command line until you're blue in the face and completely hairless, and it won't make the slightest diffence because despite you telling it to look in $HOME, CPANPLUS is looking at the file it copied into the UNKNOWN_ORIGIN directory. Removing the file certainly works; you could probably edit it too.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!