Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
4cbc34d3
Unverified
Commit
4cbc34d3
authored
4 years ago
by
Mike McQuaid
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #11071 from MikeMcQuaid/linuxbrew-url-fix
Fix Linuxbrew URL handling
parents
71124945
598c230e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/github_packages.rb
+15
-1
15 additions, 1 deletion
Library/Homebrew/github_packages.rb
Library/Homebrew/software_spec.rb
+4
-5
4 additions, 5 deletions
Library/Homebrew/software_spec.rb
with
19 additions
and
6 deletions
Library/Homebrew/github_packages.rb
+
15
−
1
View file @
4cbc34d3
...
...
@@ -15,8 +15,11 @@ class GitHubPackages
URL_DOMAIN
=
"ghcr.io"
URL_PREFIX
=
"https://
#{
URL_DOMAIN
}
/v2/"
DOCKER_PREFIX
=
"docker://
#{
URL_DOMAIN
}
/"
private_constant
:URL_DOMAIN
private_constant
:URL_PREFIX
private_constant
:DOCKER_PREFIX
URL_REGEX
=
%r{(?:
#{
Regexp
.
escape
(
URL_PREFIX
)
}
|
#{
Regexp
.
escape
(
DOCKER_PREFIX
)
}
)([
\w
-]+)/([
\w
-]+)}
.
freeze
GITHUB_PACKAGE_TYPE
=
"homebrew_bottle"
# Translate Homebrew tab.arch to OCI platform.architecture
TAB_ARCH_TO_PLATFORM_ARCHITECTURE
=
{
...
...
@@ -102,6 +105,15 @@ class GitHubPackages
"
#{
prefix
}#{
org
}
/
#{
repo_without_prefix
(
repo
)
}
"
end
def
self
.
root_url_if_match
(
url
)
return
if
url
.
blank?
_
,
org
,
repo
,
=
*
url
.
to_s
.
match
(
URL_REGEX
)
return
if
org
.
blank?
||
repo
.
blank?
root_url
(
org
,
repo
)
end
def
self
.
image_formula_name
(
formula_name
)
# invalid docker name characters
# / makes sense because we already use it to separate repo/formula
...
...
@@ -124,6 +136,8 @@ class GitHubPackages
IMAGE_LAYOUT_SCHEMA_URI
=
"https://opencontainers.org/schema/image/layout"
IMAGE_MANIFEST_SCHEMA_URI
=
"https://opencontainers.org/schema/image/manifest"
GITHUB_PACKAGE_TYPE
=
"homebrew_bottle"
def
load_schemas!
schema_uri
(
"content-descriptor"
,
"https://opencontainers.org/schema/image/content-descriptor.json"
)
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/software_spec.rb
+
4
−
5
View file @
4cbc34d3
...
...
@@ -447,15 +447,14 @@ class BottleSpecification
def
root_url
(
var
=
nil
,
specs
=
{})
if
var
.
nil?
@root_url
||=
if
Homebrew
::
EnvConfig
.
bottle_domain
.
match?
(
GitHubPackages
::
URL_REGEX
)
G
it
H
ub
P
ackages
.
root_url
(
tap
.
user
,
tap
.
repo
).
to_s
@root_url
||=
if
(
github_packages_url
=
GitHubPackages
.
root_url_if_match
(
Homebrew
::
EnvConfig
.
bottle_domain
)
)
g
it
h
ub
_p
ackages
_url
else
"
#{
Homebrew
::
EnvConfig
.
bottle_domain
}
/
#{
Utils
::
Bottles
::
Bintray
.
repository
(
tap
)
}
"
end
else
@root_url
=
if
var
.
to_s
.
start_with?
"docker://"
_
,
registry
,
org
,
repo
=
*
var
.
match
(
%r{docker://([
\w
.-]+)/([
\w
-]+)/([
\w
-]+)}
)
GitHubPackages
.
root_url
(
org
,
repo
,
"https://
#{
registry
}
/v2/"
).
to_s
@root_url
=
if
(
github_packages_url
=
GitHubPackages
.
root_url_if_match
(
var
))
github_packages_url
else
var
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment