[Debian-med-packaging] Displaying a message to the user when upgrade can't be fully automated

Emilien Klein emilien+debian at klein.st
Wed Apr 24 21:15:37 UTC 2013


Hi team,

I'm working on the postinst file for gnuhealth.
After each upgrade, the database needs to be updated. This is
performed by calling the specific tryton command:
  trytond --database=<your_database> --update=all

The default database name (as explained in GNU Health's installation
instructions) is gnuhealth, so the script checks if that database
exists, and if it does it runs the command for that database.

if the user chose to name its database differently, we have no way to
update the database automatically, but the package will be rendered
unusable before the database is manually updated. Therefore we need to
warn the user.

I first echo'd a message using stars around it, but that is:
0) not translatable
1) most probably not user-friendly/policy-compliant

So I set up about using debconf. The tutorial [0] mentions:
These questions are asked by a separate config script, not by the
postinst, so the package can be configured before it is installed, or
reconfigured after it is installed. Do not make your postinst use
debconf to ask questions.

I understand that as *questions* should not be asked from postinst
(makes sense, ask before installing, maybe the response to the
question will result in the package not being installed after all),
but that you could use it to *display* information to the user.

So that's what I added to the postinst:
db_reset gnuhealth/manualupgrade
db_input high gnuhealth/manualupgrade || true
db_go

(I reset the seen flag, since this will need to be executed manually
at each upgrade)

But Lintian is not happy, namely:
E: gnuhealth: no-debconf-config
W: gnuhealth: postinst-uses-db-input

Questions:
* Should I not be using debconf to just display this message to the user?
  * If not, what should be used that can handle translation to other languages?
  * If it is OK, can I override those 2 lintian warnings?

Cheers,
   +Emilien
[0] http://www.fifi.org/doc/debconf-doc/tutorial.html#AEN113



More information about the Debian-med-packaging mailing list