[phpBB] Bug#818310: phpbb3: please don't use "if ! dbc_go" in your maintainer scripts.

Paul Gevers elbrus at debian.org
Tue Mar 15 20:52:07 CET 2016

Source: phpbb3
Version: 3.0.14-1
Severity: wishlist

Hash: SHA256

Dear maintainer,

According to codesearch¹ you are using the following construction in one or
more of your maintainer scripts:
if ! dbc_go <package_name> $@ ; then
    echo 'Automatic configuration using dbconfig-common failed!'

I feel that I must explain to you why this is most likely not working as you
intended and additionally caused me quite some debugging time a while ago.

The main point is that maintainer scripts are strongly recommended to "set -e"
at the beginning of the scripts by the Debian Policy². However, if you use
constructions like "if" or "||" than the "set -e" don't propagate to the called
scripts or functions, errors in the scripts or functions are ignored and the
script continues. In the past (before version 2.0.0) dbconfig-common error
handling used to rely on the behavior of "set -e" (which of course can be
questioned, because it may not be set). Ironically that means that before
version 2.0.0 you never observed the text that you included in the echo
statement in your script.

Now, in case of errors, the error handling of dbconfig-common asks the
administrator how to proceed after the error with the
installation/configuration/removal/purging of the package. One of the options
is to abort, which is described as follows:

  * abort - Causes the operation to fail; you will need to downgrade,
    reinstall, reconfigure this package, or otherwise manually intervene
    to continue using it. This will usually also impact your ability to
    install other packages until the installation failure is resolved.

By using the "if !dbc_go" statement you are ignoring the wish of the
administrator, albeit it being the default answer. I kindly request to not use
the construction anymore. If you must, I suggest you change the answer to the
error questions to "ignore" (but please don't set the question as "seen").

Because the dbconfig-common files are sourced, I currently believe it is
incorrect to "set -e" in the dbconfig-common files.

Current maintainer of dbconfig-common

¹ https://codesearch.debian.net/perpackage-results/!%20dbc_go/2/page_0
² https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s6.1

Version: GnuPG v1


More information about the phpBB-l mailing list