[PATCH v1 05/19] travis.yml: Fix the ccache lines

Alex Bennée posted 19 patches 6 years, 3 months ago
Maintainers: Fam Zheng <fam@euphon.net>, Max Reitz <mreitz@redhat.com>, Brad Smith <brad@comstyle.com>, Kamil Rytarowski <kamil@netbsd.org>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Kevin Wolf <kwolf@redhat.com>
[PATCH v1 05/19] travis.yml: Fix the ccache lines
Posted by Alex Bennée 6 years, 3 months ago
From: Thomas Huth <thuth@redhat.com>

The "command -v ccache && ccache ..." likely were supposed to test
the availability of ccache before running the program. But this
shell construct causes Travis to abort if ccache is not available.
Use an if-statement instead to fix this problem.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20191009170701.14756-5-thuth@redhat.com>
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index e65e53f3d7e..7e0d4ad2b31 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -91,13 +91,13 @@ git:
 
 before_script:
   - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi
-  - command -v ccache && ccache --zero-stats
+  - if command -v ccache ; then ccache --zero-stats ; fi
   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
 script:
   - make -j3 && travis_retry ${TEST_CMD}
 after_script:
-  - command -v ccache && ccache --show-stats
+  - if command -v ccache ; then ccache --show-stats ; fi
 
 
 matrix:
-- 
2.20.1


Re: [PATCH v1 05/19] travis.yml: Fix the ccache lines
Posted by Philippe Mathieu-Daudé 6 years, 3 months ago
On 10/22/19 9:16 PM, Alex Bennée wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> The "command -v ccache && ccache ..." likely were supposed to test
> the availability of ccache before running the program. But this
> shell construct causes Travis to abort if ccache is not available.
> Use an if-statement instead to fix this problem.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> Message-Id: <20191009170701.14756-5-thuth@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   .travis.yml | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index e65e53f3d7e..7e0d4ad2b31 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -91,13 +91,13 @@ git:
>   
>   before_script:
>     - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi
> -  - command -v ccache && ccache --zero-stats
> +  - if command -v ccache ; then ccache --zero-stats ; fi
>     - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
>     - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
>   script:
>     - make -j3 && travis_retry ${TEST_CMD}
>   after_script:
> -  - command -v ccache && ccache --show-stats
> +  - if command -v ccache ; then ccache --show-stats ; fi
>   
>   
>   matrix:
>