* [ptxdist] How to express a dependency that can be satisfied by alternative packages @ 2019-12-16 18:23 Guillermo Rodriguez Garcia 2020-01-02 11:53 ` Roland Hieber 0 siblings, 1 reply; 6+ messages in thread From: Guillermo Rodriguez Garcia @ 2019-12-16 18:23 UTC (permalink / raw) To: ptxdist Hi all, Let's say I have a package that requires a specific cmd line utility (e.g. openvt). This can be provided by two different packages (e.g. busybox or kbd) How to express that dependency in the .in file of my package ? Thanks, Guillermo Rodriguez Garcia guille.rodriguez@gmail.com _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] How to express a dependency that can be satisfied by alternative packages 2019-12-16 18:23 [ptxdist] How to express a dependency that can be satisfied by alternative packages Guillermo Rodriguez Garcia @ 2020-01-02 11:53 ` Roland Hieber 2020-01-02 15:15 ` Michael Olbrich 0 siblings, 1 reply; 6+ messages in thread From: Roland Hieber @ 2020-01-02 11:53 UTC (permalink / raw) To: Guillermo Rodriguez Garcia; +Cc: ptxdist On Mon, Dec 16, 2019 at 07:23:13PM +0100, Guillermo Rodriguez Garcia wrote: > Hi all, > > Let's say I have a package that requires a specific cmd line utility > (e.g. openvt). > This can be provided by two different packages (e.g. busybox or kbd) > How to express that dependency in the .in file of my package ? PTXdist (or rather kconfig) does not have a notion of "provides" or metapackages. I think is currently no way other than making a choice option that selects the one or the other, or letting your config option deoend on BUSYBOX_OPENVT || KBD_OPENVT. In the latter case it is probably good to add a comment above it that depends on the opposite value notifying the user that neither one of them is selected (see the comment above IPTABLES_INSTALL_IPTABLES_APPLY in iptables.in for example). - Roland -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] How to express a dependency that can be satisfied by alternative packages 2020-01-02 11:53 ` Roland Hieber @ 2020-01-02 15:15 ` Michael Olbrich 2020-01-07 11:11 ` Guillermo Rodriguez Garcia 0 siblings, 1 reply; 6+ messages in thread From: Michael Olbrich @ 2020-01-02 15:15 UTC (permalink / raw) To: ptxdist Hi, On Thu, Jan 02, 2020 at 12:53:36PM +0100, Roland Hieber wrote: > On Mon, Dec 16, 2019 at 07:23:13PM +0100, Guillermo Rodriguez Garcia wrote: > > Let's say I have a package that requires a specific cmd line utility > > (e.g. openvt). > > This can be provided by two different packages (e.g. busybox or kbd) > > How to express that dependency in the .in file of my package ? > > PTXdist (or rather kconfig) does not have a notion of "provides" or > metapackages. I think is currently no way other than making a choice > option that selects the one or the other, or letting your config option > deoend on BUSYBOX_OPENVT || KBD_OPENVT. In the latter case it is > probably good to add a comment above it that depends on the opposite > value notifying the user that neither one of them is selected (see the > comment above IPTABLES_INSTALL_IPTABLES_APPLY in iptables.in for > example). Actually, the correct way to do this is probably: select KBD if !BUSYBOX_OPENVT && RUNTIME select KBD_OPENVT if !BUSYBOX_OPENVT && RUNTIME rules/openvpn.in or rules/easy-rsa.in already do something like this. Using 'depends' is not really a good idea. It hides options and can cause Dependency Chains that cannot be resolved automatically. Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] How to express a dependency that can be satisfied by alternative packages 2020-01-02 15:15 ` Michael Olbrich @ 2020-01-07 11:11 ` Guillermo Rodriguez Garcia 2020-01-07 11:29 ` Michael Olbrich 0 siblings, 1 reply; 6+ messages in thread From: Guillermo Rodriguez Garcia @ 2020-01-07 11:11 UTC (permalink / raw) To: ptxdist El jue., 2 ene. 2020 a las 16:15, Michael Olbrich (<m.olbrich@pengutronix.de>) escribió: > > Hi, > > On Thu, Jan 02, 2020 at 12:53:36PM +0100, Roland Hieber wrote: > > On Mon, Dec 16, 2019 at 07:23:13PM +0100, Guillermo Rodriguez Garcia wrote: > > > Let's say I have a package that requires a specific cmd line utility > > > (e.g. openvt). > > > This can be provided by two different packages (e.g. busybox or kbd) > > > How to express that dependency in the .in file of my package ? > > > > PTXdist (or rather kconfig) does not have a notion of "provides" or > > metapackages. I think is currently no way other than making a choice > > option that selects the one or the other, or letting your config option > > deoend on BUSYBOX_OPENVT || KBD_OPENVT. In the latter case it is > > probably good to add a comment above it that depends on the opposite > > value notifying the user that neither one of them is selected (see the > > comment above IPTABLES_INSTALL_IPTABLES_APPLY in iptables.in for > > example). > > Actually, the correct way to do this is probably: > > select KBD if !BUSYBOX_OPENVT && RUNTIME > select KBD_OPENVT if !BUSYBOX_OPENVT && RUNTIME What is exactly the meaning of RUNTIME? Why is it needed here? Apart from that. What about the following: select KBD if !BUSYBOX select KBD_OPENVT if !BUSYBOX select BUSYBOX_OPENVT if BUSYBOX && !KBD_OPENVT This would prefer the Busybox version of openvt if none is explicitly selected and Busybox is already present (thus avoiding to pull in the kbd package if we can avoid it) Best, Guillermo Rodriguez Garcia guille.rodriguez@gmail.com _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] How to express a dependency that can be satisfied by alternative packages 2020-01-07 11:11 ` Guillermo Rodriguez Garcia @ 2020-01-07 11:29 ` Michael Olbrich 2020-01-07 15:21 ` Guillermo Rodriguez Garcia 0 siblings, 1 reply; 6+ messages in thread From: Michael Olbrich @ 2020-01-07 11:29 UTC (permalink / raw) To: ptxdist On Tue, Jan 07, 2020 at 12:11:19PM +0100, Guillermo Rodriguez Garcia wrote: > El jue., 2 ene. 2020 a las 16:15, Michael Olbrich > (<m.olbrich@pengutronix.de>) escribió: > > On Thu, Jan 02, 2020 at 12:53:36PM +0100, Roland Hieber wrote: > > > On Mon, Dec 16, 2019 at 07:23:13PM +0100, Guillermo Rodriguez Garcia wrote: > > > > Let's say I have a package that requires a specific cmd line utility > > > > (e.g. openvt). > > > > This can be provided by two different packages (e.g. busybox or kbd) > > > > How to express that dependency in the .in file of my package ? > > > > > > PTXdist (or rather kconfig) does not have a notion of "provides" or > > > metapackages. I think is currently no way other than making a choice > > > option that selects the one or the other, or letting your config option > > > deoend on BUSYBOX_OPENVT || KBD_OPENVT. In the latter case it is > > > probably good to add a comment above it that depends on the opposite > > > value notifying the user that neither one of them is selected (see the > > > comment above IPTABLES_INSTALL_IPTABLES_APPLY in iptables.in for > > > example). > > > > Actually, the correct way to do this is probably: > > > > select KBD if !BUSYBOX_OPENVT && RUNTIME > > select KBD_OPENVT if !BUSYBOX_OPENVT && RUNTIME > > What is exactly the meaning of RUNTIME? Why is it needed here? This means, that kbd is only needed at runtime and not at buildtime. This relaxes the build dependencies a bit and allows more parallelization. It's really only needed for the first line, but we add it to both for consistency reasons. > Apart from that. What about the following: > > select KBD if !BUSYBOX > select KBD_OPENVT if !BUSYBOX > select BUSYBOX_OPENVT if BUSYBOX && !KBD_OPENVT > > This would prefer the Busybox version of openvt if none is explicitly > selected and Busybox is already present (thus avoiding to pull in the > kbd package if we can avoid it) Does that work? kconfig sometimes produces circular dependency errors, even if they don't really exist. If it works, then that's ok too (with the '&& RUNTIME' added). Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] How to express a dependency that can be satisfied by alternative packages 2020-01-07 11:29 ` Michael Olbrich @ 2020-01-07 15:21 ` Guillermo Rodriguez Garcia 0 siblings, 0 replies; 6+ messages in thread From: Guillermo Rodriguez Garcia @ 2020-01-07 15:21 UTC (permalink / raw) To: ptxdist El mar., 7 ene. 2020 a las 12:29, Michael Olbrich (<m.olbrich@pengutronix.de>) escribió: > > On Tue, Jan 07, 2020 at 12:11:19PM +0100, Guillermo Rodriguez Garcia wrote: > > El jue., 2 ene. 2020 a las 16:15, Michael Olbrich > > (<m.olbrich@pengutronix.de>) escribió: > > > On Thu, Jan 02, 2020 at 12:53:36PM +0100, Roland Hieber wrote: > > > > On Mon, Dec 16, 2019 at 07:23:13PM +0100, Guillermo Rodriguez Garcia wrote: > > > > > Let's say I have a package that requires a specific cmd line utility > > > > > (e.g. openvt). > > > > > This can be provided by two different packages (e.g. busybox or kbd) > > > > > How to express that dependency in the .in file of my package ? > > > > > > > > PTXdist (or rather kconfig) does not have a notion of "provides" or > > > > metapackages. I think is currently no way other than making a choice > > > > option that selects the one or the other, or letting your config option > > > > deoend on BUSYBOX_OPENVT || KBD_OPENVT. In the latter case it is > > > > probably good to add a comment above it that depends on the opposite > > > > value notifying the user that neither one of them is selected (see the > > > > comment above IPTABLES_INSTALL_IPTABLES_APPLY in iptables.in for > > > > example). > > > > > > Actually, the correct way to do this is probably: > > > > > > select KBD if !BUSYBOX_OPENVT && RUNTIME > > > select KBD_OPENVT if !BUSYBOX_OPENVT && RUNTIME > > > > What is exactly the meaning of RUNTIME? Why is it needed here? > > This means, that kbd is only needed at runtime and not at buildtime. This > relaxes the build dependencies a bit and allows more parallelization. > It's really only needed for the first line, but we add it to both for > consistency reasons. > > > Apart from that. What about the following: > > > > select KBD if !BUSYBOX > > select KBD_OPENVT if !BUSYBOX > > select BUSYBOX_OPENVT if BUSYBOX && !KBD_OPENVT > > > > This would prefer the Busybox version of openvt if none is explicitly > > selected and Busybox is already present (thus avoiding to pull in the > > kbd package if we can avoid it) > > Does that work? kconfig sometimes produces circular dependency errors, even > if they don't really exist. > If it works, then that's ok too (with the '&& RUNTIME' added). Uhm, indeed Kconfig complains. What would then be the way to achieve this: - If busybox is selected, then select BUSYBOX_OPENVT, unless KBD_OPENVT is already selected - If busybox is NOT selected, then select KBD_OPENVT ? The closest I've got is this: select KBD if !BUSYBOX select KBD_OPENVT if !BUSYBOX select BUSYBOX_OPENVT if BUSYBOX But this will end up selecting both versions of openvt if KBD_OPENVT was already selected... Guillermo -- Guillermo Rodriguez Garcia guille.rodriguez@gmail.com _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-01-07 15:22 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-12-16 18:23 [ptxdist] How to express a dependency that can be satisfied by alternative packages Guillermo Rodriguez Garcia 2020-01-02 11:53 ` Roland Hieber 2020-01-02 15:15 ` Michael Olbrich 2020-01-07 11:11 ` Guillermo Rodriguez Garcia 2020-01-07 11:29 ` Michael Olbrich 2020-01-07 15:21 ` Guillermo Rodriguez Garcia
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox