amalgamate-sql.sh (1630B)
1 #!/bin/sh 2 3 # This file is part of TALER 4 # Copyright (C) 2026 Taler Systems SA 5 # 6 # TALER is free software; you can redistribute it and/or modify it under the 7 # terms of the GNU General Public License as published by the Free Software 8 # Foundation; either version 3, or (at your option) any later version. 9 # 10 # TALER is distributed in the hope that it will be useful, but WITHOUT ANY 11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License along with 15 # TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 16 17 set -eu 18 19 if [ $# -lt 1 ]; then 20 echo "Usage: $0 SQLFILES..." >&2 21 exit 1 22 fi 23 24 cat <<'EOF' 25 -- 26 -- This file is part of TALER 27 -- Copyright (C) 2014--2025 Taler Systems SA 28 -- 29 -- TALER is free software; you can redistribute it and/or modify it under the 30 -- terms of the GNU General Public License as published by the Free Software 31 -- Foundation; either version 3, or (at your option) any later version. 32 -- 33 -- TALER is distributed in the hope that it will be useful, but WITHOUT ANY 34 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 35 -- A PARTICULAR PURPOSE. See the GNU General Public License for more details. 36 -- 37 -- You should have received a copy of the GNU General Public License along with 38 -- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 39 -- 40 EOF 41 42 for x in $@; do 43 echo -- generated from $x 44 # Remove SQL comments and empty lines 45 cat $x | sed -e "s/--.*//" | awk 'NF' 46 done