xci: file: xci-lib.sh: Avoid sourcing xci-lib.sh twice 85/55085/3
authorMarkos Chandras <mchandras@suse.de>
Fri, 6 Apr 2018 19:33:11 +0000 (20:33 +0100)
committerMarkos Chandras <mchandras@suse.de>
Fri, 18 May 2018 10:20:53 +0000 (11:20 +0100)
The file can be sourced from multiple places so we need to avoid
sourcing it twice.

Change-Id: I7d47f3d7e461d90d5456c95a1f7a791b4e3a2bde
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/files/xci-lib.sh

index bdb6451..542ac3a 100644 (file)
@@ -7,6 +7,9 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
+# Avoid double sourcing the file
+[[ -n ${XCI_LIB_SOURCED:-} ]] && return 0 || export XCI_LIB_SOURCED=1
+
 function bootstrap_xci_env() {
     # Declare our virtualenv
     export XCI_VENV=${XCI_PATH}/venv/