File: check_cache.sh

package info (click to toggle)
pandas 1.1.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 47,284 kB
  • sloc: python: 292,793; ansic: 8,591; sh: 608; makefile: 94
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