如何安装一组Perl模块的特定版本? [英] How can I install a specific version of a set of Perl modules?

查看:224
本文介绍了如何安装一组Perl模块的特定版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是复制生产环境以创建许多测试/就座环境.

I'm tasked with replicating a production environment to create many test/sit environments.

我需要做的一件事情就是建立Perl,并安装多年来已安装的所有模块(包括内部和外部模块).我可以只使用CPAN.pm autobundle,但这将导致测试环境具有生产所具有的外部模块的更新版本.

One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the test environment having much newer versions of the external modules that production has.

获取和安装(很多)特定于版本的Perl模块的最简单/最佳方法是什么.

What is the easiest/best way to get and install (a lot of) version specific Perl modules.

推荐答案

使用所需的内容制作自己的CPAN镜像. Stratopan.com (一项服务)和 Pinto (基于此工具)可以帮助您做到这一点.

Make your own CPAN mirror with exactly what you want. Stratopan.com, a service, and Pinto, tools that's built on top of, can help you do that.

由于PAUSE仅索引最新版本,因此CPAN工具仅安装任何发行版的最新版本.但是,您可以创建自己的私有CPAN,该CPAN完全具有所需的分布.一旦拥有了仅包含所需内容的CPAN镜像,就可以将CPAN工具仅指向该镜像,因此它仅安装那些版本.一分钟内会提供更多信息.

The CPAN tools only install the latest version of any distribution because PAUSE only indexes the latest version. However, you can create your own, private CPAN that has exactly the distributions that you want. Once you have your own CPAN mirror with only what you want, you point your CPAN tools at only that mirror so it only installs those versions. More on that in a minute.

现在,您想拥有多个版本.您可以创建任意数量的镜像,也可以将镜像置于源代码管理中,以便可以签出您喜欢的任何版本的镜像.

Now, you want to have several versions of that. You can create as many mirrors as you like, and you can also put the mirrors in source control so you can check out any version of the mirror that you like.

诸如CPAN :: Mini :: Inject之类的工具可以帮助您设置自己的CPAN.请查看我在Slideshare上的演讲,以获取基本示例,以及一些 Perl评论中对此有所了解,或者应该在下一期中发表. :)

Tools such as CPAN::Mini::Inject can help you set up your own CPAN. Check out my talks on Slideshare for the basic examples, and some of my videos on Vimeo for some of the demonstrations. Look at anything that has "CPAN" or "BackPAN" in the title. I think I might have some stuff about it in The Perl Review too, or should by the next issue. :)

最近,我一直在开发一个名为dpan(适用于DarkPAN)的程序,该程序可以查看随机目录,在其中查找Perl发行版,并创建所需的结构和索引文件.运行dpan,您将获得一个指向CPAN客户端的URL,然后退出.这是我的MyCPAN-Indexer项目的一部分,该项目位于 Github 中.还没有准备好在无人监督的公共场合使用,因为我主要与公司客户一起定制他们的设置.如果您对此感兴趣,请随时向我提问.

Lately, I've been working on a program called dpan (for DarkPAN) that can look at random directories, find Perl distributions in them, and create the structure and index files that you need. You run dpan, you get a URL to point your CPAN client toward, and off you go. It's part of my MyCPAN-Indexer project, which is in Github. It's not quite ready for unsupervised public use because I mostly work with corporate clients to customize their setup. If you're interested in that, feel free to ask me questions though.

此外,我最近发布了 CPAN :: PackageDetails 可以帮助您建立正确的索引文件.还是有点年轻,但是如果您需要一些特别的东西,那就问一下.

Also, I recently released CPAN::PackageDetails that can help you build the right index file. It's still a bit young too, but again, if you need something special, just ask.

这篇关于如何安装一组Perl模块的特定版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆