From 3c0732ac2ada2ce6d57620596773648671b627d0 Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sat, 12 May 2018 17:00:56 +0200 Subject: [PATCH] fix(travis): no xrm build failure install_xcb_xrm.sh takes advantage of the travis cache but it doesn't actually install the libraries on the system when it finds that the compilation has been cached. --- common/travis/install_xcb_xrm.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/common/travis/install_xcb_xrm.sh b/common/travis/install_xcb_xrm.sh index d2d94570..46a544b7 100755 --- a/common/travis/install_xcb_xrm.sh +++ b/common/travis/install_xcb_xrm.sh @@ -1,9 +1,20 @@ #!/bin/bash -if [ -z "$(ls -A "${DEPS_DIR}/xcb-util-xrm" 2>/dev/null)" ]; then + +# Fail on error +set -e + +# If the Makefile exists, we have already cached xrm +if [ ! -e "${DEPS_DIR}/xcb-util-xrm/Makefile" ]; then git clone --recursive https://github.com/Airblader/xcb-util-xrm - cd xcb-util-xrm && { - ./autogen.sh --prefix=/usr --libdir=/usr/lib - make - sudo make install - } fi + +cd xcb-util-xrm + +# Install xrm on the system +# If that doesn't work for some reason (not yet compiled, corrupt cache) +# we compile xrm and try to install it again +sudo make install || { + ./autogen.sh --prefix=/usr --libdir=/usr/lib + make + sudo make install +}