merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

bootstrap (1865B)


      1 #!/bin/sh
      2 
      3 set -eu
      4 
      5 if ! git --version >/dev/null; then
      6   echo "git not installed"
      7   exit 1
      8 fi
      9 
     10 if ! python3 --version >/dev/null; then
     11   echo "python3 not installed"
     12   exit 1
     13 fi
     14 
     15 # Make sure that "git pull" et al. also update
     16 # submodules to avoid accidental rollbacks.
     17 git config --local submodule.recurse true
     18 
     19 echo "$0: Updating submodules"
     20 # Caution: We do NOT want to fetch the latest version with --remote,
     21 # but instead always the one that's recorded in the repository.
     22 echo | git submodule update --init --force
     23 
     24 ./contrib/check-prebuilt
     25 
     26 
     27 # This is more portable than `which' but comes with
     28 # the caveat of not(?) properly working on busybox's ash:
     29 existence()
     30 {
     31     command -v "$1" >/dev/null 2>&1
     32 }
     33 
     34 # Freeze SQL files that must no longer be edited.
     35 for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033
     36 do
     37     chmod -w src/backenddb/merchant-$n.sql*
     38 done
     39 
     40 if existence uncrustify; then
     41     echo "Installing uncrustify hook and configuration"
     42     # Install uncrustify format symlink (if possible)
     43     ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true
     44     # Install pre-commit hook (if possible)
     45     ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true
     46 else
     47     echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development"
     48 fi
     49 
     50 # Generate Makefile.am in contrib/
     51 cd contrib
     52 rm -f Makefile.am
     53 find wallet-core/backoffice/ -type f | sort | awk '{print "  " $1 " \\" }' > Makefile.am.ext
     54 # Remove extra '\' at the end of the file
     55 truncate -s -2 Makefile.am.ext
     56 cat Makefile.am.in Makefile.am.ext >> Makefile.am
     57 # Prevent accidental editing of the generated Makefile.am
     58 chmod -w Makefile.am
     59 cd ..
     60 
     61 echo "$0: Running autoreconf"
     62 autoreconf -if