Skip to content

Commit

Permalink
Merge pull request #644 from sjamgade/ccache_version_update
Browse files Browse the repository at this point in the history
ccache: it was updated to expect a suffix for -evict-older-than option
  • Loading branch information
adrianschroeter committed Jan 11, 2021
2 parents a2e2c81 + 8ff302e commit bac1f6a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -1611,8 +1611,11 @@ if test -n "$CCACHE" ; then
if test -n "$REMOVE_CCACHE" ; then
echo "... cleaning ccache"
test_cmd="ccache -h | grep -c evict-older-than"
clean_cmd="ccache --evict-older-than $(($(date +%s) - $CCACHE_SETUP_START_TIME))"
chroot $BUILD_ROOT su -c "$test_cmd && $clean_cmd" - $BUILD_USER
# ccache -Version >= 4.0
clean_cmd_with_suffix="ccache --evict-older-than $(($(date +%s) - $CCACHE_SETUP_START_TIME))s"
# older version with the patch (without patch, $test_cmd would fail)
clean_cmd_without_suffix="ccache --evict-older-than $(($(date +%s) - $CCACHE_SETUP_START_TIME))"
chroot $BUILD_ROOT su -c "($test_cmd && $clean_cmd_with_suffix) || ($test_cmd && $clean_cmd_without_suffix)" - $BUILD_USER
fi
echo "... saving ccache"
tar ${REMOVE_CCACHE:+--remove-files} -cf "$BUILD_ROOT/$TOPDIR/OTHER/_ccache.tar" -C "$BUILD_ROOT/.ccache/" .
Expand Down

0 comments on commit bac1f6a

Please sign in to comment.