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

pkg-bootstrap doesn't fall through to lower-priority repos #2423

Open
rincorvid opened this issue Feb 21, 2025 · 1 comment
Open

pkg-bootstrap doesn't fall through to lower-priority repos #2423

rincorvid opened this issue Feb 21, 2025 · 1 comment

Comments

@rincorvid
Copy link

rincorvid commented Feb 21, 2025

I have a local repo with higher priority than the public one. When I run pkg bootstrap on 13.4-p4, I get this error:

[root@base-13_4 ~]# pkg bootstrap -y
Bootstrapping pkg from file:///var/db/pkgrepo/repos/FreeBSD:13:amd64/latest, please wait...
pkg: Error fetching file:///var/db/pkgrepo/repos/FreeBSD:13:amd64/latest/Latest/pkg.txz: No such file or directory
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.

Things that work around this:

  • grabbing a copy of the pkg pkg, adding it to my repo, and symlinking Latest/pkg.txz to it;
  • adding -r FreeBSD to the command.

Normally, pkg will seemlessly fall through to the public repo for anything I don't have locally. Why doesn't pkg-bootstrap do the same?

@rincorvid
Copy link
Author

rincorvid commented Feb 21, 2025

My C is a bit rusty, but I think this diff between 13-STABLE and -CURRENT says it's already been fixed?

# git diff b5ae765d8244..HEAD usr.sbin/pkg/pkg.c
[very long diff trimmed]
@@ -1261,7 +1247,12 @@ main(int argc, char *argv[])
                        if (pkg_query_yes_no() == 0)
                                exit(EXIT_FAILURE);
                }
-               if (bootstrap_pkg(force, fetchOpts) != 0)
+               repositories = config_get_repositories();
+               STAILQ_FOREACH(repo, repositories, next) {
+                       if ((ret = bootstrap_pkg(force, fetchOpts, repo)) == 0)
+                               break;
+               }
+               if (ret != 0)

If so, can this be MFC'd?

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

1 participant