如何升级我的 MacPorts Perl 安装?

发布于 2024-09-27 18:47:49 字数 330 浏览 4 评论 0原文

我已在配备 Snow Leopard 的 MacBook Pro 中安装了 MacPorts。我没有在那里明确安装 perl,但我猜它要么是随默认的 macports 安装一起安装的,要么是由我安装的任何其他端口作为依赖项安装的。

我想将 Perl v5.8.9 升级为最新的稳定 Perl 版本。无论当前是什么(我看到它是 5.12.2)。所以,我的问题只是如何在 macports 中用新的 Perl 完全替换旧的 Perl。

sudo port Upgrade perl5 可以工作吗?或者我还需要做其他事情吗?我只是想确保这是正确的命令,以避免搞砸我的 macports 安装。

I have installed MacPorts in my MacBook Pro with Snow Leopard. I hadn't explicitly installed perl there but I guess it either came installed with the default macports install or was installed as a dependency by any other port I installed.

I want to upgrade the Perl v5.8.9 there with the latest stable Perl version. Whichever it may be currently (I see it is 5.12.2). So, my question is simply how do I do a complete replacement of the old Perl with the new in macports.

Will sudo port upgrade perl5 work or do I need to do something else as well. I just wanted to make sure this was the right command so as to avoid screwing up my macports install.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦幻的心爱 2024-10-04 18:47:49

port Upgrade packagename 是正确的形式,是的。

但我认为在这种情况下,情况比这要棘手一些。

查看 perl5 portfile。它是一个仅依赖于 perl 5.8 的包装器。如果您只是 sudo port Upgrade perl5,它不会让您升级到 5.12。然而,perl5 软件包有几个针对 5.10 和 5.12 的变体。您应该能够使用 port versions perl5 在本地查看所有这些。

我不确定的是您是否可以将变体标志(在本例中为+perl5_12)传递给端口升级,或者您是否需要执行新的port install 在当前安装之上。或者甚至,最恐怖的是,在安装变体之前卸载当前的软件包。

恕我直言,整个变体机制是一个错误。这是一项有趣且有价值的实验,但我们从中了解到这是一个坏主意。

编辑:我认为您可以向已安装的端口添加变体;看来你必须说:

sudo port deactivate perl5
sudo port install perl5 +perl5_12

port upgrade packagename is the right form, yes.

But i think that in this case, it's a bit trickier than that.

Have a look at the perl5 portfile. It's a wrapper which simply depends on perl 5.8. If you just sudo port upgrade perl5, it won't get you to 5.12. However, the perl5 package has a couple of variants for 5.10 and 5.12. You should be able to see all this locally with port variants perl5.

What i'm not sure about is whether you can pass variant flags (+perl5_12 in this case) to port upgrade, or whether you need to do a new port install on top of your current installation. Or even, horror of horrors, uninstall the current package before installing the variant.

The whole variant mechanism was a mistake, IMHO. An interesting and worthwhile experiment, but one from which we've learned it was a bad idea.

EDIT: i think you can add a variant to an installed port; it seems you have to say:

sudo port deactivate perl5
sudo port install perl5 +perl5_12
柒夜笙歌凉 2024-10-04 18:47:49

在安装 perl5.12 之前,您需要卸载 perl5.8

sudo port deactivate perl5.8
sudo port uninstall perl5.8
sudo port install perl5 +perl5_12

注意:如果卸载 perl5.8 失败,您可能会强制卸载 警告

sudo port uninstall -f perl5.8

:这可能会破坏其他包的依赖关系。

但到目前为止,它为 perl(以及我)完成了这项工作:

% perl -v

This is perl 5, version 12, subversion 2 (v5.12.2) built for darwin-multi-2level

You'll need to uninstall perl5.8 before installing perl5.12:

sudo port deactivate perl5.8
sudo port uninstall perl5.8
sudo port install perl5 +perl5_12

Note: If uninstalling perl5.8 fails, you might force the uninstall by

sudo port uninstall -f perl5.8

WARNING: This might break other packages' dependencies.

But so far, it did the job for perl (and for me):

% perl -v

This is perl 5, version 12, subversion 2 (v5.12.2) built for darwin-multi-2level
江湖正好 2024-10-04 18:47:49

我在从 Perl 5.26 迁移到 5.28 时这样做了:

  • $ sudo vi /opt/local/etc/macports/variants.conf 添加 +perl5_28 (允许使用 emacs : -)
  • $ 端口取决于 perl5.26 | awk '!/p5.26/ { print $1 }' | xargs sudo port install 升级 perl、git 等,使其位于新变体之上
  • $ sudo port uninstall --follow-dependents perl5.26 消除 Perl 5.26。

I did this when moving from Perl 5.26 to 5.28:

  • $ sudo vi /opt/local/etc/macports/variants.conf to add +perl5_28 (using emacs is allowed :-)
  • $ port depend perl5.26 | awk '!/p5.26/ { print $1 }' | xargs sudo port install to upgrade perl, git and the like to sit on top of the new variant
  • $ sudo port uninstall --follow-dependents perl5.26 to eliminate Perl 5.26.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文