Subject: Re: "make update" question
To: Huub <huubvanniekerk@gmail.com>
From: Brian McEwen <bmcewen@comcast.net>
List: netbsd-users
Date: 09/16/2006 07:39:17
On Sep 16, 2006, at 5:45 AM, Huub wrote:

> Hi,
>
> I want to update some packages (e.g. firefox) but all I know from  
> the user guide is do "make update". This way everything gets  
> updated. Is there a way to just upgrade 1 package and all  
> dependancies? E.g. on FreeBSD: "portupgrade -R firefox"? I know  
> other utilities exist, but those are branded as "not guaranteed to  
> work".

I think if you look in the archives you will find that make update  
also doesn't work well, or at least has... possible side effects.

In my experience, it will update all involved packages as you note,  
but it _first_ deletes EVERYTHING then tries to rebuild _second_- so  
when there is a problem (not a rare occurrence) and the make update  
aborts- you are left with everything missing and a big mess to figure  
out what happened, and you end up rebuilding by hand one by one  
anyway.  It's a great way to hose a lot of stuff in the system.

The safest way I have found to update a pkg:
Backup your current, working (even if outdated) firefox or whatever  
using pkg_tarup (in pkgtools).  You can skip this step if you build  
your stuff initially using pkg_create (pkg_create also performs a  
mandatory install so if you want to use it to make pkgs after the  
fact, you have to delete everyting first).  I know some people always  
install applications with pkg_create so if the install works, they  
automatically have a binary pkg backup made as well.

Do a make install of your app.  You'll get an error message when the  
final install of your new app notices the older version), and the  
build will abort.  pkg_delete the app, do the make install again, you  
are done.  Dependancies that did not need updated will stay untouched.

If a dependancy is outdated, the install will abort as well.   
pkg_tarup the working install of the dependancy, do a pkg_delete of  
just that dependent package, (you may have to force it), then start  
the make install of the original app over again.   The pkg_tarup  
keeps you safe if the older version worked in your system,  and the  
newer version doesn't build or breaks too many other things in the  
system for you to fix instantly.   When the dependancy is built, go  
back to the make install of the original target.

There might be a better way, but this works and is really not that  
much fuss.  The tools sound like they should be automagic and all,  
but after having them run amok a couple times in close succession, I  
am a lot less willing to give them free reign.  Others mileage may  
vary but when I posted about this a few years ago, I wasn't alone  :)

The other post just now mentioned pkgmanager, I've not looked at that  
much myself.

Brian