exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

bootstrap (2650B)


      1 #!/bin/sh
      2 # This file is in the public domain.
      3 
      4 set -eu
      5 
      6 if ! git --version >/dev/null; then
      7   echo "git not installed"
      8   exit 1
      9 fi
     10 
     11 # Make sure that "git pull" et al. also update
     12 # submodules to avoid accidental rollbacks.
     13 git config --local submodule.recurse true || true
     14 
     15 echo "$0: Updating submodules"
     16 # Caution: We do NOT want to fetch the latest version with --remote,
     17 # but instead always the one that's recorded in the repository.
     18 echo | git submodule update --init --force || true
     19 
     20 # This is more portable than `which' but comes with
     21 # the caveat of not(?) properly working on busybox's ash:
     22 existence()
     23 {
     24     command -v "$1" >/dev/null 2>&1
     25 }
     26 
     27 # Freeze non-generated SQL files that must no longer be edited.
     28 for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010
     29 do
     30     chmod -w src/exchangedb/sql-schema/exchange-$n.sql* &>/dev/null || true
     31     chmod -w src/exchangedb/sql-schema/$n-*.sql &>/dev/null || true
     32 done
     33 for n in 0001
     34 do
     35     chmod -w src/exchangedb/sql-schema/auditor-triggers-$n.sql* &>/dev/null || true
     36 done
     37 for n in 0001 0002
     38 do
     39     chmod -w src/auditordb/auditor-$n.sql* &>/dev/null || true
     40     chmod -w src/auditordb/$n-*.sql &> /dev/null || true
     41 done
     42 
     43 if existence uncrustify; then
     44     echo "Installing uncrustify hook and configuration"
     45     # Install uncrustify format symlink (if possible)
     46     ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true
     47     # Install pre-commit hook (if possible)
     48     ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true
     49 else
     50     echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development"
     51 fi
     52 
     53 
     54 # Generate Makefile.am in contrib/
     55 #cd contrib
     56 #rm -f Makefile.am
     57 #echo 'dist_amlspapkgdata_DATA = \' > Makefile.am.ext
     58 #find wallet-core/aml-backoffice/ -type f | sort | awk '{print "  " $1 " \\" }' >> Makefile.am.ext
     59 ## Remove extra '\' at the end of the file
     60 #truncate -s -2 Makefile.am.ext
     61 #
     62 #echo "" >> Makefile.am.ext
     63 #echo 'dist_kycspapkgdata_DATA = \' >> Makefile.am.ext
     64 #find wallet-core/kyc/ -type f | sort | awk '{print "  " $1 " \\" }' >> Makefile.am.ext
     65 ## Remove extra '\' at the end of the file
     66 #truncate -s -2 Makefile.am.ext
     67 #
     68 #echo "" >> Makefile.am.ext
     69 #echo 'dist_auditorspapkgdata_DATA = \' >> Makefile.am.ext
     70 #find wallet-core/auditor-backoffice/ -type f | sort | awk '{print "  " $1 " \\" }' >> Makefile.am.ext
     71 ## Remove extra '\' at the end of the file
     72 #truncate -s -2 Makefile.am.ext
     73 #
     74 #
     75 #cat Makefile.am.in Makefile.am.ext >> Makefile.am
     76 ## Prevent accidental editing of the generated Makefile.am
     77 #chmod -w Makefile.am
     78 #cd ..
     79 #
     80 #echo "$0: Running autoreconf"
     81 #autoreconf -fi