[csw-maintainers] package hooks (update)

Ben Walton bwalton at opencsw.org
Sat Jul 4 02:46:53 CEST 2009

Excerpts from Philip Brown's message of Thu Jul 02 18:04:45 -0400 2009:
> I dont think you should be using files to pass around arguments at all.
> particularly something as trivial as "a list of affected packages".
> I think you shoudl have the list of packages, just be passed as the
> argument list.

Ok, then.  How about the following for input to the scripts:

Each affected package (for batch hooks, the entire list, for
per-package, a single package) is passed as an argument of the form

where $svr4name corresponds to the third field of the catalog and the
$version corresponds to the second field of the catalog.

A hypothetical call to a prebatchupgrade hook might look like:

/etc/opt/csw/pkg-hooks/prebatchupgrade.d/01-CSWfoo-logupgrades CSWbar-1.2,REV=2009.06.05 CSWbaz-1.3.4,REV=2008.12.01

A hyptothetical call to a postremove hook might look like:

/etc/opt/csw/pkg-hooks/postremove.d/02-CSWbar-mailaboutremoval CSWbar-1.2,REV=2009.06.05

This should be all of the useful data we can pass to the hooks without
doing backflips.

If a specific hook wants to be able to differentiate between which
packages are being upgraded and which are installed, it can use
multiple hooks and correlate data between the calls or simply monitor
the per-package hooks instead of the batch hooks.

If a specific hook wants to check currently installed version, it can
do that in a pre* hook, possibly saving state somewhere.

For saved state, I think we should define a directory (maybe the
previously proposed /var/opt/csw/pkg-hooks/) as the place where hooks
are to store any temporary files across different hook
scripts...attempting to keep scripts away from /var/tmp.  Obviously we
won't really be able to force this, but if it's documented, those
reading the documentation to add hooks of their own will hopefully see
and use it.


Also, when we finish nailing down the details, will the required
directories be added to CSWcommon?

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/20090703/fceaefb7/attachment-0002.asc>

More information about the maintainers mailing list