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
769d89de
Commit
769d89de
authored
6 years ago
by
Markus Reiter
Browse files
Options
Downloads
Patches
Plain Diff
Resolve formulae in `brew cleanup`.
parent
ca86f070
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/cleanup.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/cleanup.rb
Library/Homebrew/extend/ARGV.rb
+1
-29
1 addition, 29 deletions
Library/Homebrew/extend/ARGV.rb
Library/Homebrew/formulary.rb
+32
-0
32 additions, 0 deletions
Library/Homebrew/formulary.rb
with
34 additions
and
30 deletions
Library/Homebrew/cleanup.rb
+
1
−
1
View file @
769d89de
...
...
@@ -166,7 +166,7 @@ module Homebrew
else
args
.
each
do
|
arg
|
formula
=
begin
Formula
[
arg
]
Formula
ry
.
resolve
(
arg
)
rescue
FormulaUnavailableError
,
TapFormulaAmbiguityError
,
TapFormulaWithOldnameAmbiguityError
nil
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/extend/ARGV.rb
+
1
−
29
View file @
769d89de
...
...
@@ -54,35 +54,7 @@ module HomebrewArgvExtension
def
resolved_formulae
require
"formula"
@resolved_formulae
||=
(
downcased_unique_named
-
casks
).
map
do
|
name
|
if
name
.
include?
(
"/"
)
||
File
.
exist?
(
name
)
f
=
Formulary
.
factory
(
name
,
spec
)
if
f
.
any_version_installed?
tab
=
Tab
.
for_formula
(
f
)
resolved_spec
=
spec
(
nil
)
||
tab
.
spec
f
.
active_spec
=
resolved_spec
if
f
.
send
(
resolved_spec
)
f
.
build
=
tab
if
f
.
head?
&&
tab
.
tabfile
k
=
Keg
.
new
(
tab
.
tabfile
.
parent
)
f
.
version
.
update_commit
(
k
.
version
.
version
.
commit
)
if
k
.
version
.
head?
end
end
else
rack
=
Formulary
.
to_rack
(
name
)
alias_path
=
Formulary
.
factory
(
name
).
alias_path
f
=
Formulary
.
from_rack
(
rack
,
spec
(
nil
),
alias_path:
alias_path
)
end
# If this formula was installed with an alias that has since changed,
# then it was specified explicitly in ARGV. (Using the alias would
# instead have found the new formula.)
#
# Because of this, the user is referring to this specific formula,
# not any formula targetted by the same alias, so in this context
# the formula shouldn't be considered outdated if the alias used to
# install it has changed.
f
.
follow_installed_alias
=
false
f
Formulary
.
resolve
(
name
,
spec:
spec
(
nil
))
end
.
uniq
(
&
:name
)
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/formulary.rb
+
32
−
0
View file @
769d89de
...
...
@@ -47,6 +47,38 @@ module Formulary
cache
[
path
]
=
klass
end
def
self
.
resolve
(
name
,
spec:
nil
)
if
name
.
include?
(
"/"
)
||
File
.
exist?
(
name
)
f
=
factory
(
name
,
*
spec
)
if
f
.
any_version_installed?
tab
=
Tab
.
for_formula
(
f
)
resolved_spec
=
spec
||
tab
.
spec
f
.
active_spec
=
resolved_spec
if
f
.
send
(
resolved_spec
)
f
.
build
=
tab
if
f
.
head?
&&
tab
.
tabfile
k
=
Keg
.
new
(
tab
.
tabfile
.
parent
)
f
.
version
.
update_commit
(
k
.
version
.
version
.
commit
)
if
k
.
version
.
head?
end
end
else
rack
=
to_rack
(
name
)
alias_path
=
factory
(
name
).
alias_path
f
=
from_rack
(
rack
,
*
spec
,
alias_path:
alias_path
)
end
# If this formula was installed with an alias that has since changed,
# then it was specified explicitly in ARGV. (Using the alias would
# instead have found the new formula.)
#
# Because of this, the user is referring to this specific formula,
# not any formula targetted by the same alias, so in this context
# the formula shouldn't be considered outdated if the alias used to
# install it has changed.
f
.
follow_installed_alias
=
false
f
end
def
self
.
ensure_utf8_encoding
(
io
)
io
.
set_encoding
(
Encoding
::
UTF_8
)
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