Re: conffile renaming and other sh snippets for maintainer scripts
Stefano Zacchiroli <firstname.lastname@example.org> writes:
> On Mon, Mar 02, 2009 at 08:01:42PM -0800, Steve Langasek wrote:
>> It would of course have to be in an Essential: yes package, since
>> conffile renaming has to be handled in the package preinst and we
>> wouldn't want conffile handling to involve lots of extra Pre-Depends.
>> dpkg itself is the most likely package to carry this - wishlist bug on
>> dpkg warranted?
> Instead of dpkg itself, I would prefer a new, tiny teeny package, meant
> to become a small lib of shell script snippets on which maintainer
> scripts can rely: a sort of debhelper for maintainer scripts. Of course
> it should better be maintained by the dpkg team, but I guess having a
> separate source package can ease maintenance.
I'm not sure anyone else thinks this is a good idea except me, but I still
think there's a lot of merit in writing a custom interpreter designed
specifically for Debian maintainer scripts, with built-in functionality to
handle the top 20-50 things that we have to do. I suspect that we could
replace 90-95% of our maintainer scripts with ones written in such a
stripped down mini-language, which would then be far easier to analyze,
fix, and check for consistency. We could still use shell or Perl for the
really difficult cases when full generality is needed.
The advantage of such an interpreter over a shell library is that, for
those maintainer scripts that could use it, they *can't* do anything weird
because the language has no way of expressing it. So there's no
temptation to hack around the shell library and turn a simple expression
into one that can't be automatically verified as correct. The interpreter
can also then be responsible for the difficult work of figuring out when
to call programs in all the various edge-case error-handling cases.
(The obvious disadvantage is that a bunch of maintainer scripts really do
need shell, and the ones that could use such an interpreter are already
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>