diff options
| author | Aidan Hobson Sayers <aidanhs@cantab.net> | 2017-04-04 22:51:16 +0100 |
|---|---|---|
| committer | Aidan Hobson Sayers <aidanhs@cantab.net> | 2017-04-04 23:41:38 +0100 |
| commit | b970bc2a79719b5c1573fb87c96773ce131dbb8d (patch) | |
| tree | 804e1a1fb9493a6bc68dd2989d7836127499a71a /src/ci | |
| parent | 2564711e803f62e04bebf10408cc1c11297c0caf (diff) | |
| download | rust-b970bc2a79719b5c1573fb87c96773ce131dbb8d.tar.gz rust-b970bc2a79719b5c1573fb87c96773ce131dbb8d.zip | |
Enable appveyor cache, add more paranoia
Diffstat (limited to 'src/ci')
| -rwxr-xr-x | src/ci/init_repo.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh index 4e22907d979..c235681cddd 100755 --- a/src/ci/init_repo.sh +++ b/src/ci/init_repo.sh @@ -38,9 +38,20 @@ fi # Wipe the cache if it's not valid, or mark it as invalid while we update it if [ ! -f "$cache_valid_file" ]; then - rm -rf "$CACHE_DIR" && mkdir "$CACHE_DIR" + rm -rf "$CACHE_DIR" + mkdir "$CACHE_DIR" else - rm "$cache_valid_file" + stat_lines=$(cd "$cache_src_dir" && git status --porcelain | wc -l) + stat_ec=$(cd "$cache_src_dir" && git status >/dev/null 2>&1 && echo $?) + if [ ! -d "$cache_src_dir/.git" -o $stat_lines != 0 -o $stat_ec != 0 ]; then + # Something is badly wrong - the cache valid file is here, but something + # about the git repo is fishy. Nuke it all, just in case + echo "WARNING: $cache_valid_file exists but bad repo: l:$stat_lines, ec:$stat_ec" + rm -rf "$CACHE_DIR" + mkdir "$CACHE_DIR" + else + rm "$cache_valid_file" + fi fi # Update the cache (a pristine copy of the rust source master) |
