Problem with custom pkg repository

Hi, at my company we created a custom pkg repository for our apps. This way, we can install all pkgs from the standard repository and our own applications using pkg install ...

However, as one of our applications depends on dcmtk-3.6.9 and in https://pkg.freebsd.org/FreeBSD:15:amd64 that package was upgraded to 3.7.0, we thought adding the dcmtk-3.6.9 pkg compiled by us in our own custom repo will work, but it doesn't. Our logic is, if the package was found on one of the two repositories configued on the system it should be allowed to install using pkg install dcmtk-3.6.9, but not, it tries to install 3.7.0

Our workaround was renaming it to dcmtkcustom-3.6.9, but I don't like that.

Any explanation about why we can't do what we want?.
 
Hi, at my company we created a custom pkg repository for our apps. This way, we can install all pkgs from the standard repository and our own applications using pkg install ...

However, as one of our applications depends on dcmtk-3.6.9 and in https://pkg.freebsd.org/FreeBSD:15:amd64 that package was upgraded to 3.7.0, we thought adding the dcmtk-3.6.9 pkg compiled by us in our own custom repo will work, but it doesn't. Our logic is, if the package was found on one of the two repositories configued on the system it should be allowed to install using pkg install dcmtk-3.6.9, but not, it tries to install 3.7.0

Our workaround was renaming it to dcmtkcustom-3.6.9, but I don't like that.

Any explanation about why we can't do what we want?.
pkg add - install a package from local source or a remote one...

man pkg
 
Our logic is, if the package was found on one of the two repositories configued on the system it should be allowed to install using pkg install dcmtk-3.6.9, but not, it tries to install 3.7.0

Any explanation about why we can't do what we want?.

Yes. pkg-install(8) will install the latest version it can find, 3.7.0 is newer than 3.6.9, so that's the one that gets picked. That is, if used as pkg install dcmtk. With pkg install dcmtk-3.6.9 it should install that 3.6.9 version specifically. But, care must be taken with other packages that depend on dcmtk, and specifically the 3.7.0 version of it. Installing any of those would automagically 'upgrade' dcmtk. Also any pkg-upgrade(8) will get you the latest version too.

Maybe look at this the other way, why is dcmtk in that first repository? Is there any way you could remove the dependency there? Another option is to simply reverse the commit that updated dcmtk and have it just build 3.6.9 while keeping everything else updated.
 
If you have configuration for your local repo, i.e., with the repository name "custom", you can force it to be used with pkg upgrade -r custom.
You can still do a dry-run by adding -n option to see what should happen as usual.
 
In your package that has a dependency on dcmtk-3.6.9, edit its Makefile to force that version dependency. If your package server is fed by Poudriere, configure it to keep old versions that way older versions will still be available even when newer ones are built.

See section 5.10.8 in
 
Back
Top