contrib/jenkins.sh: Reorder sanity checks

Change-Id: Idfe12148aa7a8030bdaf56d11c1547ebc3f56d14
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 84e4ea7..df444ca 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -23,15 +23,8 @@
         mychroot_nocwd -w / "$@"
 }
 
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
 if [ -z "${INSIDE_CHROOT}" ]; then
 
-        osmo-clean-workspace.sh
-
         # Only use ARM chroot if host is not ARM and the target is ARM:
         if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then
 
@@ -69,6 +62,20 @@
         fi
 fi
 
+set -ex
+
+if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
+	echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
+	exit 2
+fi
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+export deps inst
+
+osmo-clean-workspace.sh
+
 mkdir "$deps" || true
 
 osmo-build-dep.sh libosmocore "" "--enable-sanitize --disable-doxygen --disable-pcsc"