#!/usr/bin/env bash #-------------------------------------------------------------------- # # make_signature # # Bash script building module of pgxc_ctl. # # Copyright (c) 2012 Postgres-XC Development Group # #--------------------------------------------------------------------- # # This module is used to create signature.h and pgxc_ctl_bash.c files. # # pgxc_ctl_bash.c files contains two information, # 1. Bash script to read pgxc_ctl configuration information and write # it back to pgxc_ctl. This way, users can use their familiar bash # script to configure postgres-xc cluster. # This includes typical (test) configuration so that pgxc_ctl # can run even with incomplete configuration. # 2. Template postgres-xc cluster configuration used by pgxc_ctl. # You can get this template by typing "prepare configu" command. # # signature.h contains signature information which is useful in # checking the bash script and pgxc_ctl binary build. # # At present, the bash script is installed each time pgxc_ctl is invoked # and uninstalled, this has no significant role. In the future, # when we need to maintain this bash script, it will work to enforce # the integrity between the two. #------------------------------------------------------------------------ # make sure we fail if any of the executed commands fails set -e sig=`date +%y%m%d_%H%M_%N` cat > signature.h <> signature.h cat >> signature.h < pgxc_ctl_bash.c.wk cat > pgxc_ctl_bash.c < /* * Bash script to read pgxc_ctl configuration parameters and write * back to itself. * * This part is written to pgxc_ctl work directory and reads * configuration file, which is also written in bash script. */ char *pgxc_ctl_bash_script[] = { EOF cat pgxc_ctl_bash.c.wk >> pgxc_ctl_bash.c cat >> pgxc_ctl_bash.c < pgxc_ctl_conf_part.wk cat >> pgxc_ctl_bash.c <> pgxc_ctl_bash.c cat >> pgxc_ctl_bash.c < pgxc_ctl_conf_part.wk cat >> pgxc_ctl_bash.c <> pgxc_ctl_bash.c cat >> pgxc_ctl_bash.c < pgxc_ctl_conf_empty.wk cat >> pgxc_ctl_bash.c <> pgxc_ctl_bash.c cat >> pgxc_ctl_bash.c <