From owner-freebsd-questions@FreeBSD.ORG Sat Sep 13 01:02:05 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25270F97 for ; Sat, 13 Sep 2014 01:02:05 +0000 (UTC) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD0AD25C for ; Sat, 13 Sep 2014 01:02:04 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id i17so1646623qcy.10 for ; Fri, 12 Sep 2014 18:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=j60jA2QmMo8H2XbpxB/FPjEBKwwf9b/TKO0czF20MdY=; b=Q6uzmHQhi52+TP9j7lItJCWPmd5fCKkyhoFT4naWpvrJe/0PEKI9UWDbE/8xq9L35z A4LxZW6E/KQcUelklaeom+Hr4BVPJRqPL/N8xiiz/0GgqBCoTZ/CmpKvfGdFxqbgzA97 bx3L3QEu5pFh0XVHWpdJs3ykfcZdI5lIM6MSQoqYWG0jSJsdJ6ogYthPZZeeCb/HMAoP nm6bOdChsWF8LB0tUg0sMo0m/6s9r+pvxmal5uxjZZeWoYsh6TOrmGurG8wbMi2ErD+0 SLU3NFUOfdyzplvArpLCapjK1hu6Lyg/3YWrij/zMlyOH/zzzsy+1DaoIsTktzzUNR2I vmJQ== MIME-Version: 1.0 X-Received: by 10.224.5.1 with SMTP id 1mr17909839qat.30.1410570123804; Fri, 12 Sep 2014 18:02:03 -0700 (PDT) Received: by 10.224.10.198 with HTTP; Fri, 12 Sep 2014 18:02:03 -0700 (PDT) Date: Fri, 12 Sep 2014 20:02:03 -0500 Message-ID: Subject: Repository Search Order From: Dan Lists To: freebsd-questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 01:02:05 -0000 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?