Skip to content

Commit e96ebfb

Browse files
committed
260222.211357.CET [skip ci] revise .cirrus.yml, using [ ] rather than [[ ]], as the latter is not POSIX / portable; this is important for .cirrus.yml, as the shell for it may not be bash
1 parent b6e5ba5 commit e96ebfb

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.cirrus.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ task:
9696
uname -a
9797
cat /etc/os-release || true
9898
99-
if [[ "$(uname)" == FreeBSD ]] ; then
99+
if [ "$(uname)" = FreeBSD ] ; then
100100
pkg update && pkg upgrade -y && pkg install -y bash gcc git cmake devel/gmake devel/gdb
101101
echo "MK=gmake" >> $CIRRUS_ENV
102102
elif grep -qi "fedora" /etc/os-release ; then
@@ -124,11 +124,11 @@ task:
124124
125125
cmake_test_script: |
126126
127-
if [[ "$(uname)" == FreeBSD ]] ; then
127+
if [ "$(uname)" = FreeBSD ] ; then
128128
echo "WARNING: CMake test is skipped on FreeBSD." >&2
129129
echo "The current CMake test is with gcc only; should test FreeBSD with Clang/LLVM." >&2
130130
exit 0
131-
elif [[ "$(arch)" == x86_64 ]] && grep -qi "alpine" /etc/os-release ; then
131+
elif [ "$(uname -m)" = x86_64 ] && grep -qi "alpine" /etc/os-release ; then
132132
echo "WARNING: CMake test is skipped on AMD64 Alpine." >&2
133133
echo "The current CMake test fails on AMD64 Alpine; should investigate the issue and fix it." >&2
134134
exit 0
@@ -160,13 +160,13 @@ task:
160160
NS=$(date +%N)
161161
NS=${NS#"${NS%%[!0]*}"} # Strip leading zeros, or the shell will interpret the number as octal and fail if it contains digits 8 or 9.
162162
SOLVER_NUM=$((${NS:-0} % 5)) # Use 0 if completely empty
163-
if [[ $SOLVER_NUM -eq 0 ]] ; then
163+
if [ $SOLVER_NUM -eq 0 ] ; then
164164
SOLVER=uobyqa
165-
elif [[ $SOLVER_NUM -eq 1 ]] ; then
165+
elif [ $SOLVER_NUM -eq 1 ] ; then
166166
SOLVER=newuoa
167-
elif [[ $SOLVER_NUM -eq 2 ]] ; then
167+
elif [ $SOLVER_NUM -eq 2 ] ; then
168168
SOLVER=bobyqa
169-
elif [[ $SOLVER_NUM -eq 3 ]] ; then
169+
elif [ $SOLVER_NUM -eq 3 ] ; then
170170
SOLVER=lincoa
171171
else
172172
SOLVER=cobyla

0 commit comments

Comments
 (0)