Using debconf to notify of serious postinst problems
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All,
I'm busy packaging my own software (OPUS, ITP Bug#415241) for
submission, and I'm most of the way there. I have two questions though:
1. Original tarballs
There obviously isn't an original tarball that I have patched for
Debian, since I am the upstream author too. It seems clear that Debian
still wants an original tarball created. Should I strip the "debian"
directory from my source code when creating the tarball?
2. Using debconf to notify in postinst
Part of the install is to create a database with given credentials and
import a schema. I have debconf prompting for values and I'm
successfully using these in the postinst script.
My problem/worry is this. I am asking for the root MySQL password - if
it is known - and letting the user know I'll purge this value straight
after database creation and so on.
Then, in postinst, I try to test the credentials before I go further
- -=-
if [ "$have_password" = "yes" ]
then
set +e
# try a trivial query, logging in as MySQL root
command_result=`echo "SELECT VERSION()" | mysql -h $data_hostname -u
root --password=$root_db_password 2>&1`
if [ "$?" -ne 0 ]
then
# We don't have valid root credentials
have_password="no"
# Warn the user it's all gone fubar - but this makes lintian mad,
remove for now
echo "WARNING! Invalid MySQL root credentials ..."
#db_input high opus/invalid_root_password || true
#db_go
fi
fi
- -=-
The problem is, as indicated in the comments, I wanted to use a "note"
template to warn / email the user if the credentials were wrong, before
trying to do what I could. Adding the input causes a lintian warning.
It's not *really* an input since it's just a warning screen, but is this
really bad form. Is there a better alternative?
I considered putting the test in the config script, but I thought I
couldn't rely on a dependent package being operational at that stage?
Any help is welcome, the full source is visible here:
http://foss.ulster.ac.uk/cgi-bin/viewcvs.cgi/?root=opus
if anyone wants to see more of the debian directory.
Thanks,
CT.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGA9lG0SwfPjLnaZYRAj9TAKDnqwqPQ3aXesT3IHMBSFt3yQI5YQCfWaZd
2H69NMpXJZ8Kkz2ZQ6S+5BU=
=nwyo
-----END PGP SIGNATURE-----
Reply to: