Module: Omnibus::Packager

Includes:
Logging
Defined in:
lib/omnibus/packager.rb

Defined Under Namespace

Classes: BFF, Base, DEB, MSI, Makeself, PKG, RPM, Solaris

Constant Summary collapse

PLATFORM_PACKAGER_MAP =

The list of Ohai platform families mapped to the respective packager class.

{
  'debian'   => DEB,
  'fedora'   => RPM,
  'rhel'     => RPM,
  'wrlinux'  => RPM,
  'aix'      => BFF,
  'solaris2' => Solaris,
  'windows'  => MSI,
  'mac_os_x' => PKG,
}.freeze

Class Method Summary collapse

Methods included from Logging

included

Class Method Details

.for_current_system~Packager::Base

Determine the packager for the current system. This method returns the class, not an instance of the class.

Examples:

Packager.for_current_system #=> Packager::RPM


56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/omnibus/packager.rb', line 56

def for_current_system
  family = Ohai['platform_family']

  if klass = PLATFORM_PACKAGER_MAP[family]
    klass
  else
    log.warn(log_key) do
      "Could not determine packager for `#{family}', defaulting " \
      "to `makeself'!"
    end

    Makeself
  end
end