Skip to content
Snippets Groups Projects
Unverified Commit 0227ac5b authored by Dawid Dziurla's avatar Dawid Dziurla Committed by GitHub
Browse files

Merge pull request #8338 from SeekingMeaning/bump-formula-pr/patch-resource-warnings

bump-formula-pr: add warnings for patches and resources
parents 2a619a9c 8df61895
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,9 @@ module Homebrew
new_version = args.version
check_closed_pull_requests(formula, tap_full_name, version: new_version, args: args) if new_version
opoo "This formula has patches that may be resolved upstream." if formula.patchlist.present?
opoo "This formula has resources that may need to be updated." if formula.resources.present?
requested_spec = :stable
formula_spec = formula.stable
odie "#{formula}: no #{requested_spec} specification found!" unless formula_spec
......@@ -145,16 +148,7 @@ module Homebrew
new_tag = args.tag
new_revision = args.revision
new_mirrors ||= args.mirror
new_mirror ||= case new_url
when %r{.*ftp.gnu.org/gnu.*}
new_url.sub "ftp.gnu.org/gnu", "ftpmirror.gnu.org"
when %r{.*download.savannah.gnu.org/*}
new_url.sub "download.savannah.gnu.org", "download-mirror.savannah.gnu.org"
when %r{.*www.apache.org/dyn/closer.lua\?path=.*}
new_url.sub "www.apache.org/dyn/closer.lua?path=", "archive.apache.org/dist/"
when %r{.*mirrors.ocf.berkeley.edu/debian.*}
new_url.sub "mirrors.ocf.berkeley.edu/debian", "mirrorservice.org/sites/ftp.debian.org/debian"
end
new_mirror ||= determine_mirror(new_url)
new_mirrors ||= [new_mirror] unless new_mirror.nil?
old_url = formula_spec.url
old_tag = formula_spec.specs[:tag]
......@@ -422,6 +416,19 @@ module Homebrew
odie "Couldn't guess formula for sure; could be one of these:\n#{guesses.map(&:name).join(", ")}"
end
def determine_mirror(url)
case url
when %r{.*ftp.gnu.org/gnu.*}
url.sub "ftp.gnu.org/gnu", "ftpmirror.gnu.org"
when %r{.*download.savannah.gnu.org/*}
url.sub "download.savannah.gnu.org", "download-mirror.savannah.gnu.org"
when %r{.*www.apache.org/dyn/closer.lua\?path=.*}
url.sub "www.apache.org/dyn/closer.lua?path=", "archive.apache.org/dist/"
when %r{.*mirrors.ocf.berkeley.edu/debian.*}
url.sub "mirrors.ocf.berkeley.edu/debian", "mirrorservice.org/sites/ftp.debian.org/debian"
end
end
def fetch_resource(formula, new_version, url, **specs)
resource = Resource.new
resource.url(url, specs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment