Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-07 Thread Andy Wong
It works.Thanks jow for the details.
At 2016-01-05 18:45:47, "Jo-Philipp Wich"  wrote:
>Each line in Make is started in a new shell. Your added lines are 
>executed as (simplified):
>
>bash -c 'if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then'
>bash -c '$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n'
>bash -c '$(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
>$(1)/usr/lib/lua/luci/i18n'
>bash -c 'fi'
>
>The first "if" command is invalid because it is not terminated 
>("unexpected end of file") and the single "fi" command in the end is 
>invalid syntax as well (preceding if ... then missing).
>
>You need to join your four lines into a single statement by escaping 
>the newline with a backslash and by terminating statements with a 
>semicolon:
>
>>  if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then \
>>  $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n; \
>>  $(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
>> $(1)/usr/lib/lua/luci/i18n; \
>>  fi
>
>Which will result in (simplified)
>
>bash -c 'if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/i18n; $(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
>$(1)/usr/lib/lua/luci/i18n; fi'
>
>
>~ Jow
>
>On 01/05/2016 10:41 AM, Andy Wong wrote:
>> Hi.I not quite understand.I've change the install part as below:
>> 
>> define Package/openwrt-dist-luci/install
>> #!/bin/sh
>> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
>> $(INSTALL_DATA) ./files/luci/controller/$(2).lua
>> $(1)/usr/lib/lua/luci/controller/$(2).lua
>> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
>> $(INSTALL_DATA) ./files/luci/model/cbi/$(2).lua
>> $(1)/usr/lib/lua/luci/model/cbi/$(2).lua
>> $(INSTALL_DIR) $(1)/etc/uci-defaults
>> $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-$(2)
>> $(1)/etc/uci-defaults/luci-$(2)
>> *if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then*
>> *$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n*
>> *$(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo
>> $(1)/usr/lib/lua/luci/i18n*
>> *fi*
>> exit 0
>> endef
>> 
>> Notice the if then course.
>> 
>> Here is the error now.
>> 
>> if [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; then install -d -m0755
>> /home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
>> install -m0644 ./files/luci/i18n/chinadns.zh-cn.lmo
>> /home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
>> fi
>> bash: -c: line 1: syntax error: unexpected end of file
>> make[2]: ***
>> [/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
>> Error 1
>> make[2]: Leaving directory
>> `/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'
>> make[1]: *** [package/my_package/openwrt-dist-luci/compile] Error 2
>> make[1]: Leaving directory `/homeOpenwrt/witi-openwrt'
>> make: *** [package/openwrt-dist-luci/compile] 错误 2
>> 
>> 
>> 
>> 
>> At 2016-01-04 22:28:36, "Luiz Angelo Daros de Luca" 
>> wrote:
>> 
>> Andy,
>> 
>> Make runs one line per time. Make the "if" inline or backslash each
>> newline (adding semicolon when needed)
>> 
>> Regards
>> 
>> 
>> Em seg, 4 de jan de 2016 11:56, Andy Wong > > escreveu:
>> 
>> 
>> For no misunderstanding.Here is the error now
>> http://pastebin.com/t4Rb08kA
>> 
>> 
>> 
>> 
>> 
>> 
>> 在 2016-01-04 21:18:14,"Andy Wong" > > 写道:
>> >Thanks.I have indented like this:define 
>> Package/openwrt-dist-luci/install#!/bin/sh   $(INSTALL_DIR) 
>> $(1)/usr/lib/lua/luci/controller$(INSTALL_DATA) 
>> ./files/luci/controller/$(2).lua 
>> $(1)/usr/lib/lua/luci/controller/$(2).lua $(INSTALL_DIR) 
>> $(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA) 
>> ./files/luci/model/cbi/$(2).lua 
>> $(1)/usr/lib/lua/luci/model/cbi/$(2).lua   $(INSTALL_DIR) 
>> $(1)/etc/uci-defaults   $(INSTALL_BIN) 
>> ./files/root/etc/uci-defaults/luci-$(2) $(1)/etc/uci-defaults/luci-$(2) 
>> if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
>> $(1)/usr/lib/lua/luci/i18n  $(INSTALL_DATA) 
>> ./files/luci/i18n/$(2).zh-cn.lmo $(1)/usr/lib/lua/luci/i18n
>> fiendefBut another error 
>> appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
>>  [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1: 
>> syntax e
> r
>ror: unexpected end of filemake[2]: *** 
>[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
> Error 1make[2]: Leaving directory 
>`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]: 
>*** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]: 
>Leaving directory `/home/Openwrt/witi-openwrt'make: *** 
>[package/openwrt-dist-luci/compile] 错误 2My 

Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-05 Thread Jo-Philipp Wich
Each line in Make is started in a new shell. Your added lines are 
executed as (simplified):

bash -c 'if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then'
bash -c '$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n'
bash -c '$(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
$(1)/usr/lib/lua/luci/i18n'
bash -c 'fi'

The first "if" command is invalid because it is not terminated 
("unexpected end of file") and the single "fi" command in the end is 
invalid syntax as well (preceding if ... then missing).

You need to join your four lines into a single statement by escaping 
the newline with a backslash and by terminating statements with a 
semicolon:

>   if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then \
>   $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n; \
>   $(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
> $(1)/usr/lib/lua/luci/i18n; \
>   fi

Which will result in (simplified)

bash -c 'if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
$(1)/usr/lib/lua/luci/i18n; $(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
$(1)/usr/lib/lua/luci/i18n; fi'


~ Jow

On 01/05/2016 10:41 AM, Andy Wong wrote:
> Hi.I not quite understand.I've change the install part as below:
> 
> define Package/openwrt-dist-luci/install
> #!/bin/sh
> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
> $(INSTALL_DATA) ./files/luci/controller/$(2).lua
> $(1)/usr/lib/lua/luci/controller/$(2).lua
> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
> $(INSTALL_DATA) ./files/luci/model/cbi/$(2).lua
> $(1)/usr/lib/lua/luci/model/cbi/$(2).lua
> $(INSTALL_DIR) $(1)/etc/uci-defaults
> $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-$(2)
> $(1)/etc/uci-defaults/luci-$(2)
> *if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then*
> *$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n*
> *$(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo
> $(1)/usr/lib/lua/luci/i18n*
> *fi*
> exit 0
> endef
> 
> Notice the if then course.
> 
> Here is the error now.
> 
> if [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; then install -d -m0755
> /home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
> install -m0644 ./files/luci/i18n/chinadns.zh-cn.lmo
> /home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
> fi
> bash: -c: line 1: syntax error: unexpected end of file
> make[2]: ***
> [/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
> Error 1
> make[2]: Leaving directory
> `/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'
> make[1]: *** [package/my_package/openwrt-dist-luci/compile] Error 2
> make[1]: Leaving directory `/homeOpenwrt/witi-openwrt'
> make: *** [package/openwrt-dist-luci/compile] 错误 2
> 
> 
> 
> 
> At 2016-01-04 22:28:36, "Luiz Angelo Daros de Luca" 
> wrote:
> 
> Andy,
> 
> Make runs one line per time. Make the "if" inline or backslash each
> newline (adding semicolon when needed)
> 
> Regards
> 
> 
> Em seg, 4 de jan de 2016 11:56, Andy Wong  > escreveu:
> 
> 
> For no misunderstanding.Here is the error now
> http://pastebin.com/t4Rb08kA
> 
> 
> 
> 
> 
> 
> 在 2016-01-04 21:18:14,"Andy Wong"  > 写道:
> >Thanks.I have indented like this:define 
> Package/openwrt-dist-luci/install#!/bin/sh$(INSTALL_DIR) 
> $(1)/usr/lib/lua/luci/controller$(INSTALL_DATA) 
> ./files/luci/controller/$(2).lua 
> $(1)/usr/lib/lua/luci/controller/$(2).lua $(INSTALL_DIR) 
> $(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA) 
> ./files/luci/model/cbi/$(2).lua $(1)/usr/lib/lua/luci/model/cbi/$(2).lua 
>   $(INSTALL_DIR) $(1)/etc/uci-defaults   $(INSTALL_BIN) 
> ./files/root/etc/uci-defaults/luci-$(2) $(1)/etc/uci-defaults/luci-$(2)  
>if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
> $(1)/usr/lib/lua/luci/i18n  $(INSTALL_DATA) 
> ./files/luci/i18n/$(2).zh-cn.lmo $(1)/usr/lib/lua/luci/i18n
> fiendefBut another error 
> appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
>  [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1: 
> syntax e
 r
ror: unexpected end of filemake[2]: *** 
[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
 Error 1make[2]: Leaving directory 
`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]: 
*** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]: Leaving 
directory `/home/Openwrt/witi-openwrt'make: *** 
[package/openwrt-dist-luci/compile] 错误 2My if,then course is 
intending to find out if *.zh-cn.lmo exist,then install it.
> >At 2016-01-04 20:20:00, "Jo-Philipp Wich"  > wrote:
> >>Hi.
> >>
> >>Lin

Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-05 Thread Yousong Zhou
Hi


On 5 January 2016 at 17:41, Andy Wong  wrote:
> Hi.I not quite understand.I've change the install part as below:
>
> define Package/openwrt-dist-luci/install
> #!/bin/sh
> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
> $(INSTALL_DATA) ./files/luci/controller/$(2).lua
> $(1)/usr/lib/lua/luci/controller/$(2).lua
> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
> $(INSTALL_DATA) ./files/luci/model/cbi/$(2).lua
> $(1)/usr/lib/lua/luci/model/cbi/$(2).lua
> $(INSTALL_DIR) $(1)/etc/uci-defaults
> $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-$(2)
> $(1)/etc/uci-defaults/luci-$(2)
> if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then
> $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
> $(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo
> $(1)/usr/lib/lua/luci/i18n
> fi
> exit 0
> endef
>
> Notice the if then course.
>
> Here is the error now.
>
> if [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; then install -d -m0755
> /home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
> install -m0644 ./files/luci/i18n/chinadns.zh-cn.lmo
> /home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
> fi
> bash: -c: line 1: syntax error: unexpected end of file
> make[2]: ***
> [/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
> Error 1
> make[2]: Leaving directory
> `/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'
> make[1]: *** [package/my_package/openwrt-dist-luci/compile] Error 2
> make[1]: Leaving directory `/homeOpenwrt/witi-openwrt'
> make: *** [package/openwrt-dist-luci/compile] 错误 2
>

Not quite sure about this, but you can try adding semicolons at the
end of each command inside the if ; then .. fi block

BTW.  This is not OpenWrt specific.  Try making a minimal Makefile and
experiment with it.

yousong

>
>
>
> At 2016-01-04 22:28:36, "Luiz Angelo Daros de Luca" 
> wrote:
>
> Andy,
>
> Make runs one line per time. Make the "if" inline or backslash each newline
> (adding semicolon when needed)
>
> Regards
>
>
> Em seg, 4 de jan de 2016 11:56, Andy Wong  escreveu:
>>
>>
>> For no misunderstanding.Here is the error now
>> http://pastebin.com/t4Rb08kA
>>
>>
>>
>>
>>
>>
>> 在 2016-01-04 21:18:14,"Andy Wong"  写道:
>> >Thanks.I have indented like this:define
>> > Package/openwrt-dist-luci/install#!/bin/sh $(INSTALL_DIR)
>> > $(1)/usr/lib/lua/luci/controller $(INSTALL_DATA)
>> > ./files/luci/controller/$(2).lua
>> > $(1)/usr/lib/lua/luci/controller/$(2).lua $(INSTALL_DIR)
>> > $(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA)
>> > ./files/luci/model/cbi/$(2).lua
>> > $(1)/usr/lib/lua/luci/model/cbi/$(2).lua $(INSTALL_DIR)
>> > $(1)/etc/uci-defaults $(INSTALL_BIN)
>> > ./files/root/etc/uci-defaults/luci-$(2)
>> > $(1)/etc/uci-defaults/luci-$(2) if [ -f
>> > "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR)
>> > $(1)/usr/lib/lua/luci/i18n $(INSTALL_DATA)
>> > ./files/luci/i18n/$(2).zh-cn.lmo
>> > $(1)/usr/lib/lua/luci/i18n fiendefBut another error
>> > appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
>> > [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1:
>> > syntax error: unexpected end of filemake[2]: ***
>> > [/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
>> > Error 1make[2]: Leaving directory
>> > `/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]:
>> > *** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]:
>> > Leaving directory `/home/Openwrt/witi-openwrt'make: ***
>> > [package/openwrt-dist-luci/compile] 错误 2My if,then course is
>> > intending to find out if *.zh-cn.lmo exist,then install it.
>> >At 2016-01-04 20:20:00, "Jo-Philipp Wich"  wrote:
>> >>Hi.
>> >>
>> >>Lines in the isntall section must be indented with at least one tab
>> >>since they're shell instructions.
>> >>
>> >>~ Jow
>> >>___
>> >>openwrt-devel mailing list
>> >>openwrt-devel@lists.openwrt.org
>> >>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> >___
>> >openwrt-devel mailing list
>> >openwrt-devel@lists.openwrt.org
>> >https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
>>
>>
>>
>>
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
> --
>
> Luiz Angelo Daros de Luca
> luizl...@gmail.com
>
>
>
>
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
___
openwrt-dev

Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-05 Thread Andy Wong
Hi.I not quite understand.I've change the install part as below:


define Package/openwrt-dist-luci/install
#!/bin/sh
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DATA) ./files/luci/controller/$(2).lua 
$(1)/usr/lib/lua/luci/controller/$(2).lua
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
$(INSTALL_DATA) ./files/luci/model/cbi/$(2).lua 
$(1)/usr/lib/lua/luci/model/cbi/$(2).lua
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-$(2) 
$(1)/etc/uci-defaults/luci-$(2)
if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
$(1)/usr/lib/lua/luci/i18n
fi
exit 0
endef


Notice the if then course.


Here is the error now.


if [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; then install -d -m0755 
/home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
 install -m0644 ./files/luci/i18n/chinadns.zh-cn.lmo 
/home/Openwrt/witi-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/usr/lib/lua/luci/i18n
 fi
bash: -c: line 1: syntax error: unexpected end of file
make[2]: *** 
[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
 Error 1
make[2]: Leaving directory 
`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'
make[1]: *** [package/my_package/openwrt-dist-luci/compile] Error 2
make[1]: Leaving directory `/homeOpenwrt/witi-openwrt'
make: *** [package/openwrt-dist-luci/compile] 错误 2






At 2016-01-04 22:28:36, "Luiz Angelo Daros de Luca"  wrote:


Andy,

Make runs one line per time. Make the "if" inline or backslash each newline 
(adding semicolon when needed)

Regards



Em seg, 4 de jan de 2016 11:56, Andy Wong  escreveu:



For no misunderstanding.Here is the error now
http://pastebin.com/t4Rb08kA









在 2016-01-04 21:18:14,"Andy Wong"  写道:
>Thanks.I have indented like this:define 
>Package/openwrt-dist-luci/install#!/bin/sh  $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/controller$(INSTALL_DATA) 
>./files/luci/controller/$(2).lua 
>$(1)/usr/lib/lua/luci/controller/$(2).lua $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA) 
>./files/luci/model/cbi/$(2).lua $(1)/usr/lib/lua/luci/model/cbi/$(2).lua  
> $(INSTALL_DIR) $(1)/etc/uci-defaults   $(INSTALL_BIN) 
>./files/root/etc/uci-defaults/luci-$(2) $(1)/etc/uci-defaults/luci-$(2)   
>  if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/i18n  $(INSTALL_DATA) 
>./files/luci/i18n/$(2).zh-cn.lmo $(1)/usr/lib/lua/luci/i18n
>fiendefBut another error 
>appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
> [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1: 
>syntax error: unexpected end of filemake[2]: *** 
>[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
> Error 1make[2]: Leaving directory 
>`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]: 
>*** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]: 
>Leaving directory `/home/Openwrt/witi-openwrt'make: *** 
>[package/openwrt-dist-luci/compile] 错误 2My if,then course is 
>intending to find out if *.zh-cn.lmo exist,then install it.
>At 2016-01-04 20:20:00, "Jo-Philipp Wich"  wrote:
>>Hi.
>>
>>Lines in the isntall section must be indented with at least one tab
>>since they're shell instructions.
>>
>>~ Jow
>>___
>>openwrt-devel mailing list
>>openwrt-devel@lists.openwrt.org
>>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>___
>openwrt-devel mailing list
>openwrt-devel@lists.openwrt.org
>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel




 

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

--


Luiz Angelo Daros de Luca
luizl...@gmail.com___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-04 Thread Luiz Angelo Daros de Luca
Andy,

Make runs one line per time. Make the "if" inline or backslash each newline
(adding semicolon when needed)

Regards

Em seg, 4 de jan de 2016 11:56, Andy Wong  escreveu:

>
> For no misunderstanding.Here is the error now
> http://pastebin.com/t4Rb08kA
>
>
>
>
>
>
> 在 2016-01-04 21:18:14,"Andy Wong"  写道:
> >Thanks.I have indented like this:define 
> >Package/openwrt-dist-luci/install#!/bin/sh$(INSTALL_DIR) 
> >$(1)/usr/lib/lua/luci/controller$(INSTALL_DATA) 
> >./files/luci/controller/$(2).lua 
> >$(1)/usr/lib/lua/luci/controller/$(2).lua $(INSTALL_DIR) 
> >$(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA) 
> >./files/luci/model/cbi/$(2).lua 
> >$(1)/usr/lib/lua/luci/model/cbi/$(2).lua   $(INSTALL_DIR) 
> >$(1)/etc/uci-defaults   $(INSTALL_BIN) 
> >./files/root/etc/uci-defaults/luci-$(2) $(1)/etc/uci-defaults/luci-$(2) 
> >if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
> >$(1)/usr/lib/lua/luci/i18n  $(INSTALL_DATA) 
> >./files/luci/i18n/$(2).zh-cn.lmo $(1)/usr/lib/lua/luci/i18n
> >fiendefBut another error 
> >appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
> > [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1: 
> >syntax error: unexpected end of filemake[2]: *** 
> >[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
> > Error 1make[2]: Leaving directory 
> >`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]:
> > *** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]: 
> >Leaving directory `/home/Openwrt/witi-openwrt'make: *** 
> >[package/openwrt-dist-luci/compile] 错误 2My if,then course is 
> >intending to find out if *.zh-cn.lmo exist,then install it.
> >At 2016-01-04 20:20:00, "Jo-Philipp Wich"  wrote:
> >>Hi.
> >>
> >>Lines in the isntall section must be indented with at least one tab
> >>since they're shell instructions.
> >>
> >>~ Jow
> >>___
> >>openwrt-devel mailing list
> >>openwrt-devel@lists.openwrt.org
> >>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >___
> >openwrt-devel mailing list
> >openwrt-devel@lists.openwrt.org
> >https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-- 

Luiz Angelo Daros de Luca
luizl...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-04 Thread Andy Wong


For no misunderstanding.Here is the error now
http://pastebin.com/t4Rb08kA









在 2016-01-04 21:18:14,"Andy Wong"  写道:
>Thanks.I have indented like this:define 
>Package/openwrt-dist-luci/install#!/bin/sh  $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/controller$(INSTALL_DATA) 
>./files/luci/controller/$(2).lua 
>$(1)/usr/lib/lua/luci/controller/$(2).lua $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA) 
>./files/luci/model/cbi/$(2).lua $(1)/usr/lib/lua/luci/model/cbi/$(2).lua  
> $(INSTALL_DIR) $(1)/etc/uci-defaults   $(INSTALL_BIN) 
>./files/root/etc/uci-defaults/luci-$(2) $(1)/etc/uci-defaults/luci-$(2)   
>  if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
>$(1)/usr/lib/lua/luci/i18n  $(INSTALL_DATA) 
>./files/luci/i18n/$(2).zh-cn.lmo $(1)/usr/lib/lua/luci/i18n
>fiendefBut another error 
>appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
> [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1: 
>syntax error: unexpected end of filemake[2]: *** 
>[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
> Error 1make[2]: Leaving directory 
>`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]: 
>*** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]: 
>Leaving directory `/home/Openwrt/witi-openwrt'make: *** 
>[package/openwrt-dist-luci/compile] 错误 2My if,then course is 
>intending to find out if *.zh-cn.lmo exist,then install it.
>At 2016-01-04 20:20:00, "Jo-Philipp Wich"  wrote:
>>Hi.
>>
>>Lines in the isntall section must be indented with at least one tab
>>since they're shell instructions.
>>
>>~ Jow
>>___
>>openwrt-devel mailing list
>>openwrt-devel@lists.openwrt.org
>>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>___
>openwrt-devel mailing list
>openwrt-devel@lists.openwrt.org
>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-04 Thread Andy Wong
Thanks.I have indented like this:define 
Package/openwrt-dist-luci/install#!/bin/sh   $(INSTALL_DIR) 
$(1)/usr/lib/lua/luci/controller$(INSTALL_DATA) 
./files/luci/controller/$(2).lua $(1)/usr/lib/lua/luci/controller/$(2).lua 
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi $(INSTALL_DATA) 
./files/luci/model/cbi/$(2).lua $(1)/usr/lib/lua/luci/model/cbi/$(2).lua   
$(INSTALL_DIR) $(1)/etc/uci-defaults   $(INSTALL_BIN) 
./files/root/etc/uci-defaults/luci-$(2) $(1)/etc/uci-defaults/luci-$(2)
 if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then $(INSTALL_DIR) 
$(1)/usr/lib/lua/luci/i18n  $(INSTALL_DATA) 
./files/luci/i18n/$(2).zh-cn.lmo $(1)/usr/lib/lua/luci/i18n
fiendefBut another error 
appears:enwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/openwrt-dist-luci/ipkg-all/luci-app-chinadns/etc/uci-defaults/luci-chinadnsif
 [ -f "./files/luci/i18n/chinadns.zh-cn.lmo" ]; thenbash: -c: line 1: 
syntax error: unexpected end of filemake[2]: *** 
[/home/Openwrt/witi-openwrt/bin/ramips/packages/base/luci-app-chinadns_1.3.8-1_all.ipk]
 Error 1make[2]: Leaving directory 
`/home/Openwrt/witi-openwrt/package/my_package/openwrt-dist-luci'make[1]: 
*** [package/my_package/openwrt-dist-luci/compile] Error 2make[1]: Leaving 
directory `/home/Openwrt/witi-openwrt'make: *** 
[package/openwrt-dist-luci/compile] 错误 2My if,then course is 
intending to find out if *.zh-cn.lmo exist,then install it.
At 2016-01-04 20:20:00, "Jo-Philipp Wich"  wrote:
>Hi.
>
>Lines in the isntall section must be indented with at least one tab
>since they're shell instructions.
>
>~ Jow
>___
>openwrt-devel mailing list
>openwrt-devel@lists.openwrt.org
>https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-04 Thread Jo-Philipp Wich
Hi.

Lines in the isntall section must be indented with at least one tab
since they're shell instructions.

~ Jow
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Need help with Makefile error *** missing separator

2016-01-04 Thread Andy Wong
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#


include $(TOPDIR)/rules.mk


PKG_NAME:=openwrt-dist-luci
PKG_VERSION:=1.3.8
PKG_RELEASE:=1


PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE


PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)


include $(INCLUDE_DIR)/package.mk


define Package/openwrt-dist-luci/Default
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=$(1) LuCI interface
PKGARCH:=all
endef


Package/luci-app-chinadns = $(call Package/openwrt-dist-luci/Default,ChinaDNS)
Package/luci-app-redsocks2 = $(call Package/openwrt-dist-luci/Default,RedSocks2)
Package/luci-app-pdnsd = $(call Package/openwrt-dist-luci/Default,pdnsd)
Package/luci-app-adbyby = $(call Package/openwrt-dist-luci/Default,adbyby)


define Package/openwrt-dist-luci/description
LuCI Support for $(1).
endef


Package/luci-app-chinadns/description = $(call 
Package/openwrt-dist-luci/description,ChinaDNS)
Package/luci-app-redsocks2/description = $(call 
Package/openwrt-dist-luci/description,RedSocks2)
Package/luci-app-pdnsd/description = $(call 
Package/openwrt-dist-luci/description,pdnsd)
Package/luci-app-adbyby/description = $(call 
Package/openwrt-dist-luci/description,adbyby)


define Build/Prepare
endef


define Build/Configure
endef


define Build/Compile
endef


define Package/openwrt-dist-luci/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
( . /etc/uci-defaults/luci-$(1) ) && rm -f /etc/uci-defaults/luci-$(1)
chmod 755 /etc/init.d/$(1) >/dev/null 2>&1
/etc/init.d/$(1) enable >/dev/null 2>&1
fi
exit 0
endef


Package/luci-app-chinadns/postinst = $(call 
Package/openwrt-dist-luci/postinst,chinadns)
Package/luci-app-redsocks2/postinst = $(call 
Package/openwrt-dist-luci/postinst,redsocks2)
Package/luci-app-pdnsd/postinst = $(call 
Package/openwrt-dist-luci/postinst,pdnsd)
Package/luci-app-adbyby/postinst = $(call 
Package/openwrt-dist-luci/postinst,adbyby)


define Package/openwrt-dist-luci/install
#!/bin/sh
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DATA) ./files/luci/controller/$(2).lua 
$(1)/usr/lib/lua/luci/controller/$(2).lua
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
$(INSTALL_DATA) ./files/luci/model/cbi/$(2).lua 
$(1)/usr/lib/lua/luci/model/cbi/$(2).lua
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-$(2) 
$(1)/etc/uci-defaults/luci-$(2)
if [ -f "./files/luci/i18n/$(2).zh-cn.lmo" ]; then
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DATA) ./files/luci/i18n/$(2).zh-cn.lmo 
$(1)/usr/lib/lua/luci/i18n
fi
exit 0
endef


Package/luci-app-chinadns/install = $(call 
Package/openwrt-dist-luci/install,$(1),chinadns)
Package/luci-app-redsocks2/install = $(call 
Package/openwrt-dist-luci/install,$(1),redsocks2)
Package/luci-app-pdnsd/install = $(call 
Package/openwrt-dist-luci/install,$(1),pdnsd)
Package/luci-app-adbyby/install = $(call 
Package/openwrt-dist-luci/install,$(1),adbyby)


$(eval $(call BuildPackage,luci-app-chinadns))
$(eval $(call BuildPackage,luci-app-redsocks2))
$(eval $(call BuildPackage,luci-app-pdnsd))
$(eval $(call BuildPackage,luci-app-adbyby))




With the highlighted "if,then" course.This error appear:
Makefile:97: *** missing separator.  Stop.


Line 97 is pointing to
Package/luci-app-chinadns/install = $(call 
Package/openwrt-dist-luci/install,$(1),chinadns)
 
I've looked up the forum.Jow said this error almost always indicates that you 
used leading spaces in a place where a tab was expected.But mine did not use 
spaces.I can't find other reason causing this error.So I came here for faster 
answer than the forum.___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel