Class: Autoproj::PackageManagers::Manager
- Inherits:
-
Object
- Object
- Autoproj::PackageManagers::Manager
- 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.
Direct Known Subclasses
BundlerManager, GemManager, PipManager, ShellScriptManager, UnknownOSManager
Instance Attribute Summary collapse
-
#enabled ⇒ Object
writeonly
Sets the attribute enabled.
-
#silent ⇒ Object
writeonly
Sets the attribute silent.
-
#ws ⇒ Workspace
readonly
The workspace.
Instance Method Summary collapse
-
#call_while_empty? ⇒ Boolean
Whether this package manager should be called even if no packages should be installed.
-
#configure_manager ⇒ Object
Perform additional configuration required for the package manager.
- #enabled? ⇒ Boolean
-
#initialize(ws) ⇒ Manager
constructor
Create a package manager.
-
#initialize_environment ⇒ Object
Overload to perform initialization of environment variables in order to have a properly functioning package manager.
-
#os_dependencies ⇒ Object
If this package manager depends on OS packages, they should be added here.
- #silent? ⇒ Boolean
-
#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.
Constructor Details
#initialize(ws) ⇒ Manager
Create a package manager
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
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
19 20 21 |
# File 'lib/autoproj/package_managers/manager.rb', line 19 def silent=(value) @silent = value end |
#ws ⇒ Workspace (readonly)
Returns the workspace.
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
32 33 34 |
# File 'lib/autoproj/package_managers/manager.rb', line 32 def call_while_empty? false end |
#configure_manager ⇒ Object
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
15 16 17 |
# File 'lib/autoproj/package_managers/manager.rb', line 15 def enabled? !!@enabled end |
#initialize_environment ⇒ Object
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_dependencies ⇒ Object
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
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
46 47 48 |
# File 'lib/autoproj/package_managers/manager.rb', line 46 def strict? false end |