-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: OR or XOR switches for depends_on stanzas #26345
Comments
To me, that reads like “and”, not “or”. Your other suggestion I find confusing, and you’re right the first one is closer to what we get, so it makes more sense. I have no objection to this feature (even if the syntax needs further thought), but I would also put it as very low priority. It’s not very common for this case to happen, so I question the validity of spending time on it. Thank you for the detailed feature request, either way we end up deciding. |
It was just a pass (and why I had the commnt about requiring an The first is just a 'stanza' translation from:
I can see that looking like logical "and" but it is implemented as logical "or" for The other/second was an "attempt" at being less obtuse/more explicit in what was going on that one was a cask and the other a formula. |
So, I'm going to dredge this up as the db-forking seems to be causing problems: and while the problem is likely actually unrelated unless |
We already have a solution to this problem: |
This isn’t problematic enough (very few casks would benefit) and there seems to be not enough interest in implementing this, so closing as part of issues cleanup. |
Description of feature/enhancement
Justification
There are casks that can work with multiple casks or brewed formulas which provide the same functionality and often the same named binary. This came up a very long time ago with #2001; and I am even going to use
sshfs
as the example.Homebrew allows for arrays and switched , but the only array I can find in the docs:
https://github.com/caskroom/homebrew-cask/tree/master/doc
is for
depends_on macos: ['10.9', '10.10’]
I can't seem to find any other arrays or switches.
Really I think the depends_on should be some sort of pseudocode like:
depends_on: [formula: 'homebrew/science/r', cask: 'r-gui']
or
I just updated #26340, so r is on my mind.
is this functionality implemented but not documented; eg, am I missing something?
Example use case
The example given at depends_on doc is
sshfs
which could depend (until very recently) onosxfuse
orFuse4x
and their are other places where someone may choose a binary/cask rather than a formula. I know this has been discussed.Similar issues:
--flags on formula
#8784depends_on :cask
follow-ups #8492using
depends_on
for intra-Cask dependencies and metapackages #2001Feature request: XOR with depends_on #19369
Possible solution condition statement or array:
The real crux is very similar to (though not NEARLY as complicated as):
Stanzas in conditional statements #14333
In the example of the package I bumped today
r-studio
#26340;/applications/R.app
is not an option inhomebrew/science/r
as there is no--with-bundle
flag, so many choose to install bothhomebrew/science/r-gui
as well; note, these do NOT conflict; thoughr-gui
makesbrew doctor
very very upset. However both provide a "functional"r
binary. With the way I see stanzadepends_on:
is written now; I had to usedepends_on formula: 'homebrew/science/r'
Is there an undocumented way to use conditionals with depends_on:? I tried some hacks with
==>
and arrays[..,..]
but thought merging to get everyone to stable (no less 1.0 finally) was worth more than me blindly throwing similar conditionals at the formula.So my proposed solution would be something like we use for
depends_on macos:
or a ruby ORChange
depends_on
to be something like this pseudocode:depends_on: [formula: 'homebrew/science/r', cask: 'r-gui']
or
Since the first is already implemented for
depends_on macos:
I think it would be the path of least resistance to implementation while also not break anything currently written, and making the tests just check for what they already do on the os stanza.The text was updated successfully, but these errors were encountered: