[csw-maintainers] versioning /etc
Ben Walton
bwalton at opencsw.org
Mon Jun 15 21:31:35 CEST 2009
Excerpts from Philip Brown's message of Mon Jun 15 14:52:34 -0400 2009:
> > It goes beyond CSW packages, to everything that lives in /etc.
>
> And that sounds... like a lot of work.
> At a very high level, do you have architectural suggestions as to how this
> sort of integration would function?
It actually shouldn't be that bad. My suggestion would be the tried
and true .d directory. I'd suggest something like:
/etc/opt/csw/pkg-hooks/pre.d
/etc/opt/csw/pkg-hooks/post.d
(no difference between -i and -u is required, I don't think).
pkg-get/pkgutil would then do:
---> before doing work
cd /etc/opt/csw/pkg-hooks/pre.d/
for f in *; do
[ -x $f ] && ./$f
done
---> after doing work
cd /etc/opt/csw/pkg-hooks/post.d/
for f in *; do
[ -x $f ] && ./$f
done
An alternate sort order could be applied if required...this is just a
simplistic approach.
There could (possibly) be a user settable option in csw.conf as to how
non-zero exits would be handled, thus allowing for various hooks to
prevent a run if some trigger is detected, etc.
Then, etckeeper (just as an example) would, as part of it's package,
drop a file named 01-etckeeper in pkg-hooks/pre.d/ with a script like:
#!/bin/sh
/opt/csw/bin/etckeeper preinstall
A similar post install hook would be placed in post.d.
How does that sound?
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.opencsw.org/pipermail/maintainers/attachments/20090615/07f32307/attachment-0001.asc>
More information about the maintainers
mailing list