[Postgres-xl-developers] [patch]pgxc_ctl compile failed

Jov amutu at amutu.com
Wed Dec 17 22:58:06 PST 2014


file pgxc_ctl_conf_part_minimal do not contain "ifdef XCP" and etc.,and ex
on FreeBSD will report error and exit if the replace command do not find
the target,I have no idea to fix it using ex.

What about this patch? it split the replace cmd,so the later failed will
not affect the whole cmd.

diff --git a/contrib/pgxc_ctl/make_signature
b/contrib/pgxc_ctl/make_signature
index f0ddce2..9fb8930 100755
--- a/contrib/pgxc_ctl/make_signature
+++ b/contrib/pgxc_ctl/make_signature
@@ -145,6 +145,10 @@ ex pgxc_ctl_conf_part.wk <<EOF
 %s/"/\\\"/g
 w
 %s/^\(.*\)$/"\1",/
+wq
+EOF
+
+ex pgxc_ctl_conf_part.wk <<EOF
 %s/^"#ifdef XCP",$/#ifdef XCP/
 %s/^"#endif",$/#endif/
 wq

Jov
blog: http:amutu.com/blog <http://amutu.com/blog>

2014-12-18 13:47 GMT+08:00 Pavan Deolasee <pavan.deolasee at gmail.com>:
>
>
>
> On Thu, Dec 18, 2014 at 10:28 AM, Jov <amutu at amutu.com> wrote:
>>
>> hi Pavan
>>    your clean pgxc_ctl commit make the pgxc_ctl broken:
>> $cd contrib/pgxc_ctl && gmake
>> ./make_signature
>> 未找到匹配
>> cc -DPGXC -DXCP -g3  -gdwarf-2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
>> -Wformat-security -fno-strict-aliasing -fwrapv -g -DFRONTEND
>> -DDLSUFFIX=\".so\" -I. -I../../src/interfaces/libpq -I. -I.
>> -I../../src/include   -c -o pgxc_ctl_bash.o pgxc_ctl_bash.c
>> pgxc_ctl_bash.c:693:2: error: invalid preprocessing directive
>> #!/usr/bin/env bash
>>  ^
>> pgxc_ctl_bash.c:695:3: error: invalid preprocessing directive
>> # Postgres-XC Configuration file for pgxc_ctl utility.
>>   ^
>> pgxc_ctl_bash.c:697:3: error: invalid preprocessing directive
>> # Configuration file can be specified as -c option from pgxc_ctl command.
>>   Default is
>> ...
>>
>>
> Hi Jov,
>
> This works well on my Mac and Ubuntu environment. We need that code to put
> appropriate #ifdefs for XL related code. Not that its required, but we have
> followed that practice to clearly mark code changes w.r.t XC.
>
> Can you please check if FreeBSD need some special treatment for those
> search/replace commands?
>
> Thanks,
> Pavan
>
>
>> This patch fix it:
>>
>> diff --git a/contrib/pgxc_ctl/make_signature
>> b/contrib/pgxc_ctl/make_signature
>> index f0ddce2..c143e6d 100755
>> --- a/contrib/pgxc_ctl/make_signature
>> +++ b/contrib/pgxc_ctl/make_signature
>> @@ -145,8 +145,6 @@ ex pgxc_ctl_conf_part.wk <<EOF
>>  %s/"/\\\"/g
>>  w
>>  %s/^\(.*\)$/"\1",/
>> -%s/^"#ifdef XCP",$/#ifdef XCP/
>> -%s/^"#endif",$/#endif/
>>  wq
>>  EOF
>>
>> Jov
>> blog: http:amutu.com/blog <http://amutu.com/blog>
>>
>
>
> --
> 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/20141218/0f9a810c/attachment.htm>


More information about the Postgres-xl-developers mailing list