[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

-----BEGIN PGP SIGNED MESSAGE-----
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!'
fi

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.

Paul
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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCAAGBQJW6GfnAAoJEJxcmesFvXUKi2kH/0NDFYm1jB4tltH2Qr9zqHjA
FjdGsmCwz5BNs0uH+zfbU56BD/3V/RohUGm6QV7CZ0fm1UUUs7H6GAEzRBvJrQxP
zvS0DI8ljJYFgq7toJ22A2QbZlQxEv/bWnCD+hSLzw9SJDf3iwoIcrdf1pNcSsbU
3zbKK4fhNYcQsYPGoNRVwGb9SfG7ugOnz6jO0OsAFyJQbBk8flVHP9hjnTkbFzuG
l6sgoIoy8hSvNNSIq1fzMukEs06uDUBfDbeQhmiF+Gma6dTkCvO6FEA5MgM4CP+e
0OvX6Poz7+kZF44u7Ie2zL8hxItTSYwOm9nvZKkCepF3oPtZ0usGApuB6Psg13Y=
=Qwx6
-----END PGP SIGNATURE-----


More information about the phpBB-l mailing list