Repository Search Order

Dan Lists lists.dan at gmail.com
Sat Sep 13 17:23:31 UTC 2014


On Sat, Sep 13, 2014 at 5:12 AM, Matthew Seaman <matthew at freebsd.org> wrote:

>
> Can you open an issue on github concerning this please?
> https://github.com/freebsd/pkg/issues
>

I don't have an account, but I can create one.


> Bonus points if you can generate a pull request.
>
[clip]


> While changing the order that the repo configuration files load seems to
> be a useful approach, I think that it works, if at all, by chance.  It
> will be fragile in the sense that an unrelated change elsewhere in
> dependency solving could easily destroy any effect from the order that
> config files are processed.
>

In my testing, a package will be pulled from the first repository listed by
pkg -vv *if* the versions are the same.   My thought was to use that to
prefer local packages compiled with custom options.  That would in theory
remove the need for annotations and make the repository preference
automatic.  The problem is that a newer version of a package will be pulled
from a repository later in the list of repositories, ignoring the
ordering.   That is not the desired behavior in cases where you need
specific options.  For example if you have a local package of postfix
compiled with mysql support you would not want the one from the FreeBSD
repository pulled in even if it is newer.   With the current way of
choosing which package to install, it seems like annotations are still
required.   That makes sorting the repositories less of an issue, though I
could still see wanting to prefer local repositories when available.

Did I read that pkg install/upgrade ignores version specifications and
always installs the newest version?   I can see times when you would want a
specific version.   This seems related (at least tangentially).   Pkg is
always choosing the newest package regardless of other factors.



> Repository data is downloaded and processed into a number of sqlite
> databases each named after the tag in the repo.conf -- it strikes me
> that imposing some preference ordering based on the repository tag at
> the point that data about available packages is pulled out of the repo
> databases would be a more robust approach.
>

I think using the file order makes sense and is easier to control.  In my
tests I was using numbers at the beginning of the file names to put the
repositories in the order I want them, regardless of name.


>         Cheers,
>
>         Matthew
>
>
> --
> Dr Matthew J Seaman MA, D.Phil.
> PGP: http://www.infracaninophile.co.uk/pgpkey
>
>
>


More information about the freebsd-questions mailing list