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
9102c120
Unverified
Commit
9102c120
authored
6 years ago
by
Dominyk Tiller
Browse files
Options
Downloads
Patches
Plain Diff
cleanup: fix go_cache cleanup
parent
449c3ffa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/cleanup.rb
+7
-0
7 additions, 0 deletions
Library/Homebrew/cleanup.rb
with
7 additions
and
0 deletions
Library/Homebrew/cleanup.rb
+
7
−
0
View file @
9102c120
...
...
@@ -39,6 +39,12 @@ module CleanupRefinement
directory?
&&
%w[go_cache glide_home java_cache npm_cache gclient_cache]
.
include?
(
basename
.
to_s
)
end
def
go_cache_directory?
# Go makes its cache contents read-only to ensure cache integrity,
# which makes sense but is something we need to undo for cleanup.
directory?
&&
%w[go_cache]
.
include?
(
basename
.
to_s
)
end
def
prune?
(
days
)
return
false
unless
days
return
true
if
days
.
zero?
...
...
@@ -228,6 +234,7 @@ module Homebrew
entries
||=
[
cache
,
cache
/
"Cask"
].
select
(
&
:directory?
).
flat_map
(
&
:children
)
entries
.
each
do
|
path
|
FileUtils
.
chmod_R
0755
,
path
if
path
.
go_cache_directory?
&&
!
dry_run?
next
cleanup_path
(
path
)
{
path
.
unlink
}
if
path
.
incomplete?
next
cleanup_path
(
path
)
{
FileUtils
.
rm_rf
path
}
if
path
.
nested_cache?
...
...
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