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
8b4197dd
Commit
8b4197dd
authored
4 years ago
by
Tie
Browse files
Options
Downloads
Patches
Plain Diff
make suggestions round 2
parent
afd7bb88
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/cmd/autoremove.rb
+6
-9
6 additions, 9 deletions
Library/Homebrew/cmd/autoremove.rb
with
6 additions
and
9 deletions
Library/Homebrew/cmd/autoremove.rb
+
6
−
9
View file @
8b4197dd
...
...
@@ -13,10 +13,10 @@ module Homebrew
usage_banner
<<~
EOS
`autoremove` [<options>]
Remove packages
that were
n't
installed
on request
and are no longer needed.
Uninstall formulae
that were
only
installed
as a dependency of another formula
and are
now
no longer needed.
EOS
switch
"-n"
,
"--dry-run"
,
description:
"
Just prin
t what would be
removed
."
description:
"
Lis
t what would be
uninstalled, but do not actually uninstall anything
."
named
0
end
end
...
...
@@ -26,7 +26,7 @@ module Homebrew
Tab
.
for_keg
(
f
.
any_installed_keg
).
installed_on_request
end
removable_formulae
+=
get_removable_formulae
(
formulae
-
removable_formulae
)
if
removable_formulae
.
any
?
removable_formulae
+=
get_removable_formulae
(
formulae
-
removable_formulae
)
if
removable_formulae
.
present
?
removable_formulae
end
...
...
@@ -35,18 +35,15 @@ module Homebrew
args
=
autoremove_args
.
parse
removable_formulae
=
get_removable_formulae
(
Formula
.
installed
)
return
if
removable_formulae
.
blank?
formulae_names
=
removable_formulae
.
map
(
&
:full_name
).
sort
intent
=
args
.
dry_run?
?
"could"
:
"will"
oh1
"Formulae that
#{
intent
}
be removed"
puts
formulae_names
verb
=
args
.
dry_run?
?
"Would uninstall"
:
"Uninstalling"
oh1
"
#{
verb
}
#{
formulae_names
.
count
}
unneeded
#{
"formula"
.
pluralize
(
formulae_names
.
count
)
}
:"
puts
formulae_names
.
join
(
"
\n
"
)
return
if
args
.
dry_run?
puts
kegs_by_rack
=
removable_formulae
.
map
(
&
:any_installed_keg
).
group_by
(
&
:rack
)
Uninstall
.
uninstall_kegs
(
kegs_by_rack
)
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