Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 2008 19:41:47 +0100
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Cc:        Boris Samorodov <bsam@ipt.ru>, Beech Rintoul <beech@freebsd.org>, Javier Vasquez <jevv.cr@gmail.com>, andrew clarke <mail@ozzmosis.com>
Subject:   Re: [freebsd-questions] Looking @ upgrades mechanisms...
Message-ID:  <200812021941.47714.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <82180575@bb.ipt.ru>
References:  <c88cc5730812012241i6ea540uc8a56f40c3d8237e@mail.gmail.com> <200812021722.54517.fbsd.questions@rachie.is-a-geek.net> <82180575@bb.ipt.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 02 December 2008 19:03:44 Boris Samorodov wrote:
> Mel <fbsd.questions@rachie.is-a-geek.net> writes:
> > On Tuesday 02 December 2008 17:13:58 andrew clarke wrote:
> >> On Tue 2008-12-02 09:28:44 UTC+0100, Mel
> >
> > (fbsd.questions@rachie.is-a-geek.net) wrote:
> >> > Portupgrade -PP is detrimental for bandwidth. It's not really
> >> > portupgrade's fault (well, partially, it shouldn't offer the feature),
> >> > because it will quite often download Latest/foo.tbz, unpack it
> >> > entirely and then say "oops, I downloaded this useless package which
> >> > is older or equal to what you have installed".
> >>
> >> Yes, this happens.  -PP is not ideal for regular updates but it's
> >> still useful for when you have a new FreeBSD install with no packages
> >> installed, and want to get up and running quickly, grabbing the most
> >> recent binaries of all your favourite ports instead of building them
> >> all from source.
> >
> > That's infinitely slower than pkg_add -r <list of leaves>.
>
> Don't use "portupgrade -NPP <package>". ;-)
> But "portupgrade -PP <package>" really *upgrades* packages.

Don't assume that the @pkgdep lines in a given package on the FreeBSD servers 
will always point to an existing package. If it doesn't, watch what happens:
Latest/foo.tbz based on s/@name (.*)-[^-]+$/$1/
extract foo.tbz entirely, rather then just +CONTENTS which is the first file 
in the tar archive
find out that foo = foo-older-then-installed and discard the package

I've solved this myself with an index format like this:
# bzcat /var/pkg/7-stable/All/INDEX.bz2 |tail -1
archivers/zip:zip-3.0.tbz:72f4fcc337c74240eaa8ae989a452835231fe7ff32c7469094e3a5fe411d7430:181194

$origin:$pkgname.tbz:$sha256:$size

High level view: Compare btree of /var/db/pkg with btree of indexfile, 
download and upgrade.
Saves bogus downloads and doesn't need a portstree. Cons: buildserver needs to 
periodically create the index, index needs to be downloaded.
-- 
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.



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