tags 363115 + pending

I see this problem in debian/unstable as well.  After adding 'set -x'
to the top of in /var/lib/dpkg/info/php4-mapscript.postinst, I get
this output when configuring the package:

  + phpver=php4
  + for SAPI in apache apache2
  + '[' -f /etc/php4/apache/php.ini ']'
  + db_get php4/extension_mapscript_apache
  + _db_cmd 'GET php4/extension_mapscript_apache'
  + echo 'GET php4/extension_mapscript_apache'
  + IFS='
  + read -r _db_internal_line
  + RET='10 php4/extension_mapscript_apache doesn'\''t exist'
  + case ${_db_internal_line%%[   ]*} in
  + return 10
  dpkg: Feil ved behandling av php4-mapscript (--configure):
   underprosessen post-installation script returnerte feilstatus 10
  Det oppsto feil ved behandling av:
  E: Sub-process /usr/bin/dpkg returned an error code (1)

A quick look in the templates included in php4-mapscript itself show
that this template is not included in the package:

  % grep Template: /var/lib/dpkg/info/php4-mapscript.templates
  Template: php4-mapscript/add_extension
  Template: php4-mapscript/remove_extension

Checking the /var/lib/dpkg/info/php4-mapscript.config more closely, I
notice that there is code to add an alias from template
php4/add_extension to php4/extension_mapscript_$SAPI, but only if
/etc/php4/$SAPI/php.ini is found when the configure script is
executed.  The same test is done in the postinst script to decide what
template to use.

I suspect the problem here is that the config script is executed
before /etc/php4/$SAPI/php.ini is available (before php4-common is
unpacked?), and the postinst script is executed after, and thus the
template is unknown when postinst executes this.  Adding 'set -x' to
the config script seem to confirm this.  It is not executed again when
I try to use 'apt-get install -f' to clean up the mess.

Removing apt-utils (to make sure config scripts are executed together
with the postinst script) shows this error:

  + db_register php4/add_extension php4/extension_mapscript_apache
  + _db_cmd 'REGISTER php4/add_extension' php4/extension_mapscript_apache
  + echo 'REGISTER php4/add_extension' php4/extension_mapscript_apache
  + IFS='
  + read -r _db_internal_line
  + RET='10 No such template, "php4/add_extension"'
  + case ${_db_internal_line%%[   ]*} in
  + return 10

There seem to be a typo in the config script.  The template is called

When trying to remove php4-mapscripts, I run into similar problems
with the prerm script.  It too is looking for the wrong template.

So the fix for this bug seem to be at least to update the config and
prerm scripts to use the correct templates.  I'm fixing in CVS.

I'm ignoring the possibility of having /etc/php4/$SAPI/php.ini
inserted after the config script but before the postinst, as I am not
quite sure how to solve that, and I hope the template naming issue is
enough to solve this problem.

Petter Reinholdtsen

Pkg-grass-devel mailing list

Reply via email to