Next: , Previous: , Up: Package Manager   [Contents]


2.3 Hooks

Hooks can be used in order to change the runtime behaviour of the package manager. There are a variety of package hooks, mostly self explanatory:

In order to use hooks, you will need to set the CPT_HOOK variable pointing to your hook file. Your hook file MUST be a POSIX shell script as its contents are sourced by the package manager.

The hook is given 3 variables when it is executed. Those are:

$TYPE

The type of the hook, (pre-build, post-build, etc.)

$PKG

The package that cpt is currently working on. Can be null.

$DEST

The destination of the operation. Can be null.