From: Thanh Ha Date: Tue, 10 Apr 2018 20:27:23 +0000 (-0400) Subject: Force rm for cleanup macro X-Git-Tag: v0.18.0~10 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;ds=sidebyside;h=d0059ff8d3d0db756b6aa6dc07a421bfd5e29247;p=releng%2Fglobal-jjb.git Force rm for cleanup macro Using -f (force) rm will return a 0 status and not print a message if a file is not found. Issue: RELENG-880 Change-Id: Ia06166362526cf00754b4a21e6b977d57fe91db6 Signed-off-by: Thanh Ha --- diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 133becdc..fb24a621 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -165,12 +165,12 @@ #!/bin/bash set +e # DO NOT cause build failure if any of the rm calls fail. - rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" + rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE" # In some cases we use the lf-provide-maven-settings macro to produce # a "$HOME/.netrc" file containing credentials. Remove that file here # too if it exists. - rm "$HOME/.netrc" + rm -f "$HOME/.netrc" # DO NOT fail build if any of the above lines fail. exit 0