Class: Autoproj::CLI::InspectionTool

Inherits:
Base
  • Object
show all
Defined in:
lib/autoproj/cli/inspection_tool.rb

Overview

Base class for CLI tools that do not change the state of the installed system

Instance Attribute Summary

Attributes inherited from Base

#ws

Instance Method Summary collapse

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

#finalize_setup(packages = [], non_imported_packages: :ignore, recursive: true, auto_exclude: false, read_only: false) ⇒ (Array<String>,PackageSelection,Boolean)

Finish loading the package information

Parameters:

  • packages (Array<String>) (defaults to: [])

    the list of package names

  • non_imported_packages (Symbol) (defaults to: :ignore)

    whether packages that are not yet imported should be ignored (:ignore) or returned (:return).

  • options (Hash)

    a customizable set of options

Returns:

  • ((Array<String>,PackageSelection,Boolean))

    the list of selected packages, the PackageSelection representing the selection resolution itself, and a flag telling whether some of the arguments were pointing within the configuration area



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/autoproj/cli/inspection_tool.rb', line 31

def finalize_setup(
    packages = [],
    non_imported_packages: :ignore,
    recursive: true,
    auto_exclude: false,
    read_only: false
)
    Autoproj.silent do
        packages, config_selected =
            normalize_command_line_package_selection(packages)
        # Call resolve_user_selection once to auto-add packages, so
        # that they're available to e.g. overrides.rb
        resolve_user_selection(packages)
        ws.finalize_package_setup
        source_packages, osdep_packages, resolved_selection =
            resolve_selection(packages, recursive: recursive, non_imported_packages: non_imported_packages, auto_exclude: auto_exclude)
        ws.finalize_setup(read_only: read_only)
        ws.export_installation_manifest unless read_only
        [source_packages, osdep_packages, resolved_selection, config_selected]
    end
end

#initialize_and_load(mainline: nil, read_only: false) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/autoproj/cli/inspection_tool.rb', line 8

def initialize_and_load(mainline: nil, read_only: false)
    Autoproj.silent do
        ws.setup(read_only: read_only)
        mainline = true if %w[mainline true].include?(mainline)
        ws.load_package_sets(mainline: mainline)
        ws.config.save unless read_only
        ws.setup_all_package_directories
    end
end