On Sun, May 16, 2004 at 10:25:33AM -0400, Robert Fitzpatrick wrote:
> Can portupgrade be used to upgrade OpenLDAP 2.1.x to 2.2.x by changing
> WITH_OPENLDAP_VER in my /etc/make.conf file to 22? Or do I have to
> deinstall the 21 package, and reinstall 22 and everything that depends
> on it?

You can use portupgrade do that, but it's slightly more complicated
than what you propose.  The way to upgrade to not just a different
version of the same port, but a completely different port is to use
the '-o' option to portupgrade.  Thus in principal to upgrade from
openldap21-client to openldap22-client you would run:

    # portupgrade -o net/openldap22-client -f net/openldap21-client

which will replace the openldap21 client side with the openldap22
stuff, fixing up all the dependcy linkages in pkgdb as it does.
(Nb. there aren't any sanity checks while doing this, so you can in
theory persuade the ports system that 'quake2server' is an adequate
substitue for 'gcc34' and other insanities.  Be sure you understand
what you are doing.)

Now, the astute reader will have noticed the weasel words 'in
principal' in that first paragraph.  That's because things are
somewhat more complicated than you might hope.  The problem is that
the openldapXX-client ports provide several shlibs, and the ABI
version number has changed from one openldap version to the other:

    % grep .so. openldap21-server/pkg-plist.client 
    lib/liblber.so.2
    lib/libldap.so.2
    lib/libldap_r.so.2
    % grep .so. openldap22-server/pkg-plist.client
    lib/liblber.so.202
    @comment lib/liblber-2.2.so.7
    lib/libldap.so.202
    @comment lib/libldap-2.2.so.7
    lib/libldap_r.so.202
    @comment lib/libldap_r-2.2.so.7

That means that all of the applications linked against the LDAP shlibs
have suddenly stopped working.  To fix them, all you need do is
reinstall -- the situation is analogous to the problem with
'libintl.so.N no found' thing that keeps coming up over and over on
this list.

Before we get too happy about doing that, first we need to take care
of the openldap server. But that's only if you've got one running on
this particular system.  It just takes the same sort of command line
as for the client upgrade:

    # portupgrade -o net/openldap22-server -f net/openldap21-server

You may have to install some new versions of the Berkely DB library to
get that to work correctly.

Now you can re-install all of the other programs that link against the
openldap shlibs -- which is basically all dependencies of the
openldap-client port.  Note that openldap-server is also a dependency
of openldap-client, but there's no point in re-installing that again,
or anything else updated after the OpenLDAP client software:

    # portupgrade -rf net/openldap22-client -x '>=openldap*client'

And that is really all there is to it.  Oh -- although don't forget to
put 'WANT_OPENLDAP_VER=22' into your /etc/make.conf or
/usr/local/etc/pkgtools.conf once you're done.

        Cheers,

        Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgpKRPLpuEOBb.pgp
Description: PGP signature

Reply via email to