If you have the opam repository repo cloned locally, you can add it as a local repository (via opam repo add <name> <path-to-repo>), and then try opam install-ing the latest version of your repo to have opam try and download and install the package for you.
Are there some required steps to make the new repo work? Do I have to make a new switch?
I clone my opam repository locally and add it to the opam repo.
I add some new versions for some packages, however opam update, opam upgrade, opam info, opam install <pkg> seems to ignore my repo. I even tried removing the default one but it still doesn’t work.
$ opam repo list 03:14:12
[NOTE] These are the repositories in use by the current switch. Use '--all' to see all configured repositories.
<><> Repository configuration for switch 4.12.0.many ><><><><><><><><><><><><><>
1 devel git+file:///home/exx/code/opam-repository
Make sure your new versions are actually part of your local repository, i.e., git add the files and git commit them (on the master branch, unless otherwise specified). Otherwise, Opam will just ignore them.
Do you mean the opam file is in the archive? This may not work in my case. The archive is the source code provided by others e.g. llvm. which I can not put the files (opam, install, patches) I would like to test in it.