File: check_cache.sh

package info (click to toggle)
pandas 0.23.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 167,704 kB
  • sloc: python: 230,826; ansic: 11,317; sh: 682; makefile: 133
file content (27 lines) | stat: -rwxr-xr-x 781 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

# currently not used
# script to make sure that cache is clean
# Travis CI now handles this

if [ "$TRAVIS_PULL_REQUEST" == "false" ]
then
    echo "Not a PR: checking for changes in ci/ from last 2 commits"
    git diff HEAD~2 --numstat | grep -E "ci/"
    ci_changes=$(git diff HEAD~2 --numstat | grep -E "ci/"| wc -l)
else
    echo "PR: checking for changes in ci/ from last 2 commits"
    git fetch origin pull/${TRAVIS_PULL_REQUEST}/head:PR_HEAD
    git diff PR_HEAD~2 --numstat | grep -E "ci/"
    ci_changes=$(git diff PR_HEAD~2 --numstat | grep -E "ci/"| wc -l)
fi

CACHE_DIR="$HOME/.cache/"
CCACHE_DIR="$HOME/.ccache/"

if [ $ci_changes -ne 0 ]
then
    echo "Files have changed in ci/ deleting all caches"
    rm -rf "$CACHE_DIR"
    rm -rf "$CCACHE_DIR"
fi