[Postgres-xl-developers] fix postgres-xl build on FreeBSD

Pavan Deolasee pavan.deolasee at gmail.com
Mon Dec 15 03:27:07 PST 2014


On Sat, Dec 13, 2014 at 8:53 AM, Jov <amutu at amutu.com> wrote:
>
> the pgxc_ctl heavily use the bash array type,which is not support by
> /bin/sh
>
> ➜  pgxc_ctl  /bin/sh ./pgxc_ctl.conf
>> ./pgxc_ctl.conf: 125: Syntax error: word unexpected (expecting ")")
>> ➜  pgxc_ctl  sed -n '125p' ./pgxc_ctl.conf
>> gtmProxyNames=(gtm_pxy1 gtm_pxy2 gtm_pxy3 gtm_pxy4) # No used if it is
>> not configured
>> ➜  ~  sh ./git/postgres-xl/contrib/pgxc_ctl/pgxc_ctl.bash
>> ./git/postgres-xl/contrib/pgxc_ctl/pgxc_ctl.bash: 127: Syntax error: word
>> unexpected (expecting ")")
>> ➜  ~  sed -n '127p'  ./git/postgres-xl/contrib/pgxc_ctl/pgxc_ctl.bash
>> gtmProxyNames=(gtm_pxy1 gtm_pxy2 gtm_pxy3 gtm_pxy4) # No used if it is
>> not configured
>
>
>
TBH I'm not sure if those bash scripts are really used by pgxc_ctl after
its 'C' version was checked in. If not, we should probably clean that up to
avoid confusion. For now, I will go with your patch and we can revisit it
in future.



> I know bash is not default /bin/sh on freebsd and debian(newer debian use
> dash),but if we change to /bin/sh, the shell script should be rewrite and
> test,it's a lot of work.
>
> I make a patch to check if the bash available and emit error when running
> pgxc_ctl.
> I use "command -v" to check the bash,wile it is portable because "command"
> is a builtin command in FreeBSD /bin/sh and XSI sh  (type can also be
> used,but it seems type is not posix portable:
> http://compgroups.net/comp.unix.shell/-type-builtin-in-posix-only-shell/503234
> )
>

Ok. That works for now.

Thanks,
Pavan


-- 
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20141215/e838e3a8/attachment.htm>


More information about the Postgres-xl-developers mailing list