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

Re: common function handling in maintainer scripts



This one time, at band camp, Frank Küster said:
> Stephen Gran <sgran@debian.org> schrieb:
> 
> > Hello all,
> >
> > I have a source package that generates multiple binary packages.
> > Since the packages are similar in a lot of ways (config file structure,
> > handling of config files, etc), I have a lot of functions that are the
> > same in several maintainer scripts.  Ideally, I would like to split them
> > out into a common_functions file, and source it each time, instead of
> > having lots of redundant code lying around.
> >
> > So, the binary packages include a -base, that all of the others using
> > maintainer scripts Depend on.I know that I can source the common functions
> > file in the postinst of all the other packages besides -base
> 
> For the teTeX-3.0 packages, I have taken a different approach, inspired
> by Davide Salvetti's nice auctex package: All the maintainer scripts,
> and even debian/rules, are created by e-Perl from their corresponding
> preinst.in, postinst.in, rules.in, etc. files, and during this
> generation process common.functions (and postrm.functions or
> postinst.functions) are included.  A file debian/variables is also
> included, which allows me to define directories, lists of files to act
> on, and similar, in a consistent way for all maintainer scripts of all
> packages.

This is a nice solution.  I will take a look at how you do it, and
hopefully get it together shortly.  Thanks for all the ideas, everyone.
-- 
 -----------------------------------------------------------------
|   ,''`.					     Stephen Gran |
|  : :' :					 sgran@debian.org |
|  `. `'			Debian user, admin, and developer |
|    `-					    http://www.debian.org |
 -----------------------------------------------------------------

Attachment: pgpOgB5WDtXSx.pgp
Description: PGP signature


Reply to: