Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

there is no way to impose order on repositories #632

Closed
avg-I opened this issue Nov 1, 2013 · 6 comments
Closed

there is no way to impose order on repositories #632

avg-I opened this issue Nov 1, 2013 · 6 comments

Comments

@avg-I
Copy link
Member

avg-I commented Nov 1, 2013

The ability to order repositories is probably not required by anything in pkg design. But this feature nevertheless could be useful for performance and administrative reasons as well as working around bugs.
Right now the remote repository databases are attached in pkgdb_open_multirepos using pkg_repos for iteration, where pkg_repos is essentially HASH_NEXT, so it does not provide any meaningful inherent order.

On the other hand, sql_on_all_attached_db uses "PRAGMA database_list;" to get list of attached databases. The pragma lists databases in the same order as they were attached.

So basically the order of attachment is propagated to order of subsequent multirepository queries.

It would be nice if the repositories were effectively sorted by some meaningful property like their name or order within a configuration file or anything else that is controllable by a user.

@bapt
Copy link
Member

bapt commented Nov 5, 2013

This order in the one they are would in configuration files, for example /usr/local/etc/pkg/repos/01.conf will be read before /usr/local/etc/pkg/repos/02.conf

the same way the first entry in /usr/local/etc/pkg/repos/01.conf will be read before the others etc.

@avg-I
Copy link
Member Author

avg-I commented Nov 5, 2013

I respectfully disagree.
Could you please explain how the order you described is enforced in the context of the functions that I mentioned -- pkgdb_open_multirepos and sql_on_all_attached_db ?

@mwisnicki
Copy link

Ordering by file/repository name does not seem to work. On fresh install of FreeBSD-10.0 there is one repository: /etc/pkg/FreeBSD.conf (pointing to /latest/). Since this repo is usually in half-broken state (many packages missing) I've tried supplementing it with /quarterly/ and /release/0/.

Unfortunately, no matter which names are used the order always matches that of ls -f /etc/pkg (i.e. unsorted). So to control order one has to move all files away from /etc/pkg and move them back in desired order.

@mwisnicki
Copy link

Another thing I've noticed: contrary to pkg-repository(5), search order does not match that of pkg -vv.

I have 3 repos in this order: latest, quarterly, release. pkg install obconf proposes to install from release despite the fact that both latest and quarterly contain same version of obconf and it's important to pick latest since it could've been built with newer dependencies.

@andrejzverev
Copy link
Contributor

does it still issue? We now have priority for repository as mention in pkg.conf(5)

@bapt
Copy link
Member

bapt commented Jan 15, 2015

fixed

@bapt bapt closed this as completed Jan 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants