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
49dce3e7
Commit
49dce3e7
authored
9 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
outdated: check if formula needs to be migrated.
Closes Homebrew/homebrew#42938.
parent
3d7c38c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/cmd/outdated.rb
+8
-0
8 additions, 0 deletions
Library/Homebrew/cmd/outdated.rb
Library/Homebrew/migrator.rb
+9
-0
9 additions, 0 deletions
Library/Homebrew/migrator.rb
with
17 additions
and
0 deletions
Library/Homebrew/cmd/outdated.rb
+
8
−
0
View file @
49dce3e7
require
"formula"
require
"keg"
require
"migrator"
module
Homebrew
def
outdated
...
...
@@ -16,6 +17,13 @@ module Homebrew
formulae
.
map
do
|
f
|
all_versions
=
[]
older_or_same_tap_versions
=
[]
if
f
.
oldname
&&
!
f
.
rack
.
exist?
if
Pathname
.
new
(
"
#{
HOMEBREW_CELLAR
}
/
#{
f
.
oldname
}
"
).
exist?
raise
Migrator
::
MigrationNeededError
.
new
(
f
)
end
end
f
.
rack
.
subdirs
.
each
do
|
dir
|
keg
=
Keg
.
new
dir
version
=
keg
.
version
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/migrator.rb
+
9
−
0
View file @
49dce3e7
...
...
@@ -4,6 +4,15 @@ require "tab"
require
"tap_migrations"
class
Migrator
class
MigrationNeededError
<
RuntimeError
def
initialize
(
formula
)
super
<<-
EOS
.
undent
#{
formula
.
oldname
}
was renamed to
#{
formula
.
name
}
and needs to be migrated.
Please run `brew migrate
#{
formula
.
oldname
}
`
EOS
end
end
class
MigratorNoOldnameError
<
RuntimeError
def
initialize
(
formula
)
super
"
#{
formula
.
name
}
doesn't replace any formula."
...
...
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