mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
delete outdated files of brew bottles
This commit is contained in:
parent
1ce33b533d
commit
04beb1e2f1
@ -24,6 +24,7 @@ do
|
||||
repo_name="homebrew-${tap}"
|
||||
args="mac"
|
||||
fi
|
||||
remote_filelist="$HOMEBREW_CACHE/filelist.txt"
|
||||
|
||||
echo "===== SYNC STARTED AT $(date -R) ====="
|
||||
dir_core=/home/homebrew/.linuxbrew/homebrew/Library/Taps/homebrew/homebrew-core
|
||||
@ -33,4 +34,13 @@ do
|
||||
echo ""
|
||||
echo "> RUN brew bottle-mirror $args..."
|
||||
/home/homebrew/.linuxbrew/bin/brew bottle-mirror "$args"
|
||||
if [[ -f "$remote_filelist" ]];then # clean outdated files
|
||||
local_filelist=/tmp/filelist.local
|
||||
(cd ${HOMEBREW_CACHE}; find . -type f -iname "*.tmp" -delete)
|
||||
(cd ${HOMEBREW_CACHE}; find . -type f -iname "*.tar.gz") | sed 's+^\./++' > $local_filelist
|
||||
comm <(sort $remote_filelist) <(sort $local_filelist) -13 | while read file; do
|
||||
echo "deleting ${HOMEBREW_CACHE}/${file}"
|
||||
rm "${HOMEBREW_CACHE}/${file}"
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user