Bug#416991: bashism in postinst script?

Lionel Le Folgoc mrpouit at ubuntu.com
Sat Mar 31 22:46:33 UTC 2007


Package: destar
Version: 0.2.0-4
Severity: normal

Hi,

I think there may be a bashism in the postinst script, since running it
with another shell (dash for example) fails.

Setting up destar (0.2.0-4ubuntu1) ...
[: 60: /etc/asterisk/destar_cfg.py: unexpected operator
[: 60: /usr/share/doc/destar/examples/destar_cfg.py.gz: unexpected operator
cp: cannot stat `/usr/share/doc/destar/examples/destar_cfg.py': No such
file or directory
dpkg: error processing destar (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 destar
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems to be on lines 34-35:
	if ! [ -a /etc/asterisk/destar_cfg.py ]; then
		if [ -a /usr/share/doc/destar/examples/destar_cfg.py.gz ]; then

According to its manpage, test -a needs 2 arguments:
       EXPRESSION1 -a EXPRESSION2
              both EXPRESSION1 and EXPRESSION2 are true

I think it could be safely replaced by:
	if ! [ -f /etc/asterisk/destar_cfg.py ]; then
		if [ -f /usr/share/doc/destar/examples/destar_cfg.py.gz ]; then

or also explicitly set #!/bin/bash instead of #!/bin/sh.

Thanks.

Cheers,
Lionel




More information about the Pkg-voip-maintainers mailing list