Skip to content

Commit f48a6cc

Browse files
committed
compile-options: Fixed shellcheck warnings
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent c7ab562 commit f48a6cc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

build-scripts/compile-options

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Autodect PROJECT if not set
77

8-
if [ x"$PROJECT" = x ]
8+
if [ -z "$PROJECT" ]
99
then
1010
case x"$JOB_NAME" in
1111
*-community-*) PROJECT=community;;
@@ -18,9 +18,9 @@ fi
1818
# If still not set, then either we are running outside Jenkins, or this
1919
# is not a main "build" type job (it could be the bootstrap job).
2020
# Do directory-based auto-detection.
21-
if [ x"$PROJECT" = x ]
21+
if [ -z "$PROJECT" ]
2222
then
23-
if [ -d $BASEDIR/nova ]
23+
if [ -d "$BASEDIR"/nova ]
2424
then
2525
PROJECT=nova
2626
else
@@ -34,7 +34,7 @@ export PROJECT
3434
# When running manually, you can just export this variable.
3535
# It's a flag: if it's set to 1 - then we use system OpenSSL.
3636
# Otherwise, we build it.
37-
if [ x"$SYSTEM_SSL" = x ]
37+
if [ -z "$SYSTEM_SSL" ]
3838
then
3939
# We don't bundle OpenSSL on RHEL 8 (and newer in the future)
4040
if [ "$OS" = "rhel" ] && expr "$OS_VERSION" ">=" "8" >/dev/null
@@ -82,7 +82,7 @@ case "$OS_FAMILY" in
8282
esac
8383

8484
# When we don't bundle OpenSSL, then we need to pull it from /usr/lib64.
85-
if [ x"$SYSTEM_SSL" = x1 ]
85+
if [ "$SYSTEM_SSL" = 1 ]
8686
then
8787
LDFLAGS="$LDFLAGS -L/usr/lib64"
8888
fi
@@ -100,7 +100,7 @@ EMBEDDED_DB="lmdb"
100100
############### Fill in build dependencies in DEPS variable ################
101101

102102
DEPS=
103-
[ $OS_FAMILY = mingw ] && var_append DEPS "pthreads-w32 libgnurx"
103+
[ "$OS_FAMILY" = mingw ] && var_append DEPS "pthreads-w32 libgnurx"
104104

105105
# libgcc_s.so is needed before we compile any other dependency
106106
# on some platforms!
@@ -110,7 +110,7 @@ esac
110110

111111
var_append DEPS "$EMBEDDED_DB pcre2"
112112

113-
if ! [ x"$SYSTEM_SSL" = x1 ]
113+
if ! [ "$SYSTEM_SSL" = 1 ]
114114
then
115115
# FIXME: Why do we need zlib?
116116
# ANSWER: Openssl uses it optionally, TODO DISABLE
@@ -160,7 +160,7 @@ case "$EXPLICIT_ROLE" in
160160
hub) ROLE=hub;;
161161
*)
162162
# Not running under Jenkins?
163-
if [ x"$JENKINS_SERVER_COOKIE" = x ]
163+
if [ -z "$JENKINS_SERVER_COOKIE" ]
164164
then
165165
case "$PROJECT-$ARCH-$OS-${OS_VERSION}" in
166166
community-*) ROLE=agent;;

0 commit comments

Comments
 (0)