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
75a692d0
Commit
75a692d0
authored
4 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Make `ohai`, `oh1` and `odebug` use `#debug?` and `verbose?` of the current object when possible.
parent
add10377
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/formula_installer.rb
+4
-4
4 additions, 4 deletions
Library/Homebrew/formula_installer.rb
Library/Homebrew/utils.rb
+23
-5
23 additions, 5 deletions
Library/Homebrew/utils.rb
with
27 additions
and
9 deletions
Library/Homebrew/formula_installer.rb
+
4
−
4
View file @
75a692d0
...
...
@@ -939,7 +939,7 @@ class FormulaInstaller
log
.
mkpath
if
formula
.
plist
.
include?
log
.
to_s
rescue
Exception
=>
e
# rubocop:disable Lint/RescueException
onoe
"Failed to install plist file"
o
hai
e
,
e
.
backtrace
if
debug?
o
debug
e
,
e
.
backtrace
Homebrew
.
failed
=
true
end
...
...
@@ -949,7 +949,7 @@ class FormulaInstaller
onoe
"Failed to fix install linkage"
puts
"The formula built, but you may encounter issues using it or linking other"
puts
"formulae against it."
o
hai
e
,
e
.
backtrace
if
debug?
o
debug
e
,
e
.
backtrace
Homebrew
.
failed
=
true
@show_summary_heading
=
true
end
...
...
@@ -960,7 +960,7 @@ class FormulaInstaller
rescue
Exception
=>
e
# rubocop:disable Lint/RescueException
opoo
"The cleaning step did not complete successfully"
puts
"Still, the installation was successful, so we will link it into your prefix"
o
hai
e
,
e
.
backtrace
if
debug?
o
debug
e
,
e
.
backtrace
Homebrew
.
failed
=
true
@show_summary_heading
=
true
end
...
...
@@ -996,7 +996,7 @@ class FormulaInstaller
rescue
Exception
=>
e
# rubocop:disable Lint/RescueException
opoo
"The post-install step did not complete successfully"
puts
"You can try again using `brew postinstall
#{
formula
.
full_name
}
`"
o
hai
e
,
e
.
backtrace
if
debug?
||
Homebrew
::
EnvConfig
.
developer?
o
debug
e
,
e
.
backtrace
,
always_display:
Homebrew
::
EnvConfig
.
developer?
Homebrew
.
failed
=
true
@show_summary_heading
=
true
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/utils.rb
+
23
−
5
View file @
75a692d0
...
...
@@ -86,7 +86,13 @@ module Kernel
end
def
ohai_title
(
title
)
title
=
Tty
.
truncate
(
title
)
if
$stdout
.
tty?
&&
!
Homebrew
.
args
.
verbose?
verbose
=
if
respond_to?
(
:verbose?
)
verbose?
else
Homebrew
.
args
.
verbose?
end
title
=
Tty
.
truncate
(
title
)
if
$stdout
.
tty?
&&
!
verbose
Formatter
.
headline
(
title
,
color: :blue
)
end
...
...
@@ -95,15 +101,27 @@ module Kernel
puts
sput
end
def
odebug
(
title
,
*
sput
)
return
unless
Homebrew
.
args
.
debug?
def
odebug
(
title
,
*
sput
,
always_display:
false
)
debug
=
if
respond_to?
(
:debug?
)
debug?
else
Homebrew
.
args
.
debug?
end
return
unless
debug
||
always_display
puts
Formatter
.
headline
(
title
,
color: :magenta
)
puts
sput
unless
sput
.
empty?
end
def
oh1
(
title
,
options
=
{})
title
=
Tty
.
truncate
(
title
)
if
$stdout
.
tty?
&&
!
Homebrew
.
args
.
verbose?
&&
options
.
fetch
(
:truncate
,
:auto
)
==
:auto
def
oh1
(
title
,
truncate: :auto
)
verbose
=
if
respond_to?
(
:verbose?
)
verbose?
else
Homebrew
.
args
.
verbose?
end
title
=
Tty
.
truncate
(
title
)
if
$stdout
.
tty?
&&
!
verbose
&&
truncate
==
:auto
puts
Formatter
.
headline
(
title
,
color: :green
)
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