Class: Autoproj::PackageManagers::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/autoproj/package_managers/manager.rb

Overview

Base class for all package managers. Subclasses must add the #install(packages) method and may add the #filter_uptodate_packages(packages) method

Package managers must be registered in PACKAGE_HANDLERS and (if applicable) OS_PACKAGE_HANDLERS.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ws) ⇒ Manager

Create a package manager

Parameters:

  • ws (Workspace)

    the underlying workspace



58
59
60
61
62
# File 'lib/autoproj/package_managers/manager.rb', line 58

def initialize(ws)
    @ws = ws
    @enabled = true
    @silent = true
end

Instance Attribute Details

#enabled=(value) ⇒ Object (writeonly)

Sets the attribute enabled

Parameters:

  • value

    the value to set the attribute enabled to.



13
14
15
# File 'lib/autoproj/package_managers/manager.rb', line 13

def enabled=(value)
  @enabled = value
end

#silent=(value) ⇒ Object (writeonly)

Sets the attribute silent

Parameters:

  • value

    the value to set the attribute silent to.



19
20
21
# File 'lib/autoproj/package_managers/manager.rb', line 19

def silent=(value)
  @silent = value
end

#wsWorkspace (readonly)

Returns the workspace.

Returns:



11
12
13
# File 'lib/autoproj/package_managers/manager.rb', line 11

def ws
  @ws
end

Instance Method Details

#call_while_empty?Boolean

Whether this package manager should be called even if no packages should be installed

This is needed if the installer has ways to get specifications of packages to install through other means than the osdep system, as e.g. BundlerManager that would install gems listed in autoproj/Gemfile

Returns:

  • (Boolean)


32
33
34
# File 'lib/autoproj/package_managers/manager.rb', line 32

def call_while_empty?
    false
end

#configure_managerObject

Perform additional configuration required for the package manager



72
73
# File 'lib/autoproj/package_managers/manager.rb', line 72

def configure_manager
end

#enabled?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/autoproj/package_managers/manager.rb', line 15

def enabled?
    !!@enabled
end

#initialize_environmentObject

Overload to perform initialization of environment variables in order to have a properly functioning package manager

This is e.g. needed for python pip or rubygems



68
69
# File 'lib/autoproj/package_managers/manager.rb', line 68

def initialize_environment
end

#os_dependenciesObject

If this package manager depends on OS packages, they should be added here



51
52
53
# File 'lib/autoproj/package_managers/manager.rb', line 51

def os_dependencies
    []
end

#silent?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/autoproj/package_managers/manager.rb', line 21

def silent?
    !!@silent
end

#strict?Boolean

Whether this package manager needs to maintain a list of all the packages that are needed for the whole installation (true), or needs only to be called with packages to install

OS package managers are generally non-strict (once a package is installed, it’s available to all). Package managers like BundlerManager are strict as they maintain a list of gems that are then made available to the whole installation

The default is false, reimplement in subclasses to return true

Returns:

  • (Boolean)


46
47
48
# File 'lib/autoproj/package_managers/manager.rb', line 46

def strict?
    false
end