Plugin alternatives - xing/fpm-fry GitHub Wiki

This plugin manages the config of update-alternatives.

Examples

# Adds "/opt/myfoo/bin/foo" as provider for "foo" ( short form )
plugin "alternatives",
  'foo' => '/opt/myfoo/bin/foo'

# Adds "/opt/myfoo/bin/foo" as provider for "foo" ( long form )
plugin "alternatives",
  'foo' => {
    path: '/opt/myfoo/bin/foo'
  }

Options

:priority

Sets the priority of an alternative.

# Adds "/opt/myfoo/bin/foo" as provider for "foo" with priority 9001
plugin "alternatives",
  'foo' => {
    path: '/opt/myfoo/bin/foo',
    priority: 9001
  }

:link

Override the linked file. If not given it's assumed that the linked file is /usr/bin/#{name} ( e.g. /usr/bin/foo for foo ).

# Adds "/opt/myjvm/lib/libjvm.so" as provider for "libjvm.so"
plugin "alternatives",
  'libjvm.so' => {
    link: '/usr/lib/libjvm.so',
    path: '/opt/myjvm/lib/libjvm.so'
  }

:slaves

Adds more alternatives as slaves.

# Adds "/opt/myfoo/bin/foo" as provider for "foo" and "/opt/myfoo/bin/footool" as provider for "footool".
# "footool" is then a slave alternative of "foo".
plugin "alternatives",
  'foo' => {
    path: '/opt/myfoo/bin/foo',
    slaves: {
      'footool' => '/opt/myfoo/bin/footool'
    }
  }

Further readings