Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
2aa6c6f6
Commit
2aa6c6f6
authored
Sep 09, 2020
by
Ed Reel
Committed by
GitHub
Sep 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clear_cache package (#4282)
parent
0ca8c6a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
packages/clear_cache.rb
packages/clear_cache.rb
+40
-0
No files found.
packages/clear_cache.rb
0 → 100644
View file @
2aa6c6f6
require
'package'
class
Clear_cache
<
Package
description
'Script to remove system cache files'
homepage
'https://github.com/skycocker/chromebrew/wiki/FAQ'
version
'1.0'
compatibility
'all'
source_url
'file:///dev/null'
source_sha256
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
def
self
.
build
system
"cat << 'EOF' > clear-cache
#!/bin/bash
cd
\$
HOME
SPACE_BEFORE=
\$
(du -s | cut -f1)
SPACE_BEFORE_HUMAN=
\$
(du -hs | cut -f1)
DIRS=
\"
.cache Cache Application_Cache Code_Cache GCache GPUCache Service_Worker
\"
for D in
\$
DIRS; do
DIR=
\$
(echo
\$
D | sed
\'
s,_, ,
\'
)
[ -d
\"\$
DIR
\"
] && rm -rf
\"\$
DIR
\"
done
SPACE_AFTER=
\$
(du -s | cut -f1)
SPACE_AFTER_HUMAN=
\$
(du -hs | cut -f1)
SPACE_RECOVERED=
\$
((
\$
SPACE_BEFORE-
\$
SPACE_AFTER))
echo
\"
Space used before:
\$
SPACE_BEFORE_HUMAN
\"
echo
\"
Space used after:
\$
SPACE_AFTER_HUMAN
\"
echo
\"
Space recovered:
\$
{SPACE_RECOVERED}KB
\"
EOF"
end
def
self
.
install
system
"install -Dm755 clear-cache
#{
CREW_DEST_PREFIX
}
/bin/clear-cache"
end
def
self
.
postinstall
puts
puts
"Type 'clear-cache' to remove system cache files."
.
lightblue
puts
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment