Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Add eXist-db.app 3.0 (nightly build) #3067

Merged
merged 2 commits into from
Dec 29, 2016
Merged

Add eXist-db.app 3.0 (nightly build) #3067

merged 2 commits into from
Dec 29, 2016

Conversation

joewiz
Copy link
Contributor

@joewiz joewiz commented Dec 27, 2016

After making all changes to the cask:

  • brew cask audit --download {{cask_file}} is error-free.
  • brew cask style --fix {{cask_file}} reports no offenses.
  • The commit message includes the cask’s name and version.

Additionally, if adding a new cask:

sha256 :no_check

# static.adamretter.org.uk/exist-nightly was verified as official when first introduced to the cask
url do
Copy link
Member

@vitorgalvao vitorgalvao Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s not really the purpose of url do, and users do prefer versioned builds (which this has) over latest.

That said, up-to-date nightlies with no sha256 are more useful than out-of-date nightlies, so I don’t really have an issue with this regarding nightlies only.

But since this isn’t something we usually do, I’d like some further input from @caskroom/maintainers. I’ve 👍 my own post to show agreement and we can easily count it, if you prefer that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vitorgalvao Thank you for your review and for taking the time to explain this principle. If this PR is good for you and the other maintainers, accepting this PR would be a real help to our community. Thanks in advance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be OK, imo - could be an exception for the -versions repo only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not familiar with ruby - are those two requires inbuilt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those two requires inbuilt?

@adidalal Good catch! While open-uri is built into the system Ruby, nokogiri appears not to.

The dependency on nokogiri needs to go; luckily, we’ve had ad-hoc workarounds in the past where regular expressions did that particular job well.

(Yes, the audacity formula did break often, albeit for unrelated reasons. And no: regular expressions are not a valid general-purpose solution.)

@joewiz
Copy link
Contributor Author

joewiz commented Dec 28, 2016

Okay, I'll adapt the cask to remove Nokogiri. I will work with the creator of the nightly site to pre-sort the entries so the newest is consistently on top.

@claui
Copy link
Contributor

claui commented Dec 28, 2016

@joewiz That’s a good point; I agree it’d be best to have the source reliably sorted.

In case we cannot have this for whatever reason, something like

latest_build_filename = open(builds_url) do |io|
  io.read.scan(/<tr>.*?<td>(.*?)<\/td>.*?<a href="([^\"]+)">dmg/m).max[1]
end

might do the trick for unsorted entries.

Edit: of course it’s io.read.scan, not io.scan.

@joewiz
Copy link
Contributor Author

joewiz commented Dec 28, 2016

Thanks, Claudia! Unfortunately the order of the rows in the table is random, so until the nightly server fixes the ordering problem (I've already reached out), some date sorting is needed. Or is there a way to do this via regex? At worst, we should be able to fix this server side before long.

@claui
Copy link
Contributor

claui commented Dec 28, 2016

@joewiz If you run the example code, you’re going to discover it already takes care of the sorting.

String#scan (in its non-block form) returns an array of date-URL pairs.

To pick the pair with the most recent date, the max call is already sufficient. You can remove the [1] temporarily to inspect the result.

@joewiz
Copy link
Contributor Author

joewiz commented Dec 29, 2016

@claui Now I see! Thanks so much for this great suggestion! Revised PR to come shortly.

- Replaced nokogiri with io.read.scan as proposed by @claui.
- Addressed all brew cask style concerns
- Tested the resulting script and confirmed that it successfully grabbed the latest nightly
@joewiz
Copy link
Contributor Author

joewiz commented Dec 29, 2016

Okay, the revised PR is in, and CI and my own tests are passing.

@claui
Copy link
Contributor

claui commented Dec 29, 2016

Like @vitorgalvao already pointed out (and anticipated back when we introduced the feature), I feel this particular use of url do is going to be really helpful for nightlies that don’t have a stable latest-version URL. I think this PR should be merged. Thanks @joewiz!

@adidalal adidalal merged commit 16b3bab into Homebrew:master Dec 29, 2016
@joewiz joewiz deleted the exist-db-nightly branch December 29, 2016 16:23
@joewiz
Copy link
Contributor Author

joewiz commented Dec 29, 2016

@claui @adidalal @vitorgalvao Great to hear that this PR proved to be a broader contribution. Thank you so much for all of your help!

@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.

None yet

4 participants