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

atool: update url and regex #359

merged 1 commit into from Mar 9, 2020

atool: update url and regex #359

merged 1 commit into from Mar 9, 2020


Copy link

samford commented Mar 9, 2020

This is a follow-up PR to #354, since I couldn't get to it before it was merged and there were a few items that could have been addressed.

Since we're using the tar.gz file in the formula, we only want to match those archives on this page. Usually we do this by adding \.t after the numeric portion of the regex (as the archive could be tar.gz, tar.xz, tar.bz2, etc. and needs to be somewhat generic).

Additionally, we want to match the href attributes of the links rather than any text in the HTML. Index pages like this sometimes truncate the text for the filename, so we can run into matching problems if this occurs.

With these two ideas in mind the regex would be: /href="atool-(\d+(?:\.\d+)+)\.t/

Additionally, you can sometimes add ?C=M&O=D to the end of index pages like these to get them to sort files in descending order (I borrowed this from the heuristic). This isn't explicitly necessary but it can sometimes help with ensuring we get the latest version.

@samford samford mentioned this pull request Mar 9, 2020
@samford samford merged commit 00e1d3f into Homebrew:master Mar 9, 2020
1 check passed
1 check passed
@samford samford deleted the samford:atool-update branch Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.