55
66# Autodect PROJECT if not set
77
8- if [ x " $PROJECT " = x ]; then
9- case x " $JOB_NAME " in
8+ if [ -z " $PROJECT " ]; then
9+ case " $JOB_NAME " in
1010 * -community-* ) PROJECT=community ;;
1111 * -enterprise-* ) PROJECT=nova ;;
1212 * -hub-* ) PROJECT=nova ;;
1717# If still not set, then either we are running outside Jenkins, or this
1818# is not a main "build" type job (it could be the bootstrap job).
1919# Do directory-based auto-detection.
20- if [ x " $PROJECT " = x ]; then
21- if [ -d $BASEDIR /nova ]; then
20+ if [ -z " $PROJECT " ]; then
21+ if [ -d " $BASEDIR " /nova ]; then
2222 PROJECT=nova
2323 else
2424 PROJECT=community
@@ -31,7 +31,7 @@ export PROJECT
3131# When running manually, you can just export this variable.
3232# It's a flag: if it's set to 1 - then we use system OpenSSL.
3333# Otherwise, we build it.
34- if [ x " $SYSTEM_SSL " = x ]; then
34+ if [ -z " $SYSTEM_SSL " ]; then
3535 # We don't bundle OpenSSL on some redhat-derived systems due to incompatability with libpam and our openssl.
3636 _OS_MAJOR_VERSION=" $( echo " $OS_VERSION " | cut -d. -f1) "
3737 if [ " $OS " = " rhel" ] && expr " $_OS_MAJOR_VERSION " " >=" " 8" > /dev/null; then
@@ -43,6 +43,9 @@ if [ x"$SYSTEM_SSL" = x ]; then
4343 fi
4444 fi
4545 # Detect using system ssl when running a Jenkins job
46+ # shellcheck disable=SC2154
47+ # > label is referenced but not assigned.
48+ # This file is sourced by other scripts. label is assigned elsewhere.
4649 if expr x" $label " " :" " .*systemssl" > /dev/null; then
4750 SYSTEM_SSL=1
4851 fi
@@ -82,7 +85,7 @@ solaris)
8285esac
8386
8487# When we don't bundle OpenSSL, then we need to pull it from /usr/lib64.
85- if [ x " $SYSTEM_SSL " = x1 ]; then
88+ if [ " $SYSTEM_SSL " = 1 ]; then
8689 LDFLAGS=" $LDFLAGS -L/usr/lib64"
8790fi
8891export LDFLAGS
@@ -96,8 +99,11 @@ EMBEDDED_DB="lmdb"
9699
97100# ############## Fill in build dependencies in DEPS variable ################
98101
102+ # shellcheck disable=SC2034
103+ # > DEPS appears unused. Verify use (or export if used externally).
104+ # This file is sourced by other scripts that uses it
99105DEPS=
100- [ $OS_FAMILY = mingw ] && var_append DEPS " pthreads-w32 libgnurx"
106+ [ " $OS_FAMILY " = mingw ] && var_append DEPS " pthreads-w32 libgnurx"
101107
102108# libgcc_s.so is needed before we compile any other dependency
103109# on some platforms!
107113
108114var_append DEPS " $EMBEDDED_DB pcre2"
109115
110- if ! [ x " $SYSTEM_SSL " = x1 ]; then
116+ if [ " $SYSTEM_SSL " != 1 ]; then
111117 # FIXME: Why do we need zlib?
112118 # ANSWER: Openssl uses it optionally, TODO DISABLE
113119 var_append DEPS " zlib openssl"
@@ -156,7 +162,7 @@ agent) ROLE=agent ;;
156162hub) ROLE=hub ;;
157163* )
158164 # Not running under Jenkins?
159- if [ x " $JENKINS_SERVER_COOKIE " = x ]; then
165+ if [ -z " $JENKINS_SERVER_COOKIE " ]; then
160166 case " $PROJECT -$ARCH -$OS -${OS_VERSION} " in
161167 community-* ) ROLE=agent ;;
162168 # We do not support 32 bits hubs anymore
@@ -220,7 +226,12 @@ esac
220226# unit files for it?
221227case " $OS_FAMILY " in
222228linux) WITH_SYSTEMD=yes ;;
223- * ) WITH_SYSTEMD=no ;;
229+ * )
230+ # shellcheck disable=SC2034
231+ # > DEPS appears unused. Verify use (or export if used externally).
232+ # This file is sourced by other scripts that uses it.
233+ WITH_SYSTEMD=no
234+ ;;
224235esac
225236
226237case " $OS_FAMILY " in
0 commit comments