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
0fee65bf
Commit
0fee65bf
authored
9 years ago
by
Robin Neatherway
Committed by
Xu Cheng
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
link_overwrite if the owning keg no longer exists
parent
4c80bf43
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.rb
+14
-3
14 additions, 3 deletions
Library/Homebrew/formula.rb
with
14 additions
and
3 deletions
Library/Homebrew/formula.rb
+
14
−
3
View file @
0fee65bf
...
...
@@ -805,13 +805,24 @@ class Formula
def
link_overwrite?
(
path
)
# Don't overwrite files not created by Homebrew.
return
false
unless
path
.
stat
.
uid
==
File
.
stat
(
HOMEBREW_BREW_FILE
).
uid
# Don't overwrite files belong to other keg.
# Don't overwrite files belong to other keg except when that
# keg's formula is deleted.
begin
Keg
.
for
(
path
)
keg
=
Keg
.
for
(
path
)
rescue
NotAKegError
,
Errno
::
ENOENT
# file doesn't belong to any keg.
else
return
false
tap
=
Tab
.
for_keg
(
keg
).
tap
return
false
if
tap
.
nil?
# this keg doesn't below to any core/tap formula, most likely coming from a DIY install.
begin
Formulary
.
factory
(
keg
.
name
)
rescue
FormulaUnavailableError
# formula for this keg is deleted, so defer to whitelist
rescue
TapFormulaAmbiguityError
,
TapFormulaWithOldnameAmbiguityError
return
false
# this keg belongs to another formula
else
return
false
# this keg belongs to another formula
end
end
to_check
=
path
.
relative_path_from
(
HOMEBREW_PREFIX
).
to_s
self
.
class
.
link_overwrite_paths
.
any?
do
|
p
|
...
...
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