pkg
pkg copied to clipboard
Recent changes to repo.conf handling have broken the '-r' functionality for search, etc.
pkg search -r reponame should work against any reponame known in repo.conf files even if marked as enabled: no. Recent changes completely hide the presence of disabled repos.
Ah, yes, I wanted to be able to use -r working even if the repo was disabled today, and ended up here 😪
Fixed
I'm sorry, but this isn't fixed at all. You still can't use '-r' to override the enabled flag in pkg.conf, which used to work just fine.
maggot:~/src/pkgng:% cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: { enabled: no }
maggot:~/src/pkgng:% pkg search -r FreeBSD -x pkg
maggot:~/src/pkgng:%
The following seems to help:
--- libpkg/pkgdb.c.orig 2022-12-11 18:22:41 UTC
+++ libpkg/pkgdb.c
@@ -825,7 +825,7 @@ pkgdb_open_repos(struct pkgdb *db, const char *reponam
struct pkg_repo *r = NULL;
while (pkg_repos(&r) == EPKG_OK) {
- if (!r->enable) {
+ if (!r->enable && reponame == NULL) {
continue;
}