File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,22 @@ ls "$HOME/.cache/"
4
4
5
5
PYX_CACHE_DIR=" $HOME /.cache/pyxfiles"
6
6
pyx_file_list=` find ${TRAVIS_BUILD_DIR} -name " *.pyx" `
7
+ pyx_cache_file_list=` find ${PYX_CACHE_DIR} -name " *.pyx" `
8
+
7
9
CACHE_File=" $HOME /.cache/cython_files.tar"
8
10
11
+ # Clear the cython cache 0 = NO, 1 = YES
9
12
clear_cache=0
13
+
14
+ pyx_files=` echo " $pyx_file_list " | wc -l`
15
+ pyx_cache_files=` echo " $pyx_cache_file_list " | wc -l`
16
+
17
+ if [[ pyx_files -ne pyx_cache_files ]]
18
+ then
19
+ echo " Different number of pyx files"
20
+ clear_cache=1
21
+ fi
22
+
10
23
home_dir=$( pwd)
11
24
12
25
if [ -f " $CACHE_File " ] && [ " $USE_CACHE " ] && [ -d " $PYX_CACHE_DIR " ]; then
@@ -44,17 +57,17 @@ if [ -f "$CACHE_File" ] && [ "$USE_CACHE" ] && [ -d "$PYX_CACHE_DIR" ]; then
44
57
45
58
fi
46
59
47
- if [ $clear_cache -eq 1 ] && [ " $USE_CACHE " ]
60
+ if [ $clear_cache -eq 0 ] && [ " $USE_CACHE " ]
48
61
then
49
- # nope, reuse cython files
62
+ # No and use_cache is set
50
63
echo " Will reuse cached cython file"
51
64
cd /
52
65
tar xvmf $CACHE_File
53
66
cd $home_dir
54
67
else
55
68
echo " Rebuilding cythonized files"
56
- echo " Use cache = $USE_CACHE "
57
- echo " Clear cache = $clear_cache "
69
+ echo " Use cache (Blank if not set) = $USE_CACHE "
70
+ echo " Clear cache (1=YES) = $clear_cache "
58
71
fi
59
72
60
73
You can’t perform that action at this time.
0 commit comments