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

software_spec: Add HOMEBREW_BOTTLE_DEFAULT_DOMAIN as a fallback option #10671

Merged
merged 1 commit into from
Feb 26, 2021
Merged

software_spec: Add HOMEBREW_BOTTLE_DEFAULT_DOMAIN as a fallback option #10671

merged 1 commit into from
Feb 26, 2021

Conversation

XuehaiPan
Copy link
Contributor

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

Add HOMEBREW_BOTTLE_DEFAULT_DOMAIN to downloader mirror list if HOMEBREW_BOTTLE_DOMAIN is other than the default. The downloader may use the HOMEBREW_BOTTLE_DEFAULT_DOMAIN as a fallback option. (resolves #10660)

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks! Nice work so far. Some tests would be great (but can wait until we've nailed this down a bit more off desired).

@XuehaiPan
Copy link
Contributor Author

I think default_root_url could be misleading, because it is not always presented. I renamed it to fallback_root_url. It is not nil when Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN and @root_url is not explicitly modified (Library/Homebrew/dev-cmd/bottle.rb#L405).

@XuehaiPan
Copy link
Contributor Author

Simply replace the BOTTLE_DOMAIN to BOTTLE_DEFAULT_DOMAIN as the fallback URL. Even if the root URL has been modified explicitly (Library/Homebrew/dev-cmd/bottle.rb#L405). The root URL modification check has been removed. The fallback option only takes effect in fetch.

@MikeMcQuaid
Copy link
Member

@XuehaiPan Let me know when there's a version that works OK for you!

@XuehaiPan
Copy link
Contributor Author

XuehaiPan commented Feb 24, 2021

@XuehaiPan Let me know when there's a version that works OK for you!

The current version (@bf87849) works fine for me.

@XuehaiPan
Copy link
Contributor Author

XuehaiPan commented Feb 24, 2021

Probably the final version of this PR.

@MikeMcQuaid
Copy link
Member

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @XuehaiPan!

@MikeMcQuaid MikeMcQuaid merged commit 811df90 into Homebrew:master Feb 26, 2021
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Mar 29, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add BOTTLE_DEFAULT_DOMAIN to downloader mirror list if BOTTLE_DOMAIN is other than the default
3 participants