#!/bin/sh

# Bootstrap the repository.  Used when the repository is checked out from git.
# When using the source tarball, running this script is not necessary.

set -eu

if ! git --version >/dev/null; then
  echo "git not installed"
  exit 1
fi

if ! python3 --version >/dev/null; then
  echo "python3 not installed"
  exit 1
fi

# Make sure that "git pull" et al. also update
# submodules to avoid accidental rollbacks.
git config --local submodule.recurse true

git submodule sync
git submodule update --init
./contrib/check-prebuilt
rm -f ./configure
cp build-system/taler-build-scripts/configure ./configure
