ci/travis: Don't destroy cache during prepare

Use `cp -r` instead of `mv`.
Remove use of `dirname`, that was missed in 10cdf8c286.

closes #5166
This commit is contained in:
Justin M. Keyes 2018-03-11 20:15:30 +01:00
parent 241c380da9
commit c7f95fde1b
2 changed files with 13 additions and 11 deletions

View File

@ -4,6 +4,7 @@ set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
# Don't cache pip's log and selfcheck.
@ -15,5 +16,5 @@ if ended_successfully; then
rm -rf "${HOME}/.cache/nvim-deps"
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))."
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
fi

View File

@ -1,3 +1,11 @@
_stat() {
if test "${TRAVIS_OS_NAME}" = osx ; then
stat -f %Sm "${@}"
else
stat -c %y "${@}"
fi
}
top_make() {
echo '================================================================================'
# Travis has 1.5 virtual cores according to:
@ -19,19 +27,12 @@ build_deps() {
fi
rm -rf "${DEPS_BUILD_DIR}"
mkdir -p "${DEPS_BUILD_DIR}"
# Use cached dependencies if $CACHE_MARKER exists.
if test -f "${CACHE_MARKER}" && ! test "${CACHE_ENABLE}" = "false" ; then
local statcmd="stat -c '%y'"
if test "${TRAVIS_OS_NAME}" = osx ; then
statcmd="stat -f '%Sm'"
fi
echo "Using third-party dependencies from Travis cache (last update: $(${statcmd} "${CACHE_MARKER}"))."
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
else
mkdir -p "${DEPS_BUILD_DIR}"
echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))."
cp -r "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
fi
# Even if we're using cached dependencies, run CMake and make to