@@ -136,7 +136,7 @@ if [[ "${DEPS}" == "1" ]]; then
136136 fi
137137 elif [ " ${OS} " == " Darwin" ]; then
138138 if command -v brew & > /dev/null; then
139- HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake openssl ncurses xapian sqlite libmagic ossp-uuid w3m || exiterr " deps failed (${OS} brew), exiting."
139+ HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake openssl ncurses xapian sqlite libmagic ossp-uuid w3m 2> >( grep -vE " already installed|To reinstall|brew reinstall " >&2 ) || exiterr " deps failed (${OS} brew), exiting."
140140 elif command -v port & > /dev/null; then
141141 sudo port -N install openssl ncurses xapian-core sqlite3 libmagic ossp-uuid w3m || exiterr " deps failed (${OS} port), exiting."
142142 else
@@ -184,6 +184,13 @@ if [[ "${BUMP}" == "1" ]]; then
184184 fi
185185fi
186186
187+ # ccache zero stats
188+ if [[ " ${BUILD} " == " 1" ]] || [[ " ${DEBUG} " == " 1" ]]; then
189+ if command -v ccache & > /dev/null; then
190+ ccache -z > /dev/null
191+ fi
192+ fi
193+
187194# build
188195if [[ " ${BUILD} " == " 1" ]]; then
189196 echo " -- Using cmake ${CMAKEARGS} "
@@ -199,6 +206,19 @@ if [[ "${DEBUG}" == "1" ]]; then
199206 mkdir -p dbgbuild && cd dbgbuild && cmake ${CMAKEARGS} .. && make ${MAKEARGS} && cd .. || exiterr " debug build failed, exiting."
200207fi
201208
209+ # ccache stats
210+ if [[ " ${BUILD} " == " 1" ]] || [[ " ${DEBUG} " == " 1" ]]; then
211+ if command -v ccache & > /dev/null; then
212+ CCACHE_STATS=" $( ccache -s) "
213+ HITS=" $( echo " ${CCACHE_STATS} " | grep " Hits:" | head -1 | awk ' {print $2}' ) "
214+ MISSES=" $( echo " ${CCACHE_STATS} " | grep " Misses:" | head -1 | awk ' {print $2}' ) "
215+ TOTAL=" $( echo " ${CCACHE_STATS} " | grep " Hits:" | head -1 | awk ' {print $4}' ) "
216+ if [ -n " ${HITS} " ]; then
217+ echo " -- Ccache stats: ${HITS} hits, ${MISSES} misses, ${TOTAL} total."
218+ fi
219+ fi
220+ fi
221+
202222# tests
203223if [[ " ${TESTS} " == " 1" ]]; then
204224 true # currently this project has no tests
0 commit comments