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
5e99ecfb
Unverified
Commit
5e99ecfb
authored
4 years ago
by
Lionell Loh Jian An
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Apply suggestions from code review
Code review changes Co-authored-by:
Mike McQuaid
<
mike@mikemcquaid.com
>
parent
84d86e6d
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/env_config.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/env_config.rb
Library/Homebrew/formula_installer.rb
+6
-12
6 additions, 12 deletions
Library/Homebrew/formula_installer.rb
with
7 additions
and
13 deletions
Library/Homebrew/env_config.rb
+
1
−
1
View file @
5e99ecfb
...
...
@@ -112,7 +112,7 @@ module Homebrew
default:
15
,
},
HOMEBREW_FORBIDDEN_LICENSES
:
{
description:
"Use this environment variable to define a
black
list of space separated licenses and Homebrew "
\
description:
"Use this environment variable to define a
deny
list of space separated licenses and Homebrew "
\
"will avoid installing the packages with those licenses."
,
},
HOMEBREW_FORCE_BREWED_CURL
:
{
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/formula_installer.rb
+
6
−
12
View file @
5e99ecfb
...
...
@@ -1106,23 +1106,17 @@ class FormulaInstaller
$stderr
.
puts
@requirement_messages
end
def
env_forbidden_licenses
Homebrew
::
EnvConfig
.
forbidden_licenses
.
split
(
" "
)
end
def
forbidden_license_check
(
f
)
return
if
ENV
[
"HOMEBREW_FORBIDDEN_LICENSES"
].
blank?
forbidden_licenses
=
env_forbidden_licenses
def
forbidden_license_check
forbidden_licenses
=
Homebrew
::
EnvConfig
.
forbidden_licenses
.
split
(
" "
)
return
if
forbidden_licenses
.
blank?
if
forbidden_licenses
.
include?
f
.
license
if
forbidden_licenses
.
include?
f
ormula
.
license
raise
CannotInstallFormulaError
,
<<~
EOS
#{
f
.
name
}
has a forbidden license
#{
f
.
license
}
.
#{
f
ormula
.
name
}
has a forbidden license
#{
f
ormula
.
license
}
.
EOS
end
fi
=
FormulaInstaller
.
new
(
f
)
fi
.
compute_dependencies
.
each
do
|
dep
,
_
|
compute_dependencies
.
each
do
|
dep
,
_
|
dep_f
=
dep
.
to_formula
next
unless
forbidden_licenses
.
include?
dep_f
.
license
...
...
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