Stephen Gran <[EMAIL PROTECTED]> 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 means, of course, that all maintainer scripts ship a copy of each function definition, sometimes without even using some of them. But on the other hand I need not care about which script is run under which circumstances. In particular, I can change variable definitions, like adding/removing files, and I know that the right thing ends up in the maintainer script. In your setup, I would have to make all packages depend on the exact version of the -base package as soon as there is a change in the common_functions file. Or at least check on every upload whether this is needed. You can look at this in the experimental packages from the tetex-base source, or at deb http://people.debian.org/~frank/teTeX-3.0 experimental main deb-src http://people.debian.org/~frank/teTeX-3.0 experimental main where you can also find tetex-bin (which is stuck in NEW). Or have a look at the teTeX CVS at http://cvs.debian.org/tetex-base/debian/?cvsroot=tetex&hideattic=0#dirlist (the interesting files are all in the Attic, because sarge and sid have only teTeX-2.0.2). Regards, Frank -- Frank K�ster Inst. f. Biochemie der Univ. Z�rich Debian Developer

