Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Feb 2001 10:08:20 -0800
From:      "Bruce A. Mah" <bmah@FreeBSD.ORG>
To:        Will Andrews <will@physics.purdue.edu>
Cc:        ewdafa <ewdafa@ewdafa.b0rk.co.uk>, ports@FreeBSD.ORG
Subject:   Re: @comment ORIGIN 
Message-ID:  <200102011808.f11I8KW38762@bmah-freebsd-0.cisco.com>
In-Reply-To: <20010201123049.Z479@puck.firepipe.net> 
References:  <005201c08ba8$3ac799a0$0a00a8c0@reevolved.net> <20010201123049.Z479@puck.firepipe.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--==_Exmh_-1562143420P
Content-Type: text/plain; charset=us-ascii

If memory serves me right, Will Andrews wrote:

> > I was thinking, is there a way to easily update packages?
> > At the moment i 'make deinstall' and then 'make clean; make install', as =
> im
> > not so keen on what 'make reinstall' is actually doing.

"make reinstall" is probably not what's wanted here.

> > How do you guys do it?
> 
> I do it like that; you may wish to check out pkg_update(1), although atm
> that's only in -current.  But it's just a perl script...

I recompile all of my packages from ports.  I figure out which ones 
from "pkg_version -v" (I guess that isn't a great surprise), and then 
I'll manually determine what order to do this in.

I don't trust automated tools to go in and do this automatically.  
The output of "pkg_version -c" outputs its script files in alphabetical 
order by port name, as opposed to some dependency order.  As someone 
pointed out, you lose dependency information.  Finally, I have a report 
from someone whose system was rendered unusable when he ran the output 
of "pkg_version -c" unedited, and it tried to update a ports upgrade 
kit.

I think that what pkg_update does is nice.  I'm less than pleased about
how it appeared in the tree, but that's a different story.  Haven't
looked at it recently, but it'd be interesting to see if a port's
Makefile do something similar (e.g. "make update").  I think with the
ORIGIN directive, it's feasible to think about implementing.  

Aw heck.  I was just going to stop at that, but while I'm thinking about
it, here's a brain dump of how I think "make update" should go.  It'd be
something like:

1.  Scan /var/pkg/db to figure out what package has the current port as
an origin.  If there isn't anything matching, then exit with an error.  
We MUST exit at this point because we can't take the risk of blowing 
away some random port due to a heuristic that went awry.

2.  Perform the equivalent of a "make all" on this port.  If we have
build-time dependencies, we need to perform a recursive "make update".
In this case (and step 5 below) I am not sure how to tell the difference
between an old dependency with no origin information that needs to be
upgraded and a new dependency.  If assuming the former, we throw up our
hands and exit (limits utility of the update target, but very
conservative with respect to overwriting installed ports).  If assuming
the latter, we run the risk over overwriting an old port with no ORIGIN.

3.  Save the dependency information from the old package (like what 
pkg_update does).

4.  pkg_delete the old package.

5.  Perform the equivalent of a "make install" on this port.  If we 
have run-time dependencies, we need to perform a recursive "make 
update".

6.  Restore the dependency information from the old package.

The solution needs to be pretty conservative with respect to what it 
does with packages with no ORIGIN information; there's plenty of corner 
cases that need to be handled (search the archives for my rants against 
"pkg_version -c").

(This message could be constituted as an extremely weak statement of
interest on my part, but if someone else has time to go and do it first,
I would be overjoyed.)

Bruce.



--==_Exmh_-1562143420P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: Exmh version 2.2 06/23/2000

iD8DBQE6eaYU2MoxcVugUsMRAl1OAKCt6EXRxLk4YaOUICbmoPwZnBvudQCgkFyH
7AzRHJLy9xD0Qaf5IvQ8TG0=
=PQIn
-----END PGP SIGNATURE-----

--==_Exmh_-1562143420P--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102011808.f11I8KW38762>