[csw-maintainers] GAR RFE: Variable(s) to tag files for classes instead of PROTOTYPE_FILTER

Dagobert Michelsen dam at opencsw.org
Wed Jul 1 22:21:07 CEST 2009


Hi Sebastian,

Am 01.07.2009 um 22:08 schrieb Sebastian Kayser:
> while working on postfix 2.6 i have noticed again that it is not quite
> straight-forward to assign files to classes. Instead of exposing the  
> inner
> workings of the prototype stuff to the Makefile, could we maybe get  
> some
> variables to assign files to classes (functions)?
>
> So instead of having:
>
> CONFIG_BASE = \/etc\/opt\/csw\/postfix\/
> CONFIG_FILES = access aliases canonical generic header_checks
> CONFIG_FILES += main.cf master.cf
> CONFIG_FILES += relocated transport virtual
>
> PROTOTYPE_FILTER  = awk '\
> 	$(foreach C,$(prefix $(CONFIG_BASE),$(CONFIG_FILES)), \
> 		$$$$3 ~ /^$(C)$$$$/ { $$$$2 = "cswcpsampleconf" }) \
>        ....
>
> just have something like:
>
> CONFIG_FILES = /etc/default/cswpostgrey
> CONFIG_FILES += /etc/opt/csw/postfix/access
> CONFIG_FILES += /etc/opt/csw/postfix/aliases
> CONFIG_FILES += /etc/opt/csw/postfix/canonical
> CONFIG_FILES += /etc/opt/csw/postfix/generic
> CONFIG_FILES += /etc/opt/csw/postfix/header_checks
> CONFIG_FILES += /etc/opt/csw/postfix/main.cf
> CONFIG_FILES += /etc/opt/csw/postfix/master.cf
> CONFIG_FILES += /etc/opt/csw/postfix/relocated
> CONFIG_FILES += /etc/opt/csw/postfix/transport
> CONFIG_FILES += /etc/opt/csw/postfix/virtual
>
> To me this would feel more declarative instead of the procedural way  
> we do
> it with PROTOTYE_FILTER right now (note, it can be shortened with
> $(foreach and $(prefix, just like above). It would not only tag the  
> class,
> but also wrap the other housekeeping, like moving the config files  
> to .CSW
> during the build process.
>
> (Side note: Thinking ahead, it could also be an conceptual abstraction
> level WRT to IPS: Do IPS packages still have a prototype file?)
>
> This is only an example for config files, which i encounter most  
> often.
> Other classes could be "wrapped" as well. One would just have to  
> come up
> with the requirements, a proper naming scheme for the variables,  
> and ....
> actually implement it in GAR.

For CSWcswclassutils this is already in there :-) Just define

SAMPLECONF
PRESERVECONF
INITSMF

and everything else will be taken cared of.


Bestregards

   -- Dago


More information about the maintainers mailing list