From owner-freebsd-pkg@FreeBSD.ORG Wed Sep 24 03:20:33 2014 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BC4BD03; Wed, 24 Sep 2014 03:20:33 +0000 (UTC) Received: from astart2.astart.com (108-248-95-193.lightspeed.sndgca.sbcglobal.net [108.248.95.193]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 200261C7; Wed, 24 Sep 2014 03:20:31 +0000 (UTC) Received: from laptop_93.private (localhost [127.0.0.1]) by astart2.astart.com (8.14.4/8.14.4) with ESMTP id s8O3KNoU044664; Tue, 23 Sep 2014 20:20:23 -0700 (PDT) (envelope-from papowell@astart.com) Message-ID: <54223877.1000302@astart.com> Date: Tue, 23 Sep 2014 20:20:23 -0700 From: Patrick Powell Reply-To: papowell@astart.com Organization: Astart Technologies User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: freebsd-pkg@freebsd.org Subject: Suggestion on how to add search order to multiple reponsitories Content-Type: multipart/mixed; boundary="------------070901020907000709010302" Cc: FreeBSD Ports ML X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 03:20:33 -0000 This is a multi-part message in MIME format. --------------070901020907000709010302 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Currently there does not appear to be simple way to specify the order that repositories searched for packages, or at least there is none documented as such that I can find. Suppose we add a 'repo_order' field to the repository specification, i.e. - FreeBSDMyStuff: { URL: http://myserver/${ABI}/latest ENABLED: yes MIRROR_TYPE: SRV repo_order: 1 } FreeBSD: { URL: http://pkg.freebsd.org/${ABI}/latest ENABLED: yes MIRROR_TYPE: SRV repo_order: 2 } When doing a search for packages, the found/discovered packages would be sorted by the value of the order field. By default, if there is no value for the order field then this entry would come last. If there are two entries with no or the same order value then they would be sorted on the repo name, as is currently done. Also, when displaying repositories, i.e. - pkg -v -v, you would sort the display entries by the repo_order field as well. Just to jumpstart this effort I am attaching a set of patches for pkg-1.4.0.pre-alpha15. This implements the basic functionality to add repo_order to the repository definitions and adds support to display the repo_order when doing 'pkg search'. I would happy to add this ordering functionality to other parts of the pkg support, but I need a bit of help with the current code. From my understanding/reading/crystal ball gazing/looking at the code entrails, it appears that when doing a 'pkg install X' the X is first used to determine the set of packages in question. Once these have been determined there is a rather intimidating (recursive as well?) procedure which is used to determine any dependencies. Somewhere in this process there is a place where the listed/named repositories are searched for candidates for dependencies. It appears at a casual reading that the repositories are searched in the reverse order they were put in the reponsitory list and candidates found during the search are then added to the dependency list as they are found. This has the effect of having entries found in earlier listed repositories overwrite those found in later listed respositories (I thought this was VERY clever!). Rather than modify this code, I would suggest adding a 'repository ordering' step or routine. Just after the repositories are found/listed, the repository list should be sorted (stably) using the name and the repo_order field. That is, all of the repositories with a lower repo_order value would be moved ahead of those with lower repo_order values, while preserving the order for those with the same repo_order value. If this is done and the algorithm for searching the repositories is as I have outlined it, then you should get the desired repository priority effect. And perhaps no other code changes would be required. I hope. Perhaps. Maybe. --------------070901020907000709010302 Content-Type: text/plain; charset=us-ascii; name="patch-pkg-1.4.0.pre-alpha15" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="patch-pkg-1.4.0.pre-alpha15" KioqIHBrZy0xLjQuMC5wcmUtYWxwaGExNS9kb2NzL3BrZ19wcmludGYuMwlNb24gU2VwIDE1 IDEzOjE4OjI2IDIwMTQKLS0tIHBrZy0xLjQuMC5wcmUtYWxwaGExNS5vcmlnL2RvY3MvcGtn X3ByaW50Zi4zCVN1biB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MjAxNAotLS0gcGtnLTEuNC4wLnByZS1h bHBoYTE1Lm9yaWcvbGlicGtnL3BrZ19tYW5pZmVzdC5jCVN1biBTZXAgIDcgMjM6MjM6MjQg MjAxNAoqKioqKioqKioqKioqKioKKioqIDk5LDEwNSAqKioqCiAgCXsgIm9wdGlvbl9kZXNj cmlwdGlvbnMiLCBQS0dfT1BUSU9OX0RFU0NSSVBUSU9OUywgVUNMX09CSkVDVCwgcGtnX29i an0sCiAgCXsgIm9yaWdpbiIsICAgICAgICAgICAgICBQS0dfT1JJR0lOLCAgICAgICAgICAg ICAgVUNMX1NUUklORywgcGtnX3N0cmluZ30sCiAgCXsgInBhdGgiLCAgICAgICAgICAgICAg ICBQS0dfUkVQT1BBVEgsICAgICAgICAgICAgVUNMX1NUUklORywgcGtnX3N0cmluZ30sCi0g CXsgInJlcG9fb3JkZXIiLCAgICAgICAgICBQS0dfUkVQT19PUkRFUiwgICAgICAgICAgVUNM X0lOVCwgICAgcGtnX2ludH0sCiAgCXsgInJlcG9wYXRoIiwgICAgICAgICAgICBQS0dfUkVQ T1BBVEgsICAgICAgICAgICAgVUNMX1NUUklORywgcGtnX3N0cmluZ30sCiAgCXsgInBrZ3Np emUiLCAgICAgICAgICAgICBQS0dfUEtHU0laRSwgICAgICAgICAgICAgVUNMX0lOVCwgICAg cGtnX2ludH0sCiAgCXsgInByZWZpeCIsICAgICAgICAgICAgICBQS0dfUFJFRklYLCAgICAg ICAgICAgICAgVUNMX1NUUklORywgcGtnX3N0cmluZ30sCi0tLSA5OSwxMDQgLS0tLQoqKioq KioqKioqKioqKioKKioqIDg4Myw4ODggKioqKgotLS0gODgyLDg4OCAtLS0tCiAgCXVjbF9v YmplY3RfdCAqbWFwLCAqc2VxLCAqc3VibWFwOwogIAl1Y2xfb2JqZWN0X3QgKnRvcCA9IHVj bF9vYmplY3RfdHlwZWRfbmV3KFVDTF9PQkpFQ1QpOwogIAljb25zdCB1Y2xfb2JqZWN0X3Qg Km87CisgCWNvbnN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RlZmluZSBJTkZPX09QVElPTl9ERVNDUklQVElPTlMgKDFMTDw8 MjkpCiAgCiEgI2RlZmluZSBJTkZPX0xBU1RGSUVMRAlJTkZPX0xPQ0tFRAogICNkZWZpbmUg SU5GT19BTEwJKCgoSU5GT19MQVNURklFTEQpIDw8IDEpIC0gMSkKICAKICAvKiBJZGVudGlm eWluZyB0YWdzICovCioqKiBwa2ctMS40LjAucHJlLWFscGhhMTUvc3JjL3NlYXJjaC5jCU1v biBTZXAgMTUgMTI6MDg6MzggMjAxNAotLS0gcGtnLTEuNC4wLnByZS1hbHBoYTE1Lm9yaWcv c3JjL3NlYXJjaC5jCU1vbiBBdWcgIDQgMTQ6NTk6NDAgMjAxNAoqKioqKioqKioqKioqKioK KioqIDY5LDc1ICoqKioKICAJeyAib3B0aW9ucyIsICAgICAgICAgICAgICAnbycgIH0sCiAg CXsgInBrZy1zaXplIiwJICAgICAgICAgICdQJyAgfSwKICAJeyAicHJlZml4IiwgICAgICAg ICAgICAgICAncCcgIH0sCi0gCXsgInJlcG9fb3JkZXIiLCAgICAgICAgICAgJ1onICB9LAog IAl7ICJyZXBvc2l0b3J5IiwgICAgICAgICAgICdSJyAgfSwKICAJeyAicmVxdWlyZWQtYnki LCAgICAgICAgICAncicgIH0sCiAgCXsgInNoYXJlZC1saWJzLXJlcXVpcmVkIiwgJ0InICB9 LAotLS0gNjksNzQgLS0tLQoqKioqKioqKioqKioqKioKKioqIDE3NywxODUgKioqKgogIAlj YXNlICdvJzoKICAJCW9wdCA9IElORk9fT1BUSU9OUzsKICAJCWJyZWFrOwotIAljYXNlICda JzoKLSAJCW9wdCA9IElORk9fUkVQT19PUkRFUjsKLSAJCWJyZWFrOwogIAljYXNlICdQJzoK ICAJCW9wdCA9IElORk9fUEtHU0laRTsKICAJCWJyZWFrOwotLS0gMTc2LDE4MSAtLS0tCioq KioqKioqKioqKioqKgoqKiogMjEyLDIxOCAqKioqCiAgCQlicmVhazsKICAJZGVmYXVsdDoK ICAJCXV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