How to upgrade MacPorts Perl installation?

I installed MacPorts on my MacBook Pro with Snow Leopard. I did not explicitly install perl, but I assume that it was either installed with the default macports installation, or was installed as a dependency on any other port I installed.

I want to upgrade Perl v5.8.9 there with the latest stable version of Perl. Whatever it is at present (I see it on 5.12.2). So my question is how to make a complete replacement of the old Perl with the new one in macports.

Will it work sudo port upgrade perl5or do I need to do something else. I just wanted to make sure that it was the right command so as not to touch the installation of my macports.

+3
source share
2 answers

port upgrade packagename is the correct form, yes.

But I think that in this case it is a little more complicated.

Take a look at perl5 portfile . This is a shell that just depends on perl 5.8. If you are simple sudo port upgrade perl5, this will not lead you to 5.12. However, the perl5 package has several options for 5.10 and 5.12. You should see all this locally with port variants perl5.

That I'm not sure if you can pass option flags ( +perl5_12in this case) to port upgrade, or you need to make a new one port installon top of the current installation. Or even, horror horror, uninstall the current package before installing the option.

The whole version of the mechanism was a mistake, IMHO. An interesting and useful experiment, but one of which we learned was a bad idea.

EDIT: , ; , :

sudo port deactivate perl5
sudo port install perl5 +perl5_12
+5

perl5.8 perl5.12:

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
+4

Source: https://habr.com/ru/post/1769742/


All Articles