[php-maint] Bug#664849: Bug#664849: php5-common: instllation of latest update on Testing to 5.4.0-2 fails

Sune Vuorela sune at debian.org
Wed Mar 21 18:06:26 UTC 2012

On Wednesday 21 Mar 2012 12:11:27 Ondřej Surý wrote:
> severity 664849 minor
> thank you

Hi Ondrej

I just stumbled over this bug on the rc bug maillist and thought it looked 
funny, so I investigated a bit...

> I am going to guess:
> Your /bin/sh is not POSIX shell compliant.

> > Shell: /bin/sh linked to /bin/dash

So. that's not the issue.

Next up, I tried a small shellscript

$ cat foo.sh 
#! /bin/sh

local bar="foo"

and ran it under bash and dash and in both cases I got depending on shell:

foo.sh: line 3: local: can only be used in a function 
foo.sh: 3: local: not in a function

So. it looks like you cannot use 'local' outside a function in the most common 
/bin/sh shells we have in debian.

So, where does it happen in php?

After reading thru the sourcecodes of php5 and the magic used to generate the 
postinst scripts, I got to php5-module.postinst which has some code that is 
spread all over other packages. And it has 

 local md5sum="$(md5sum ${inidir}/${inifile}.dpkg-new | sed -e 's/ .*//')"
 local old_md5sum="$(md5sum ${inidir}/${inifile} | sed -e 's/ .*//')"

that is not inside a function. But this code is only executed under very 
special circumstances that I'm not sure is actually hit under normal testing

So, the bug is there. it is real. and I think a RC severity is correct, and 
the fix is quite simple. 

The bug is just a bit hard to hit


More information about the pkg-php-maint mailing list