Merge pull request #19973 from Homebrew/livecheck/bitbucket-update-generated-urls
Bitbucket: update generated urls
This commit is contained in:
commit
14fbd47808
@ -68,14 +68,14 @@ module Homebrew
|
||||
# `/get/` archives are Git tag snapshots, so we need to check that tab
|
||||
# instead of the main `/downloads/` page
|
||||
if match[:dl_type] == "get"
|
||||
values[:url] = "https://bitbucket.org/#{match[:path]}/downloads/?tab=tags"
|
||||
values[:url] = "https://bitbucket.org/#{match[:path]}/downloads/?tab=tags&iframe=true&spa=0"
|
||||
|
||||
# Example tag regexes:
|
||||
# * `/<td[^>]*?class="name"[^>]*?>\s*v?(\d+(?:\.\d+)+)\s*?</im`
|
||||
# * `/<td[^>]*?class="name"[^>]*?>\s*abc-v?(\d+(?:\.\d+)+)\s*?</im`
|
||||
values[:regex] = /<td[^>]*?class="name"[^>]*?>\s*#{regex_prefix}v?(\d+(?:\.\d+)+)\s*?</im
|
||||
else
|
||||
values[:url] = "https://bitbucket.org/#{match[:path]}/downloads/"
|
||||
values[:url] = "https://bitbucket.org/#{match[:path]}/downloads/?iframe=true&spa=0"
|
||||
|
||||
# Use `\.t` instead of specific tarball extensions (e.g. .tar.gz)
|
||||
suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, ".t")
|
||||
|
||||
@ -16,11 +16,11 @@ RSpec.describe Homebrew::Livecheck::Strategy::Bitbucket do
|
||||
let(:generated) do
|
||||
{
|
||||
get: {
|
||||
url: "https://bitbucket.org/abc/def/downloads/?tab=tags",
|
||||
url: "https://bitbucket.org/abc/def/downloads/?tab=tags&iframe=true&spa=0",
|
||||
regex: /<td[^>]*?class="name"[^>]*?>\s*v?(\d+(?:\.\d+)+)\s*?</im,
|
||||
},
|
||||
downloads: {
|
||||
url: "https://bitbucket.org/abc/def/downloads/",
|
||||
url: "https://bitbucket.org/abc/def/downloads/?iframe=true&spa=0",
|
||||
regex: /href=.*?ghi-v?(\d+(?:\.\d+)+)\.t/i,
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user