10000 more accurate cleaning of Homebrew dirs · opencv/opencv-python@01df5ed · GitHub
[go: up one dir, main page]

Skip to content

Commit 01df5ed

Browse files
committed
more accurate cleaning of Homebrew dirs
1 parent cf601a1 commit 01df5ed

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

.travis.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,21 @@ before_install: |
524524
source multibuild_customize.sh
525525
echo $ENABLE_CONTRIB > contrib.enabled
526526
echo $ENABLE_HEADLESS > headless.enabled
527+
528+
if [ -n "$IS_OSX" ]; then
529+
TAPS="$(brew --repository)/Library/Taps"
530+
if [ -e "$TAPS/caskroom/homebrew-cask" -a -e "$TAPS/homebrew/homebrew-cask" ]; then
531+
rm -rf "$TAPS/caskroom/homebrew-cask"
532+
fi
533+
find "$TAPS" -type d -name .git -exec \
534+
bash -xec '
535+
cd $(dirname '\''{}'\'')
536+
git clean -fxd
537+
git status' \;
538+
539+
brew_cache_cleanup
540+
fi
541+
527542
before_install
528543
# Not interested in travis internal scripts' output
529544
set +x
@@ -552,15 +567,9 @@ before_cache: |
552567
if [ -n "$IS_OSX" ]; then
553568
554569
# When Taps is cached, this dir causes "Error: file exists" on `brew update`
555-
rm -rf "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask"
556-
find "$(brew --repository)/Library/Taps" -type d -name .git -exec \
557-
bash -xec '
558-
cd $(dirname '\''{}'\'')
559-
git status
560-
# https://stackoverflow.com/questions/8296710/how-to-ignore-xargs-commands-if-stdin-input-is-empty/19038748#19038748
561-
git ls-files --other -z | xargs -0 -n100 git add
562-
git commit -a -m "Travis auto changes"
563-
[[ -n $(git stash list) ]] && git stash drop' \;
570+
if [ -e "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask" ]; then
571+
rm -rf "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask"
572+
fi
564573
565574
brew_cache_cleanup
566575

travis_osx_brew_cache.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,14 @@ function brew_cache_cleanup {
174174
# so we're saving and restoring them
175175
local BOTTLE_LINK BOTTLE
176176
for BOTTLE_LINK in "$BREW_LOCAL_BOTTLE_METADATA"/*.lnk; do
177+
[ -e "$BOTTLE_LINK" ] || break
177178
BOTTLE=$(cat "$BOTTLE_LINK")
178179
ln "$BOTTLE" "$BREW_LOCAL_BOTTLE_METADATA/"
179180
done
180181
brew cleanup
181182
local BOTTLE_BASENAME
182183
for BOTTLE_LINK in "$BREW_LOCAL_BOTTLE_METADATA"/*.lnk; do
184+
[ -e "$BOTTLE_LINK" ] || break
183185
BOTTLE=$(cat "$BOTTLE_LINK")
184186
BOTTLE_BASENAME=$(basename "$BOTTLE")
185187
if test ! -e "$BOTTLE"; then

0 commit comments

Comments
 (0)
0