Skip to content

Commit 1680ddb

Browse files
committed
utils/repology: temporarily disable functionality.
Doesn't work with system `curl` currently.
1 parent 5a5db3a commit 1680ddb

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

Library/Homebrew/test/utils/repology_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
it "returns a hash for existing package" do
1515
response = described_class.single_package_query("openclonk", repository: "homebrew")
1616

17-
expect(response).not_to be_nil
18-
expect(response).to be_a(Hash)
17+
expect(response).to be_nil
18+
# TODO: uncomment (and remove line above) when we have a fix for Repology
19+
# `curl` issues
20+
# expect(response).not_to be_nil
21+
# expect(response).to be_a(Hash)
1922
end
2023
end
2124

Library/Homebrew/utils/repology.rb

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,30 @@ module Repology
1515
MAX_PAGINATION = 15
1616
private_constant :MAX_PAGINATION
1717

18-
def query_api(last_package_in_response = "", repository:)
19-
last_package_in_response += "/" if last_package_in_response.present?
20-
url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1"
21-
22-
output, _errors, _status = curl_output(url.to_s)
23-
JSON.parse(output)
18+
def query_api(_last_package_in_response = "", repository:)
19+
{}
20+
# TODO: uncomment (and remove lines above) when we have a fix for Repology
21+
# `curl` issues
22+
# last_package_in_response += "/" if last_package_in_response.present?
23+
# url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1"
24+
25+
# output, _errors, _status = curl_output(url.to_s)
26+
# JSON.parse(output)
2427
end
2528

2629
def single_package_query(name, repository:)
27-
url = "https://repology.org/tools/project-by?repo=#{repository}&" \
28-
"name_type=srcname&target_page=api_v1_project&name=#{name}"
29-
30-
output, _errors, _status = curl_output("--location", url.to_s)
31-
32-
begin
33-
data = JSON.parse(output)
34-
{ name => data }
35-
rescue
36-
nil
37-
end
30+
# TODO: uncomment when we have a fix for Repology `curl` issues
31+
# url = "https://repology.org/tools/project-by?repo=#{repository}&" \
32+
# "name_type=srcname&target_page=api_v1_project&name=#{name}"
33+
34+
# output, _errors, _status = curl_output("--location", url.to_s)
35+
36+
# begin
37+
# data = JSON.parse(output)
38+
# { name => data }
39+
# rescue
40+
# nil
41+
# end
3842
end
3943

4044
def parse_api_response(limit = nil, repository:)

0 commit comments

Comments
 (0)