geektron has asked for the wisdom of the Perl Monks concerning the following question:

i recently upgraded a kernel on my primary machine and decided to upgrade perl while i was at it -- using FreeBSD's pkg_add method. problem is, the package that's compiled doesn't have 'backwards compatiblility' in it ... the 5.8.1 package only has site_perl set for the current version, not any previous versions -- meaning i've 'lost' access to any modules already installed.

will recompiliing with the proper options 'magickally' fix this? basically, point @INC to all the previous directories also ...

i really don't want to try and catalog the modules i've already installed and re-install them ....

Replies are listed 'Best First'.
Re: annoying upgrade issue
by dragonchild (Archbishop) on Jul 07, 2004 at 15:30 UTC
    i really don't want to try and catalog the modules i've already installed and re-install them ....

    Believe it or not, you actually want to. Anytime you upgrade ANYTHING that can affect a C library, you will want to reinstall every single Perl module. For one thing, XS compatability between Perl 5.0x and 5.6.x isn't guaranteed, nor between 5.6.x and 5.8.x. So, CGI installed for 5.005_3 will NOT work with Perl 5.8.1, for example.

    Additionally, if you upgraded the kernel, you may have to upgrade or recompile dependent C libraries, which means you need to upgrade or recompile dependent Perl modules. (For example, if you upgrade libopenssl, you should reinstall Net::SSH.)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

      Just a reminder, but 5.8.1 won't work with any other 5.8.x because binary compatibility was broken in that version.
Re: annoying upgrade issue
by gellyfish (Monsignor) on Jul 07, 2004 at 14:24 UTC

    This probably won't help you in this case but if you still have the old perl binary left then you can do:

    /path/to/old/perl -MCPAN -e'autobundle'
    To create a Bundle::Snapshot_2004_07_07_00 (probably different date of course) and then do:
    /path/to/new/perl -MCPAN -e'install "Bundle::Snapshot_2004_07_07_0 +0"'
    and this will automatically install all the modules for your new perl.

    /J\

      hrm ... i dunno if i have the old one around or not. but, would that also pull down newer versions of installed modules, if there is a newer one?

        It is capture the version of the installed module but I think that it will get a newer one if one is available.

        /J\

Re: annoying upgrade issue
by iburrell (Chaplain) on Jul 07, 2004 at 15:57 UTC
    What version did you upgrade from? Binary modules definitely won't be compatible between major versions, and there were some issues with binary compatibility in the 5.8.x series. All the XS modules will need to be rebuilt.

    If you want to live dangerously, you could just copy all the modules in the old version site_perl directory to the new version. Do not overwrite new files with the old versions. Do not copy the binary directory (for ex i386-linux-thread-multi).

    cp -r -i -v site_perl/5.8.1/* site_perl/5.8.3
      well, i originally had 5.005 and 5.6.1 on the machine ( 5.005 is the 'standard' FreeBSD version, and that fact still annoys me ), and a 5.6.1 that i had installed from source ( if not from source, via CPAN.pm upgrade ... i can't remember now )

      i didn't realize that there were binary incompatibililites ... i guess i have *more* upgrade work on the box to do ... which, unfortunately, is going to have to wait until i can figure out why the damned thing keeps rebooting itself for now good reason.

        5.005 is the 'standard' FreeBSD version, and that fact still annoys me

        This isn't strictly true. In FreeBSD-4, 5.005 has been retained as the base Perl to avoid incompatibility problems for users tracking -STABLE. If the version of Perl in the base system changed, these users would also have to update Perl modules when updating the base system. This would likely result in lots of angry users and support problems.

        It's easy enough to install 5.6.x from lang/perl5, or 5.8.x from lang/perl5.8 and run use.perl port. The pkg-message file for both these ports, which should be displayed after installation, documents this.

        As of FreeBSD-5, Perl no longer ships in the base system to help avoid these problems. In the long term, FreeBSD aims to ship a smaller base system with more functionality moved out to packages.

Re: annoying upgrade issue
by pgor (Beadle) on Jul 07, 2004 at 18:02 UTC
    If you installed the modules via 'make install', there should be a .packlist file at the root of each "parent" module. Going to your old site_perl directory and running "find . -name .packlist" should at least get you on your way toward cataloging your old modules. Good luck.
Re: annoying upgrade issue
by naChoZ (Curate) on Jul 08, 2004 at 04:42 UTC

    For your perl modules installed from ports, you can do something along the lines of portupgrade -f p5-*.

    For your bsdpan-* packages, if you'd like to recompile them and switch them to their respective ports distributions to make it a bit easier to maintain, you can do: portupgrade -f -o portdir/p5-Foo-Bar bsdpan-Foo-Bar

    So, using a specific example: portupgrade -f -o www/p5-WWW-Mechanize bsdpan-WWW-Mechanize

    --
    People who want to share their religious views with you almost never want you to share yours with them.
    naChoZ

Updating Perl modules with FreeBSD Ports or Packages
by tomhukins (Curate) on Jul 08, 2004 at 00:04 UTC

    When updating FreeBSD's ports/packages, make sure you update the dependencies of the new packages. Tools like portupgrade help with this.

    If you installed any Perl modules without using ports/packages, you'll find BSDPAN has automatically converted them into packages: use pkg_info -I 'BSDPAN*' for a list.

    So, finding out which modules you have installed is easy enough. Upgrading them should just be a matter of waiting for things to download and compile. This will probably cause you fewer problems than trying to retain compatibility.