lib/autoproj/cli/inspection_tool.rb in autoproj-2.14.0 vs lib/autoproj/cli/inspection_tool.rb in autoproj-2.15.0

- old
+ new

@@ -1,18 +1,18 @@ -require 'autoproj/cli/base' +require "autoproj/cli/base" module Autoproj module CLI # Base class for CLI tools that do not change the state of the installed # system class InspectionTool < Base - def initialize_and_load(mainline: nil) + def initialize_and_load(mainline: nil, read_only: false) Autoproj.silent do - ws.setup + ws.setup(read_only: read_only) mainline = true if %w[mainline true].include?(mainline) ws.load_package_sets(mainline: mainline) - ws.config.save + ws.config.save unless read_only ws.setup_all_package_directories end end # Finish loading the package information @@ -26,21 +26,27 @@ # # @return [(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 - def finalize_setup(packages = [], non_imported_packages: :ignore, recursive: true, auto_exclude: false) + 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 - ws.export_installation_manifest + ws.finalize_setup(read_only: read_only) + ws.export_installation_manifest unless read_only [source_packages, osdep_packages, resolved_selection, config_selected] end end end end