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
f476bcaf
Commit
f476bcaf
authored
4 years ago
by
Seeker
Browse files
Options
Downloads
Patches
Plain Diff
upgrade: show formula caveats after casks have been updated
parent
b29c27b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Library/Homebrew/cask/cmd/upgrade.rb
+4
-4
4 additions, 4 deletions
Library/Homebrew/cask/cmd/upgrade.rb
Library/Homebrew/cmd/upgrade.rb
+14
-10
14 additions, 10 deletions
Library/Homebrew/cmd/upgrade.rb
Library/Homebrew/messages.rb
+5
-4
5 additions, 4 deletions
Library/Homebrew/messages.rb
with
23 additions
and
18 deletions
Library/Homebrew/cask/cmd/upgrade.rb
+
4
−
4
View file @
f476bcaf
...
...
@@ -69,7 +69,7 @@ module Cask
binaries:
T
.
nilable
(
T
::
Boolean
),
quarantine:
T
.
nilable
(
T
::
Boolean
),
require_sha:
T
.
nilable
(
T
::
Boolean
),
).
void
).
returns
(
T
::
Boolean
)
end
def
self
.
upgrade_casks
(
*
casks
,
...
...
@@ -98,7 +98,7 @@ module Cask
end
end
return
if
outdated_casks
.
empty?
return
false
if
outdated_casks
.
empty?
if
casks
.
empty?
&&
!
greedy
ohai
"Casks with `auto_updates` or `version :latest` will not be upgraded; pass `--greedy` to upgrade them."
...
...
@@ -114,7 +114,7 @@ module Cask
puts
upgradable_casks
.
map
{
|
(
old_cask
,
new_cask
)
|
"
#{
new_cask
.
full_name
}
#{
old_cask
.
version
}
->
#{
new_cask
.
version
}
"
}
.
join
(
"
\n
"
)
return
if
dry_run
return
true
if
dry_run
upgradable_casks
.
each
do
|
(
old_cask
,
new_cask
)
|
upgrade_cask
(
...
...
@@ -127,7 +127,7 @@ module Cask
next
end
return
if
caught_exceptions
.
empty?
return
true
if
caught_exceptions
.
empty?
raise
MultipleCaskErrors
,
caught_exceptions
if
caught_exceptions
.
count
>
1
raise
caught_exceptions
.
first
if
caught_exceptions
.
count
==
1
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/cmd/upgrade.rb
+
14
−
10
View file @
f476bcaf
...
...
@@ -100,16 +100,20 @@ module Homebrew
# If one or more formulae are specified, but no casks were
# specified, we want to make note of that so we don't
# try to upgrade all outdated casks.
upgrade_formulae
=
formulae
.
present?
&&
casks
.
blank?
upgrade_casks
=
casks
.
present?
&&
formulae
.
blank?
only_
upgrade_formulae
=
formulae
.
present?
&&
casks
.
blank?
only_
upgrade_casks
=
casks
.
present?
&&
formulae
.
blank?
upgrade_outdated_formulae
(
formulae
,
args:
args
)
unless
upgrade_casks
upgrade_outdated_casks
(
casks
,
args:
args
)
unless
upgrade_formulae
display_messages
=
!
only_upgrade_casks
&&
upgrade_outdated_formulae
(
formulae
,
args:
args
)
force_caveats
=
!
only_upgrade_formulae
&&
upgrade_outdated_casks
(
casks
,
args:
args
)
return
unless
display_messages
Homebrew
.
messages
.
display_messages
(
force_caveats:
force_caveats
,
display_times:
args
.
display_times?
)
end
sig
{
params
(
formulae:
T
::
Array
[
Formula
],
args:
CLI
::
Args
).
void
}
sig
{
params
(
formulae:
T
::
Array
[
Formula
],
args:
CLI
::
Args
).
returns
(
T
::
Boolean
)
}
def
upgrade_outdated_formulae
(
formulae
,
args
:)
return
if
args
.
cask?
return
false
if
args
.
cask?
FormulaInstaller
.
prevent_build_flags
(
args
)
...
...
@@ -135,7 +139,7 @@ module Homebrew
end
end
return
if
outdated
.
blank?
return
false
if
outdated
.
blank?
pinned
=
outdated
.
select
(
&
:pinned?
)
outdated
-=
pinned
...
...
@@ -172,12 +176,12 @@ module Homebrew
Upgrade
.
check_installed_dependents
(
formulae_to_install
,
args:
args
)
Homebrew
.
messages
.
display_messages
(
display_times:
args
.
display_times?
)
true
end
sig
{
params
(
casks:
T
::
Array
[
Cask
::
Cask
],
args:
CLI
::
Args
).
void
}
sig
{
params
(
casks:
T
::
Array
[
Cask
::
Cask
],
args:
CLI
::
Args
).
returns
(
T
::
Boolean
)
}
def
upgrade_outdated_casks
(
casks
,
args
:)
return
if
args
.
formula?
return
false
if
args
.
formula?
Cask
::
Cmd
::
Upgrade
.
upgrade_casks
(
*
casks
,
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/messages.rb
+
5
−
4
View file @
f476bcaf
...
...
@@ -24,13 +24,14 @@ class Messages
@install_times
.
push
(
formula:
f
.
name
,
time:
elapsed_time
)
end
def
display_messages
(
display_times:
false
)
display_caveats
def
display_messages
(
force_caveats:
false
,
display_times:
false
)
display_caveats
(
force:
force_caveats
)
display_install_times
if
display_times
end
def
display_caveats
return
if
@formula_count
<=
1
def
display_caveats
(
force:
false
)
return
if
@formula_count
.
zero?
return
if
@formula_count
==
1
&&
!
force
return
if
@caveats
.
empty?
oh1
"Caveats"
...
...
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