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
d25767b3
Commit
d25767b3
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
doctor: consolidate directory access checks
Also include a writability check for lib. Closes Homebrew/homebrew#18571.
parent
873226e7
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
+22
-44
22 additions, 44 deletions
Library/Homebrew/cmd/doctor.rb
with
22 additions
and
44 deletions
Library/Homebrew/cmd/doctor.rb
+
22
−
44
View file @
d25767b3
...
@@ -307,6 +307,14 @@ def __check_subdir_access base
...
@@ -307,6 +307,14 @@ def __check_subdir_access base
end
end
end
end
def
check_access_share_locale
__check_subdir_access
'share/locale'
end
def
check_access_share_man
__check_subdir_access
'share/man'
end
def
check_access_usr_local
def
check_access_usr_local
return
unless
HOMEBREW_PREFIX
.
to_s
==
'/usr/local'
return
unless
HOMEBREW_PREFIX
.
to_s
==
'/usr/local'
...
@@ -322,51 +330,21 @@ def check_access_usr_local
...
@@ -322,51 +330,21 @@ def check_access_usr_local
end
end
end
end
def
check_access_share_locale
%w{include etc lib lib/pkgconfig share}
.
each
do
|
d
|
__check_subdir_access
'share/locale'
class_eval
<<-
EOS
,
__FILE__
,
__LINE__
+
1
end
def check_access_
#{
d
.
sub
(
"/"
,
"_"
)
}
if (dir = HOMEBREW_PREFIX+'
#{
d
}
').exist? && !dir.writable_real?
def
check_access_share_man
<<-EOF.undent
__check_subdir_access
'share/man'
\#
{dir} isn't writable.
end
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a brew tries to write a file to this directory, the
def
__check_folder_access
base
,
msg
install will fail during the link step.
folder
=
HOMEBREW_PREFIX
+
base
if
folder
.
exist?
and
not
folder
.
writable_real?
You should probably `chown`
\#
{dir}
<<-
EOS
.
undent
EOF
#{
folder
}
isn't writable.
end
This can happen if you "sudo make install" software that isn't managed
end
by Homebrew.
#{
msg
}
You should probably `chown`
#{
folder
}
EOS
EOS
end
end
def
check_access_pkgconfig
__check_folder_access
'lib/pkgconfig'
,
'If a brew tries to write a .pc file to this directory, the install will\n'
+
'fail during the link step.'
end
def
check_access_include
__check_folder_access
'include'
,
'If a brew tries to write a header file to this directory, the install will\n'
+
'fail during the link step.'
end
def
check_access_etc
__check_folder_access
'etc'
,
'If a brew tries to write a file to this directory, the install will\n'
+
'fail during the link step.'
end
def
check_access_share
__check_folder_access
'share'
,
'If a brew tries to write a file to this directory, the install will\n'
+
'fail during the link step.'
end
end
def
check_access_logs
def
check_access_logs
...
...
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