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
a3ea2b56
Commit
a3ea2b56
authored
11 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
FormulaInstaller: cleanup check_/audit_ functions.
parent
8f0a073b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/formula_installer.rb
+27
-27
27 additions, 27 deletions
Library/Homebrew/formula_installer.rb
with
27 additions
and
27 deletions
Library/Homebrew/formula_installer.rb
+
27
−
27
View file @
a3ea2b56
...
...
@@ -231,8 +231,8 @@ class FormulaInstaller
audit_bin
audit_sbin
audit_lib
check_manpages
check_infopages
audit_man
audit_info
end
c
=
Caveats
.
new
(
f
)
...
...
@@ -257,7 +257,6 @@ class FormulaInstaller
end
else
link
check_PATH
unless
f
.
keg_only?
end
fix_install_names
...
...
@@ -438,16 +437,14 @@ class FormulaInstaller
## checks
def
check_PATH
def
check_PATH
bin
# warn the user if stuff was installed outside of their PATH
[
f
.
bin
,
f
.
sbin
].
each
do
|
bin
|
if
bin
.
directory?
and
bin
.
children
.
length
>
0
bin
=
(
HOMEBREW_PREFIX
/
bin
.
basename
).
realpath
unless
ORIGINAL_PATHS
.
include?
bin
opoo
"
#{
bin
}
is not in your PATH"
puts
"You can amend this by altering your ~/.bashrc file"
@show_summary_heading
=
true
end
if
bin
.
directory?
and
bin
.
children
.
length
>
0
bin
=
(
HOMEBREW_PREFIX
/
bin
.
basename
).
realpath
unless
ORIGINAL_PATHS
.
include?
bin
opoo
"
#{
bin
}
is not in your PATH"
puts
"You can amend this by altering your ~/.bashrc file"
@show_summary_heading
=
true
end
end
end
...
...
@@ -508,10 +505,8 @@ class FormulaInstaller
end
end
def
audit_bin
return
unless
f
.
bin
.
directory?
non_exes
=
f
.
bin
.
children
.
select
{
|
g
|
g
.
directory?
or
not
g
.
executable?
}
def
check_non_executables
bin
non_exes
=
bin
.
children
.
select
{
|
g
|
g
.
directory?
or
not
g
.
executable?
}
unless
non_exes
.
empty?
opoo
'Non-executables were installed to "bin".'
...
...
@@ -523,19 +518,16 @@ class FormulaInstaller
end
end
def
audit_bin
return
unless
f
.
bin
.
directory?
check_PATH
f
.
bin
unless
f
.
keg_only?
check_non_executables
f
.
bin
end
def
audit_sbin
return
unless
f
.
sbin
.
directory?
non_exes
=
f
.
sbin
.
children
.
select
{
|
g
|
g
.
directory?
or
not
g
.
executable?
}
unless
non_exes
.
empty?
opoo
'Non-executables were installed to "sbin".'
puts
"Installing non-executables to
\"
sbin
\"
is bad practice."
puts
"The offending files are:"
puts
non_exes
@show_summary_heading
=
true
Homebrew
.
failed
=
true
# fatal to Brew Bot
end
check_PATH
f
.
sbin
unless
f
.
keg_only?
check_non_executables
f
.
sbin
end
def
audit_lib
...
...
@@ -543,6 +535,14 @@ class FormulaInstaller
check_non_libraries
end
def
audit_man
check_manpages
end
def
audit_info
check_infopages
end
private
def
hold_locks?
...
...
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