views:

60

answers:

1

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.

+2  A: 

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
Tom Anderson