OK, seems I still managed to overlook some things, and there are some new issues:
* The grep and thus the postinst will fail if 'environment' does not exist.
* stylistic: IMHO this would be easier to read: if ! grep -q "^R_HOME" /etc/postgresql/$cluster/environment
* The postrm should do cleanup only on "purge", not on the other actions; in particular, doing it on "upgrade" is actively wrong.
OK, seems I still managed to overlook some things, and there are some new issues:
* The grep and thus the postinst will fail if 'environment' does not exist. /$cluster/ environment
* stylistic: IMHO this would be easier to read: if ! grep -q "^R_HOME" /etc/postgresql
* The postrm should do cleanup only on "purge", not on the other actions; in particular, doing it on "upgrade" is actively wrong.
Please see http:// www.debian. org/doc/ debian- policy/ ch-maintainersc ripts.html for details.
Thanks for bearing with me!