Class: Autoproj::CLI::OSDeps

Inherits:
InspectionTool show all
Defined in:
lib/autoproj/cli/osdeps.rb

Instance Attribute Summary

Attributes inherited from Base

#ws

Instance Method Summary collapse

Methods inherited from InspectionTool

#finalize_setup, #initialize_and_load

Methods inherited from Base

#export_env_sh, #initialize, #normalize_command_line_package_selection, #notify_env_sh_updated, #resolve_selection, #resolve_user_selection, validate_options, #validate_options, #validate_user_selection

Methods included from Ops::Tools

#common_options, #create_autobuild_package, #load_autoprojrc, #load_main_initrb

Constructor Details

This class inherits a constructor from Autoproj::CLI::Base

Instance Method Details

#run(user_selection, update: true, **options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/autoproj/cli/osdeps.rb', line 6

def run(user_selection, update: true, **options)
    initialize_and_load
    if options[:system_info]
        os_names, os_versions = ws.os_package_resolver.operating_system
        os_package_manager_names = OSPackageResolver::OS_PACKAGE_MANAGERS.values
        os_indep_managers = ws.os_package_installer.package_managers
                              .each_key.find_all do |name, manager|
            !os_package_manager_names.include?(name)
        end
        puts "OS Names:    #{(os_names - ['default']).join(', ')}"
        puts "OS Versions: #{(os_versions - ['default']).join(', ')}"
        puts "OS Package Manager: #{ws.os_package_resolver.os_package_manager}"
        puts "Available Package Managers: #{os_indep_managers.sort.join(', ')}"
        return
    end

    _, osdep_packages, resolved_selection, =
        finalize_setup(user_selection)

    shell_helpers = options.fetch(:shell_helpers, ws.config.shell_helpers?)

    ws.install_os_repositories
    ws.install_os_packages(
        osdep_packages,
        run_package_managers_without_packages: true,
        install_only: !update
    )
    export_env_sh(shell_helpers: shell_helpers)
    Main.run_post_command_hook(:update, ws, source_packages: [],
                                            osdep_packages: osdep_packages)
end