summaryrefslogtreecommitdiff
path: root/scripts/testing/ensure-pysqlcipher-has-usleep.sh
blob: d1148aa015b70d17ab0b94a16870290a2420e889 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# make sure that the current installed version of pysqlcipher has the
# HAVE_USLEEP flag set so we don't have problems with concurrent db access.

set -e

install_bundled_pysqlcipher() {
  pip uninstall -y pysqlcipher
  pip install --install-option="--bundled" pysqlcipher
}
check_pysqlcipher() {
    SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
    $SCRIPTPATH/check-pysqlcipher.py
}
check_pysqlcipher || (install_bundled_pysqlcipher && check_pysqlcipher)