Subject: Re: update pkgsrc package
To: Jeremy C. Reed <reed@reedmedia.net>
From: Brian de Alwis <bsd@cs.ubc.ca>
List: netbsd-users
Date: 05/10/2001 11:40:38
Georges asked for advice on how to upgrade a package that is a
prerequisite, without recompiling/reinstalling the world.  As it's a
question I've been meaning to ask too, and not having seen any
satisfactory responses (did this move to tech-pkg?), I don't want to
see it die.

Rearranging Jeremy C. Reed's e-mail:

> I may misunderstand your statement above. Can you show us some actual
> example(s)?

So consider esound. I have esound 0.2.20 installed, but would like to
upgrade to esound 0.2.22:

    $ pkg_info esound
    Information for esound-0.2.20:

    Comment:
    the Enlightened sound daemon

    Requires:
    libaudiofile-*

    Required by:
    gnome-libs-1.2.8
    control-center-1.2.2
    xscreensaver-gnome-3.25nb1
    gdm-2.0b4
    gnome-users-guide-1.2
    [...]

Doing a `make update' will require recompiling about 35 different
packages on my system. Ugh. (At least, that's my understanding;
maybe `make update' will selectively update only those packages
explicitly requiring esound-0.2.20?)

It's even worse for things like libpng, or xpm.

> Look at the pkg_delete manual page. You could delete the package without
> deleting the packages that depend on it; and then reinstall it. This is
> probably not a good idea.

When I have to do this, I instead use

    FORCE_PKG_REGISTER=1

But that's not clean: it leaves the old entries in the package database
as well as having new entries. So I now have entries for png-1.0.8
and png-1.0.10. I'd like to somehow say `install this as a drop-in
replacement for the previous version'.

I thought I could use `pkg_delete -O' (remove entries from the pkg db,
but leave the actual package), and then install the new version.
Thus dependent software should continue to work providing the new
version is `drop-in' compatible. But `pkg_delete -O' didn't seem to
do anything, and I haven't pursued it any further. 

    # pkg_delete -v -O png-1.0.8
    # ls /var/db/pkg/png-1.0.8
    +BUILD_INFO     +COMMENT        +DESC           +SIZE_ALL
    +BUILD_VERSION  +CONTENTS       +REQUIRED_BY    +SIZE_PKG
    # 

More thoughts?

-- 
"Maybe this world is another planet's Hell." - Aldous Huxley