From 47ccd6638d55a8b92eb6b985dcfc085ac188e6ac Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Mon, 24 Feb 2020 20:10:10 -0300 Subject: [PATCH] Added -o pipefail to all set -e ensuring the build fails when some operation with pipe exits error status. # Conflicts: # Makefile --- .github/scripts/contrib.sh | 2 +- Makefile | 10 +++++----- README.contributing | 2 +- qt/i18n/build-mo-files | 2 +- qt/i18n/copy-qt-files | 2 +- qt/i18n/sync-po-git | 2 +- qt/i18n/update-po-template | 2 +- qt/tools/build_ui.sh | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/scripts/contrib.sh b/.github/scripts/contrib.sh index 438aa7ebf..055e917ae 100755 --- a/.github/scripts/contrib.sh +++ b/.github/scripts/contrib.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eo pipefail antispam=", at the domain " diff --git a/Makefile b/Makefile index a2d8a7d44..2a90b3e11 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ buildhash: .PHONY: develop develop: pyenv buildhash - @set -e && \ + @set -eo pipefail && \ . pyenv/bin/activate && \ for dir in $(DEVEL); do \ $(SUBMAKE) -C $$dir develop BUILDFLAGS="$(BUILDFLAGS)"; \ @@ -42,7 +42,7 @@ develop: pyenv buildhash .PHONY: run run: develop - @set -e && \ + @set -eo pipefail && \ . pyenv/bin/activate && \ echo "Starting Anki..."; \ qt/runanki $(RUNFLAGS) @@ -69,7 +69,7 @@ build-qt: .PHONY: clean clean: clean-dist - @set -e && \ + @set -eo pipefail && \ for dir in $(DEVEL); do \ $(SUBMAKE) -C $$dir clean; \ done @@ -80,7 +80,7 @@ clean-dist: .PHONY: check check: pyenv buildhash - @set -e && \ + @set -eo pipefail && \ for dir in $(CHECKABLE_RS); do \ $(SUBMAKE) -C $$dir check; \ done; \ @@ -95,7 +95,7 @@ check: pyenv buildhash .PHONY: fix fix: - @set -e && \ + @set -eo pipefail && \ . pyenv/bin/activate && \ for dir in $(CHECKABLE_RS) $(CHECKABLE_PY); do \ $(SUBMAKE) -C $$dir fix; \ diff --git a/README.contributing b/README.contributing index 645d59218..80a2bd88c 100644 --- a/README.contributing +++ b/README.contributing @@ -104,7 +104,7 @@ You can do this automatically by adding the following into .git/hooks/pre-commit or .git/hooks/pre-push and making it executable. #!/bin/bash -set -e +set -eo pipefail make check You may need to adjust the PATH variable so that things like a local install diff --git a/qt/i18n/build-mo-files b/qt/i18n/build-mo-files index 9d0136087..3d3ecc3ee 100755 --- a/qt/i18n/build-mo-files +++ b/qt/i18n/build-mo-files @@ -14,5 +14,5 @@ do perl -pe "s%po/desktop/(.*)/anki.po%$targetDir/\1/LC_MESSAGES%") outfile="$outdir/anki.mo" mkdir -p $outdir - msgmerge --for-msgfmt "$file" po/desktop/anki.pot | msgfmt - --output-file=$outfile + msgmerge --for-msgfmt "$file" po/desktop/anki.pot | msgfmt - --output-file="$outfile" done diff --git a/qt/i18n/copy-qt-files b/qt/i18n/copy-qt-files index fe6210b18..6955bc4ea 100755 --- a/qt/i18n/copy-qt-files +++ b/qt/i18n/copy-qt-files @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eo pipefail out=../aqt_data/locale/qt mkdir -p $out diff --git a/qt/i18n/sync-po-git b/qt/i18n/sync-po-git index b085d3113..5d5910185 100755 --- a/qt/i18n/sync-po-git +++ b/qt/i18n/sync-po-git @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -eo pipefail # pull any pending changes from git repos ./pull-git diff --git a/qt/i18n/update-po-template b/qt/i18n/update-po-template index 3c8323c4e..a67197e01 100755 --- a/qt/i18n/update-po-template +++ b/qt/i18n/update-po-template @@ -2,7 +2,7 @@ # # update template .pot file from source code strings # -set -e +set -eo pipefail topDir=$(dirname $0)/../.. cd $topDir diff --git a/qt/tools/build_ui.sh b/qt/tools/build_ui.sh index 33deeb4df..80e28d37a 100755 --- a/qt/tools/build_ui.sh +++ b/qt/tools/build_ui.sh @@ -4,7 +4,7 @@ # should be on the path. # -set -e +set -eo pipefail if [ ! -d "designer" ] then