Paludis-extras

back to: packages

eselect paludis-hooks

Description:

This is an extension to eselect to added support for paludis hooks in eselect, for easy enabling and disabling.

Author(s): zxy

Dependencies:

  • app-admin/eselect

Installation

without paludis-hooks installed

Just install the package.

Code:

paludis -i app-admin/eselect-paludis-hooks

if you have paludis-hooks installed

Enable the eselect extended use flag in the /etc/paludis/use.conf file, by adding eselect to the line.

Code:

* PALUDIS_HOOKS: eselect .......

Then run:

Code:

paludis -i paludis-hooks --dl-reinstall if-use-changed

Usage

To get a list of usage options run

Code:

eselect paludis-hook
which will show output like this

Code: Usage information

Usage: eselect paludis-hook < action > < options >

Standard actions:
  help                      Display help text
  usage                     Display usage information
  version                   Display version information

Extra actions:
  check < target >          Check a hook's symlinks
    target                    A hookname (from 'list' action) or 'all', to 
                              check all hooks 
  disable < target >        Disable a hook - remove symlinks
    target                    A hookname (from 'list' action) or 'all', to 
                              disable all hooks 
  enable < target >         Enable a hook
    target                    A hookname (from 'list' action) or 'all', to 
                              enable all hooks 
  list                      List hooks managable by eselect
				

To get a list of hooks that is installed, you can run the command below, which also shows the state of the hooks.

Code: List installed hooks and state

eselect paludis-hook list

To enable/disable a hook you can run a command like the one below.

Code: Enable the update-eix hook

eselect paludis-hook enable update-eix
Or

Code: Disable the update-eix hook

eselect paludis-hook disable update-eix

You can use the check command to see at witch points the hook script is being run, and if all of the symlinks are there, like this

Code: Example 1 where we check update-eix

# eselect paludis-hook check update-eix
checking update-eix ...
  update-eix.bash  should be linked to: 
                            
    sync_all_pre/ ...  OK
    sync_all_post/ ...  OK

Code: Example 2 where we check update-eix

# eselect paludis-hook check update-eix
    checking update-eix ...
    update-eix.bash  is not enabled.
    
    Checking stale links:
    sync_all_pre/ ...  no symlink ... OK
    sync_all_post/ ...  no symlink ... OK

Where is all this happening

The hooks managed via eselect paludis-hook are placed in the /usr/share/paludis/hooks/common/ folder.

eselect paludis-hook has a definition of which hook scripts need to be linked to which hook folder. These definition files are located in /usr/share/paludis/hooks/eselect/ which is of the following format

Code: Definition file format

path_to_script/hook-script hook_dir_1 hook_dir_2 ...
where path_to_script/hook-script defines the path to a script under /usr/share/paludis/hooks/ and the hook_dir_n is the hook folder where to symlink it in.

Code: Definition example for update-eix

# eselect definition file for paludis-hooks-update-eix-2.1.1
common/update-eix.bash  sync_all_pre sync_all_post
The file can have more than one line. So this way it it also possible to have something like a set of hooks defined.

If you are interested in the sources, or helping develop, then the sources can be fetched from our anonymous git repo at:

Code:

git clone git://git.paludis-extras.org/app-admin/eselect-paludis-hooks.git
				

scripts:

paludis-hook.eslect script (click to see) ( download )

    <?xml include( "src/app-admin/eselect-paludis-hooks/paludis-hook.eselect.html"); ?>

Cool external links:.