|
|
@@ -232,11 +232,10 @@ task :ci_setup_cache do
|
|
|
matched = /.*-([^-]+-[^-]+)$/.match(ENV['TRAVIS_BRANCH'])
|
|
|
base_mirror = matched ? matched[1] : nil
|
|
|
# Do not abort even when it fails here
|
|
|
- system "if ! `git clone -q --depth 1 --branch #{ENV['TRAVIS_BRANCH']}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then if ! [ #{base_mirror} ] || ! `git clone -q --depth 1 --branch #{base_mirror}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then git clone -q --depth 1 https://github.com/#{repo_slug} ~/.ccache 2>/dev/null; fi && cd ~/.ccache && git checkout -qf -b #{ENV['TRAVIS_BRANCH']}#{job_number}; fi"
|
|
|
+ system "if ! `git clone -q --depth 1 --branch #{ENV['TRAVIS_BRANCH']}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then if ! [ #{base_mirror} ] || ! `git clone -q --depth 1 --branch #{base_mirror}#{job_number} https://github.com/#{repo_slug} ~/.ccache 2>/dev/null`; then git clone -q --depth 1 https://github.com/#{repo_slug} ~/.ccache 2>/dev/null; fi && cd ~/.ccache && git checkout -qf -b #{ENV['TRAVIS_BRANCH']}#{job_number}; fi && cd ~/.ccache && mtime=$(git log --format=%ci -n1 README.md); find . -exec touch -d \"$mtime\" {} \;"
|
|
|
end
|
|
|
- system 'ccache -z -M 100M'
|
|
|
# Clear ccache on demand
|
|
|
- system 'ccache -C' if /\[ccache clear\]/ =~ ENV['COMMIT_MESSAGE']
|
|
|
+ system "ccache -z -M 100M #{/\[ccache clear\]/ =~ ENV['COMMIT_MESSAGE'] ? '-C' : ''}"
|
|
|
end
|
|
|
|
|
|
# Usage: NOT intended to be used manually
|