build+ci: Synchronize build and CI scripts with ndn-cxx/NFD
This commit also fixes a minor problem causing compilation warnings.
Change-Id: I0c04d58fe9df24f181947b9fde1346283402fc7b
diff --git a/.jenkins.d/util.sh b/.jenkins.d/util.sh
index 81c8931..a89bc27 100644
--- a/.jenkins.d/util.sh
+++ b/.jenkins.d/util.sh
@@ -1,9 +1,18 @@
has() {
+ local saved_xtrace
+ [[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
+ set +x
+
local p=$1
shift
- local x
- for x in "$@"; do
- [[ "${x}" == "${p}" ]] && return 0
+ local i ret=1
+ for i in "$@"; do
+ if [[ "${i}" == "${p}" ]]; then
+ ret=0
+ break
+ fi
done
- return 1
+
+ set ${saved_xtrace}
+ return ${ret}
}