Generically, the URL would be
http(s)://<repo>/[<subrepo>/]<name>-<version>_<revision>.<arch>.xbps with an accompanying .xbps.sig file from the same location.
Say you’re on x86_64, glibc using repo.voidlinux.eu as your repository. When you
xbps-query the packagename “opera” (a nonfree package) it would list the repository as
https:repo.voidlinux.eu/current/nonfree (which actually includes the subrepo, “nonfree”)
Name/version/rev string can be found in “pkgver”, in this case
Putting it together, you would build this:
When you use the -R flag, you’re querying the remote repodata, and can also specify a --repository instead of whatever you have configured. If you query a package you already have installed without the -R flag, it will tell you where you got the currently installed version.
EDIT: note that for musl, the repo would usually be
some.server/current/musl followed by a subrepo if the package was from one…