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
ad8556cc
Commit
ad8556cc
authored
10 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Revert "Match whitelisted files using fnmatch""
This reverts commit 91be9f5344d5931ddae6e4f905c18a607fa9e9f1.
parent
dfce2bb7
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/cmd/doctor.rb
+17
-8
17 additions, 8 deletions
Library/Homebrew/cmd/doctor.rb
with
17 additions
and
8 deletions
Library/Homebrew/cmd/doctor.rb
+
17
−
8
View file @
ad8556cc
...
...
@@ -103,9 +103,18 @@ def check_for_macgpg2
end
end
def
__check_stray_files
(
pattern
,
white_list
,
message
)
files
=
Dir
[
pattern
].
select
{
|
f
|
File
.
file?
f
and
not
File
.
symlink?
f
}
bad
=
files
.
reject
{
|
d
|
white_list
.
key?
File
.
basename
(
d
)
}
def
__check_stray_files
(
dir
,
pattern
,
white_list
,
message
)
files
=
Dir
.
chdir
(
dir
)
{
Dir
[
pattern
].
select
{
|
f
|
File
.
file?
(
f
)
&&
!
File
.
symlink?
(
f
)
}
}
keys
=
white_list
.
keys
bad
=
files
.
reject
{
|
file
|
keys
.
any?
{
|
pat
|
File
.
fnmatch?
(
pat
,
file
)
}
}
bad
.
map!
{
|
file
|
File
.
join
(
dir
,
file
)
}
inject_file_list
(
bad
,
message
)
unless
bad
.
empty?
end
...
...
@@ -119,7 +128,7 @@ def check_for_stray_dylibs
"libosxfuse_i64.2.dylib"
=>
"OSXFuse"
,
}
__check_stray_files
'
/usr/local/lib
/
*.dylib
'
,
white_list
,
<<-
EOS
.
undent
__check_stray_files
"
/usr/local/lib
"
,
"
*.dylib
"
,
white_list
,
<<-
EOS
.
undent
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
...
...
@@ -136,7 +145,7 @@ def check_for_stray_static_libs
"libsecurity_agent_server.a"
=>
"OS X 10.8.2 Supplemental Update"
}
__check_stray_files
'
/usr/local/lib
/
*.a
'
,
white_list
,
<<-
EOS
.
undent
__check_stray_files
"
/usr/local/lib
"
,
"
*.a
"
,
white_list
,
<<-
EOS
.
undent
Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
...
...
@@ -152,7 +161,7 @@ def check_for_stray_pcs
"osxfuse.pc"
=>
"OSXFuse"
,
}
__check_stray_files
'
/usr/local/lib/pkgconfig
/
*.pc
'
,
white_list
,
<<-
EOS
.
undent
__check_stray_files
"
/usr/local/lib/pkgconfig
"
,
"
*.pc
"
,
white_list
,
<<-
EOS
.
undent
Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
...
...
@@ -169,7 +178,7 @@ def check_for_stray_las
"libosxfuse_i64.la"
=>
"OSXFuse"
,
}
__check_stray_files
'
/usr/local/lib
/
*.la
'
,
white_list
,
<<-
EOS
.
undent
__check_stray_files
"
/usr/local/lib
"
,
"
*.la
"
,
white_list
,
<<-
EOS
.
undent
Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
...
...
@@ -181,7 +190,7 @@ end
def
check_for_stray_headers
white_list
=
{}
# TODO whitelist MacFuse/OSXFuse headers
__check_stray_files
"/usr/local/include
/
**/*.h"
,
white_list
,
<<-
EOS
.
undent
__check_stray_files
"/usr/local/include
"
,
"
**/*.h"
,
white_list
,
<<-
EOS
.
undent
Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
...
...
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