Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 2014 20:02:03 -0500
From:      Dan Lists <lists.dan@gmail.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Repository Search Order
Message-ID:  <CAPW8bZ3tnUk_FhR5oS-p7K-Cy3kY1rL8YDzdK11O860tjfcjpw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
man pkg.conf states:

     Repositories are prioritized in the order they are found on the
REPOS_DIR
     search path, with individual repository configuration files in the same
     directory processed in alphabetical order.  Earlier files take prece-
     dence, meaning that packages will be downloaded from them
preferentially
     where the same package is available from several repositories.

This is not true, but I would like it to be.

# ls /usr/local/etc/pkg/repos/
00_Local.conf  80_zzz.conf    90_fff.conf    99_mmm.conf    FreeBSD.conf

So the order should be local, zzz, fff, mmm.

Repositories:
  mmm: {
    url             : "http://some.dom/freebsd:8:x86:64/mmm",
    enabled         : yes
  }
  fff: {
    url             : "http://some.dom/freebsd:8:x86:64/fff",
    enabled         : yes
  }
  local: {
    url             : "file:///usr/ports/packages",
    enabled         : yes
  }
  zzz: {
    url             : "http://some.dom/freebsd:8:x86:64/zzz",
    enabled         : yes
  }

The order has no relation to alphabetical order at all.   Interestingly, if
I use find (unsorted), it matches the repository order!

# find /usr/local/etc/pkg/repos
/usr/local/etc/pkg/repos
/usr/local/etc/pkg/repos/FreeBSD.conf
/usr/local/etc/pkg/repos/99_mmm.conf
/usr/local/etc/pkg/repos/90_fff.conf
/usr/local/etc/pkg/repos/00_Local.conf
/usr/local/etc/pkg/repos/80_zzz.conf

I quick look at the source shows that load_repo_files is just reading the
files in the order they are in the directory table:

        while ((ent = readdir(d))) {
        ...
        }

Can we get the repo config files sorted like the docs say?



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