bootstrap (2692B)
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 0005 0006 0007 0008 29 do 30 chmod -w src/exchangedb/sql-schema/exchange-$n.sql &>/dev/null || true 31 done 32 for n in 0002 0003 0004 0009 0010 0011 33 do 34 chmod -w src/exchangedb/sql-schema/$n-*.sql &>/dev/null || true 35 done 36 for n in 0001 37 do 38 chmod -w src/exchangedb/sql-schema/auditor-triggers-$n.sql* &>/dev/null || true 39 done 40 for n in 0001 41 do 42 chmod -w src/auditordb/auditor-$n.sql &>/dev/null || true 43 done 44 for n in 0002 0003 45 do 46 chmod -w src/auditordb/$n-*.sql &> /dev/null || true 47 done 48 49 if existence uncrustify; then 50 echo "Installing uncrustify hook and configuration" 51 # Install uncrustify format symlink (if possible) 52 ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true 53 # Install pre-commit hook (if possible) 54 ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true 55 else 56 echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development" 57 fi 58 59 60 # Generate Makefile.am in contrib/ 61 #cd contrib 62 #rm -f Makefile.am 63 #echo 'dist_amlspapkgdata_DATA = \' > Makefile.am.ext 64 #find wallet-core/aml-backoffice/ -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_kycspapkgdata_DATA = \' >> Makefile.am.ext 70 #find wallet-core/kyc/ -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 #echo "" >> Makefile.am.ext 75 #echo 'dist_auditorspapkgdata_DATA = \' >> Makefile.am.ext 76 #find wallet-core/auditor-backoffice/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext 77 ## Remove extra '\' at the end of the file 78 #truncate -s -2 Makefile.am.ext 79 # 80 # 81 #cat Makefile.am.in Makefile.am.ext >> Makefile.am 82 ## Prevent accidental editing of the generated Makefile.am 83 #chmod -w Makefile.am 84 #cd .. 85 # 86 #echo "$0: Running autoreconf" 87 #autoreconf -fi