Skip to content
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

WIP: multiple URLs per Cask #3043

Closed
wants to merge 1 commit into from

Conversation

rolandwalker
Copy link
Contributor

  • Work-in-progress because there are no docs/tests at present. Some current tests fail.
  • Permits url stanza to be repeated multiple times
  • checksum keys such as :sha256 may be appended to each url
  • :target may be appended to url to specify a target download name,
    with special value :basename indicating the basename extracted from the URL
  • :multipart => true may be appended to url to indicate assets which will
    not be subjected to container analysis or explicit unarchiving. :multipart
    may not be the best name for that. :fetch_only ?

@rolandwalker
Copy link
Contributor Author

Cask ridibooks.rb can be simplified after this PR is merged, by setting a :target filename ending in .pkg.

- Work-in-progress because there are no docs/tests at present.  Some current tests fail.
- Permits `url` stanza to be repeated multiple times
- checksum keys such as `:sha256` may be appended to each `url`
- `:target` may be appended to `url` to specify a target download name,
  with special value `:basename` indicating the basename extracted from the URL
- `:multipart => true` may be appended to `url` to indicate assets which will
  not be subjected to container analysis or explicit unarchiving.  `:multipart`
  may not be the best name for that. `:fetch_only` ?
@rolandwalker
Copy link
Contributor Author

Cask git-annex.rb can be simplified after this PR is merged, by setting a :target filename ending in .dmg.bz2.

@rafaelrinaldi
Copy link
Contributor

@rolandwalker The idea is interesting but I would prefer something that allows one to compose the formula's URL by given parameters.

So I would have something like:
"http://foo.com/bar/{{os}}/{{branch}}.dmg"

And then:
brew cask install my-formula --os=mac --branch=3.1

Not sure if there's already a way of doing what I've purposed, just making a comment on something I was just wondering and want to hear your thoughts on that.

@rolandwalker
Copy link
Contributor Author

@rafaelrinaldi , I'm interested in all the possibilities! Your proposal sounds useful in several contexts.

The PR where we are having this discussion was intended more for cases like distributions which logically belong together but happen to comprise multiple URLs. Examples: Multi-file RAR archives, Font families. So I hadn't thought about CLI flags to select only a subset in this context.

However, we definitely plan on doing something along the lines of #2657 which brought you here (and would have already if we had more coders and more time). That form would very naturally match up with the CLI flags you propose:

  localization('cn') do
    <cask elements>
  end
  os_version('10.8') do
    <cask elements>
  end

and then

$ brew cask install my-formula --os_version=10.8

However, as I said above the string interpolation you describe can also be useful. And to an extent, it is available now, though

  • you must use double-quoted strings
  • you must have special knowledge about what is available for substitution
  • there is no CLI for selection
    But this does already work
  url "http://foo.com/bar/#{MacOS.version}/image.dmg"

@rolandwalker rolandwalker mentioned this pull request Jun 3, 2014
@rolandwalker rolandwalker mentioned this pull request Aug 7, 2014
9 tasks
@rolandwalker rolandwalker added the core Issue with Homebrew itself rather than with a specific cask. label Oct 17, 2014
@pawcik pawcik mentioned this pull request Dec 15, 2014
@jawshooah jawshooah self-assigned this Dec 17, 2015
@jawshooah
Copy link
Contributor

There's a lot going on in this PR, but I think we can split it up and salvage the parts we think are still useful.

In particular, the :target modifier for url is very attractive, and would likely simplify, or completely obviate the need for, preflight blocks in several casks.

@vitorgalvao
Copy link
Member

In particular, the :target modifier for url is very attractive, and would likely simplify, or completely obviate the need for, preflight blocks in several casks.

I also see that as an attractive feature. More specifically, the only attractive feature.

Multiple urls and the other options like :multipart/:fetch_only are exactly the type of complicated additions I’d like to avoid. Such a scheme becomes convoluted in a DSL like ours, and would be much better suited for a descriptive installation process:

I do think that having a more descriptive installation process could do wonders for us. How far we need to go with this, I still do not know, but again, like #13201 (yes, the ideas for these two are very closely connected), this could alleviate some other burdens like how we create shim scripts, the aforementioned *flight stanzas, and even the old #142, which homebrew can already do to an extent (and which would let us get rid of so many dirty parts of caskroom/versions).

@jawshooah
Copy link
Contributor

Closing for lack of interest, and because the implementation is vastly out of date at this point.

@jawshooah jawshooah closed this Oct 17, 2016
@miccal miccal removed core Issue with Homebrew itself rather than with a specific cask. enhancement labels Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants