Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2003 13:09:51 -0700
From:      Tim Kientzle <kientzle@acm.org>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   pkg_add and osreldate
Message-ID:  <3ECE800F.9040104@acm.org>

next in thread | raw e-mail | index | archive | help
pkg_add currently has logic to determine which dir
(under ftp://ftp.freebsd.org/pub/FreeBSD/ports)
to use for downloading packages.  This is driven
by the following table:

> { 410000, 410000, "/packages-4.1-release" },
> { 420000, 420000, "/packages-4.2-release" },
> { 430000, 430000, "/packages-4.3-release" },
> { 440000, 440000, "/packages-4.4-release" },
> { 450000, 450000, "/packages-4.5-release" },
> { 460000, 460001, "/packages-4.6-release" },
> { 460002, 460099, "/packages-4.6.2-release" },
> { 470000, 470099, "/packages-4.7-release" },
> { 300000, 399000, "/packages-3-stable" },
> { 400000, 499000, "/packages-4-stable" },
> { 510000, 599000, "/packages-5-stable" },
> { 0, 9999999, "/packages-current" },

This table is searched linearly; the first
entry where osreldate falls within the indicated
range is used.

Problem:  If someone runs this on a 4.5-STABLE
system, for instance (osreldate=450100), then
they will be directed to "packages-4-stable".
It seems that packages-4.5-release would
be more appropriate.  Similarly, this logic claims
that a 3.x system should be using packages from
5-stable!  (Though I don't consider that
a serious problem, of course. ;-)

I'm considering a simpler scheme: choose the
first item with version <= osreldate.

>   { 440000, "/packages-4.4-release" },
>   { 450000, "/packages-4.5-release" },
>   { 460000, "/packages-4.6-release" },
>   { 460002, "/packages-4.6.2-release" },
>   { 470000, "/packages-4.7-release" },
>   { 480000, "/packages-4.8-release" },
>   { 490000, "/packages-4-stable" },
>   { 500000, "/packages-5.0-release" },
>   { 510000, "/packages-5-current" },
>   { 520000, "/packages-5-current" },
>   { 600000, "/packages-current" },


This would seem to provide cleaner handling
of the various borderline cases.

Any thoughts?

Tim





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