[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Maintainer scripts, debconf and Python



I have been attempting to write some maintainer scripts for a small bit
of software called tilelite [1], its a lightweight tileserver. My aim
was to enable the user installing the package to have something working
once the installation is finished (if they wanted to). Quite
conveniently, through debconf, this would also provide other
functionality like automated configuration via preseeding.

1: https://packages.debian.org/sid/tilelite

As the package is written in python, and I am more familiar in writing
software in python, I have currently been writing the config, postinst
and postrm scripts in python. I got the idea of doing them in python
from seeing that there is a python debconf library in Debian, and I
managed to find some initial information here [2].

2:
https://mknowles.com.au/wordpress/2009/10/09/python-debconf-configuration-by-example/

I think I am close to getting something that works, the config script
asks questions, supports backtracking and puts the right values in
debconf, there is still this sort of issue though [3]. The postinst and
postrm scripts invoke the apache scripts, and write out and remove the
relevant config files.

3: https://lists.debian.org/debian-mentors/2015/05/msg00002.html

Currently lintian gives some errors, and a load of warnings. I have
listed a couple of the errors below.


E: tilelite: forbidden-postrm-interpreter #!/usr/bin/python

https://lintian.debian.org/tags/forbidden-postrm-interpreter.html

The above page says that you have to use (sh, bash, or perl) for the
postrm script. I cannot find any information related to the interpreter
to use in the referenced Policy section, it just sets out when to use
Depends and Pre-Depends.


E: tilelite: forbidden-config-interpreter #!/usr/bin/python

https://lintian.debian.org/tags/forbidden-config-interpreter.html

This says that the config script can only count on essential packages
being installed, which directly contradicts Policy section 6.5, which
says that Pre-Depends may be assumed to be available.


I am at a bit of a loss about what to do now.

What scripts (config, postinst, postrm) could/should be in what
language? Given tilelite is written in python (and my python is better
than my perl/bash), it would be nice to use that?


Reply to: