Improve uncrustify.sh return code handling
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 11 Sep 2014 17:44:38 +0000 (20:44 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 11 Sep 2014 22:40:59 +0000 (00:40 +0200)
Apparently, the exit code for the script does not work on Jenkins.
I can only guess whether this is caused by different bash (with some
differences in the support for set -o pipefail) or git versions (with
different behavior of the --exit-code flag in combination with the other
flags), or something else, but these changes seem to make it work.

Apply uncrustify with reformat_all.sh to fix any issues that have been
slipped through so far.

Change-Id: I005eed88f839014f38992826ad7b984b8ad3597e

admin/uncrustify.sh
src/gromacs/mdlib/domdec.cpp

index e9590bdab3d51b87b63ea7e01ac738fba3b5857d..1391214ec63de935bceea195b6f93d5bd9bffbeb 100755 (executable)
@@ -286,10 +286,10 @@ if [[ $action == diff-* ]] ; then
 fi
 
 # Find the changed files
+git diff --no-index --name-only --exit-code org/ new/ | \
+    sed -e 's#new/##' > $tmpdir/changed
 changes=
-set -o pipefail
-if ! git diff --no-index --name-only --exit-code org/ new/ | \
-         sed -e 's#new/##' > $tmpdir/changed
+if [[ -s $tmpdir/changed ]]
 then
     changes=1
 fi
index 6c182cc12dc01a2f3a68916509f876bf713161b1..e3de5a97d99b67ce2cbe4084f58a0e63e1b5414d 100644 (file)
@@ -787,7 +787,7 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
         /* Only forces in domains near the PBC boundaries need to
            consider PBC in the treatment of fshift */
         bShiftForcesNeedPbc   = (dd->ci[dd->dim[d]] == 0);
-        bScrew = (bShiftForcesNeedPbc && dd->bScrewPBC && dd->dim[d] == XX);
+        bScrew                = (bShiftForcesNeedPbc && dd->bScrewPBC && dd->dim[d] == XX);
         if (fshift == NULL && !bScrew)
         {
             bShiftForcesNeedPbc = FALSE;