Add debian/function.sh as it's gone away upstream.
authorThomas Goirand <thomas@goirand.fr>
Mon, 18 Jul 2016 18:54:54 +0000 (18:54 +0000)
committerThomas Goirand <thomas@goirand.fr>
Mon, 18 Jul 2016 18:54:54 +0000 (18:54 +0000)
Rewritten-From: ca430bf6e5853d9cb818750a30f94b0efc37b16d

xenial/debian/changelog
xenial/debian/functions.sh [new file with mode: 0644]
xenial/debian/setup-test-env-mongodb.sh

index bed7e06c25c8d0d42f516bf6a29dbf561ac9c898..81fe28f9b4c366c5862d8524161db4a3536567be 100644 (file)
@@ -3,6 +3,7 @@ ceilometer (1:7.0.0~b2-1) experimental; urgency=medium
   * Updated Danish translation of the debconf templates (Closes: #830640).
   * New upstream release.
   * Fixed (build-)depends for this release.
+  * Add debian/function.sh as it's gone away upstream.
 
  -- Thomas Goirand <zigo@debian.org>  Mon, 18 Jul 2016 19:57:15 +0200
 
diff --git a/xenial/debian/functions.sh b/xenial/debian/functions.sh
new file mode 100644 (file)
index 0000000..352cec3
--- /dev/null
@@ -0,0 +1,29 @@
+function clean_exit(){
+    local error_code="$?"
+    rm -rf "$1"
+    kill $(jobs -p)
+    return $error_code
+}
+
+check_for_cmd () {
+    if ! which "$1" >/dev/null 2>&1
+    then
+        echo "Could not find $1 command" 1>&2
+        exit 1
+    fi
+}
+
+wait_for_line () {
+    exit_code=1
+    while read line
+    do
+        echo "$line" | grep -q "$1" && exit_code=0 && break
+    done < "$2"
+    # Read the fifo for ever otherwise process would block
+    cat "$2" >/dev/null &
+    if [ $exit_code -eq 1 ]; then
+        echo "Entries of \"$1\" have not been found. Now tests will be stopped."
+        exit $exit_code
+    fi
+}
+
index 62e4fcc2ee77804afa0da28811caa5f50b437e65..478972bb158312ea59b70960733f0b2250efe054 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 set -e
 
-source functions.sh
+source debian/functions.sh
 
 if [ "$1" = "--coverage" ]; then
        COVERAGE_ARG="$1"