mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Bitbucket: update generated urls
The `Bitbucket` strategy checks download or tag pages but the content is now fetched separately on page load, so the strategy is failing for all related formulae. This updates the generated strategy URLs to fetch the page content instead, which works as expected.
This commit is contained in:
parent
69667974bc
commit
95abc7360b
@ -68,14 +68,14 @@ module Homebrew
|
|||||||
# `/get/` archives are Git tag snapshots, so we need to check that tab
|
# `/get/` archives are Git tag snapshots, so we need to check that tab
|
||||||
# instead of the main `/downloads/` page
|
# instead of the main `/downloads/` page
|
||||||
if match[:dl_type] == "get"
|
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:
|
# Example tag regexes:
|
||||||
# * `/<td[^>]*?class="name"[^>]*?>\s*v?(\d+(?:\.\d+)+)\s*?</im`
|
# * `/<td[^>]*?class="name"[^>]*?>\s*v?(\d+(?:\.\d+)+)\s*?</im`
|
||||||
# * `/<td[^>]*?class="name"[^>]*?>\s*abc-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
|
values[:regex] = /<td[^>]*?class="name"[^>]*?>\s*#{regex_prefix}v?(\d+(?:\.\d+)+)\s*?</im
|
||||||
else
|
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)
|
# Use `\.t` instead of specific tarball extensions (e.g. .tar.gz)
|
||||||
suffix = T.must(match[:suffix]).sub(Strategy::TARBALL_EXTENSION_REGEX, ".t")
|
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
|
let(:generated) do
|
||||||
{
|
{
|
||||||
get: {
|
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,
|
regex: /<td[^>]*?class="name"[^>]*?>\s*v?(\d+(?:\.\d+)+)\s*?</im,
|
||||||
},
|
},
|
||||||
downloads: {
|
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,
|
regex: /href=.*?ghi-v?(\d+(?:\.\d+)+)\.t/i,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user