Created attachment 168317 [details] USE_PACKAGE_DEPENDS_REPO=yes support Attached patch implements USE_PACKAGE_DEPENDS_REPO=yes switch to install port dependencies (during build) using 'pkg install'
You can run pkg install devel/m4, it'll work, no need to go and get a pkgname, I think.
I see you're adding SU_CMD around, but you're not mentioning it in the patch description, any reason for it ?
(In reply to Mathieu Arnold from comment #1) Yes there is a reason to get pkgname and not origin: allow to install multiple variant of the same origin: think py27-bla py35-bla or if one the subpackages are for real implemented: bla-libs bla so we should everywhere stop relying on origin (yes I know poudrière for now still rely on origin)
(In reply to Baptiste Daroussin from comment #3) > (In reply to Mathieu Arnold from comment #1) > Yes there is a reason to get pkgname and not origin: allow to install > multiple variant of the same origin: think py27-bla py35-bla or if one the > subpackages are for real implemented: bla-libs bla > > so we should everywhere stop relying on origin (yes I know poudrière for now > still rely on origin) Yes, I thing is, we don't need pkgname, we already have pkgbase in there. My current work on this: https://github.com/mat813/freebsd-ports/compare/trunk...pkg-depends
pkgbase is ok but in any case one should test the version (compared to the one in ports) and the option (making sure the remote on as the same options sets used/activated as the port) before installing
Well, I assume that if someone wants to use distant packages, he doesn't care about version or options, he just wants it there.
(In reply to Mathieu Arnold from comment #2) Oh, yes, I also added SU_CMD support to fix non-root builds. I forgot to mention that in the initial submission.
On the other hand, if you already have a dependency of a package being installed with different options, it'll be reinstalled with the remote version, possibly breaking things locally.
*** Bug 198881 has been marked as a duplicate of this bug. ***
USE_PACKAGE_DEPENDS_REPO could not work, you could not know if the package you download have the right version, or options. The closest thing I can see is to run something along the lines of: pkg install -A `make missing`
@mat: I must disagree. I have found this option to be very useful for test building ports (without having to compile dependencies). This is effectively adding the "install from pkg repo" that poudriere does into the Ports Framework. To address the issues you raised: - Correct version: this risk is already in the Ports tree (i.e. if someone updates select ports in the tree - an "unsupported" state however). Also, given that the official repo is at most 7 days behind the Ports tree the risk is minimal. - Correct options: this risk is already in the Ports tree (i.e. unless you chose the correct options you are stuck with the defaults). The offical repo does ship with the default options, so for most uses it is fine. Also, testing that the port builds against the default options is not a bad thing. Please note that both the issues you raise are also an issue if the user simply "manually" installs the dependencies instead of building from ports. If this is a stopper for this feature then I submit that it is also a stopper for (a) USE_PACKAGE_DEPENDS and for building in a "dirty" environment (like many people do). Lastly, I contest the wording of "could". I have successfully used this option and I submit most use cases *will* work, although some use cases *may* not work.
Created attachment 186176 [details] Updated patch - run port build if "pkg install" fails
Thanks Max, I'm currently working off a laptop and this makes my life much easier.