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
9c15174e
Unverified
Commit
9c15174e
authored
8 years ago
by
Vlad Shablinsky
Committed by
Xu Cheng
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
formula: simplify outdated_versions logic
parent
d47df68c
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
+8
-16
8 additions, 16 deletions
Library/Homebrew/formula.rb
with
8 additions
and
16 deletions
Library/Homebrew/formula.rb
+
8
−
16
View file @
9c15174e
...
...
@@ -956,33 +956,25 @@ class Formula
@oldname_lock
.
unlock
unless
@oldname_lock
.
nil?
end
def
migration_needed?
oldname
&&
!
rack
.
exist?
&&
(
dir
=
HOMEBREW_CELLAR
/
oldname
).
directory?
&&
!
dir
.
subdirs
.
empty?
&&
tap
==
Tab
.
for_keg
(
dir
.
subdirs
.
first
).
tap
end
# @private
def
outdated_versions
@outdated_versions
||=
begin
all_versions
=
[]
older_or_same_tap_versions
=
[]
if
oldname
&&
!
rack
.
exist?
&&
(
dir
=
HOMEBREW_CELLAR
/
oldname
).
directory?
&&
!
dir
.
subdirs
.
empty?
&&
tap
==
Tab
.
for_keg
(
dir
.
subdirs
.
first
).
tap
raise
Migrator
::
MigrationNeededError
.
new
(
self
)
end
raise
Migrator
::
MigrationNeededError
.
new
(
self
)
if
migration_needed?
installed_kegs
.
each
do
|
keg
|
version
=
keg
.
version
all_versions
<<
version
older_version
=
pkg_version
<=
version
tab_tap
=
Tab
.
for_keg
(
keg
).
tap
if
tab_tap
.
nil?
||
tab_tap
==
tap
||
older_version
older_or_same_tap_versions
<<
version
end
return
[]
if
pkg_version
<=
version
end
if
older_or_same_tap_versions
.
all?
{
|
v
|
pkg_version
>
v
}
all_versions
.
sort!
else
[]
end
all_versions
.
sort!
end
end
...
...
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